Skip to content

Commit 2cac684

Browse files
committed
Update & simplify github actions
1 parent c9b1571 commit 2cac684

6 files changed

+171
-143
lines changed

.github/workflows/continuous-deployment-workflow.yml

+71-74
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,40 @@ on:
77
jobs:
88
test:
99
name: Test
10-
runs-on: ubuntu-20.04
11-
container:
12-
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
13-
image: ghcr.io/day8/chrome-56:2
14-
credentials:
15-
username: ${{ github.actor }}
16-
password: ${{ secrets.GITHUB_TOKEN }}
10+
runs-on: ubuntu-22.04
11+
1712
steps:
1813
- uses: actions/checkout@v1
19-
- name: Maven cache
20-
id: maven-cache
21-
uses: actions/cache@v1
14+
15+
- name: Setup java
16+
uses: actions/setup-java@v3
2217
with:
23-
path: /root/.m2/repository
24-
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj', '.github/workflows/**') }}
25-
restore-keys: |
26-
${{ runner.os }}-maven-
27-
- name: npm cache
28-
uses: actions/cache@v1
18+
distribution: 'temurin'
19+
java-version: '21'
20+
21+
- name: Install clojure tools
22+
uses: DeLaGuardo/[email protected]
2923
with:
30-
path: ~/.npm
31-
key: ${{ runner.os }}-npm-${{ hashFiles('project.clj') }}-${{ hashFiles('**/deps.cljs') }}
32-
restore-keys: |
33-
${{ runner.os }}-npm-
34-
- name: shadow-cljs compiler cache
35-
uses: actions/cache@v1
24+
cli: 'latest'
25+
bb: 'latest'
26+
27+
- name: Cache clojure dependencies
28+
uses: actions/cache@v3
3629
with:
37-
path: .shadow-cljs
38-
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
39-
restore-keys: |
40-
${{ runner.os }}-shadow-cljs-
41-
- if: steps.maven-cache.outputs.cache-hit != 'true'
42-
run: |
43-
lein ci
44-
lein prod-once
45-
- if: steps.maven-cache.outputs.cache-hit == 'true'
46-
run: |
47-
lein -o ci
48-
lein -o prod-once
30+
path: |
31+
~/.m2/repository
32+
~/.gitlibs
33+
~/.deps.clj
34+
~/.npm
35+
.shadow-cljs
36+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
37+
restore-keys: cljdeps-
38+
39+
- name: Fix git dubious directory ownership error
40+
run: git config --global --add safe.directory /__w/re-com/re-com
41+
42+
- run: lein prod-once
43+
4944
- name: Slack notification
5045
uses: homoluctus/[email protected]
5146
if: failure() || cancelled()
@@ -56,68 +51,70 @@ jobs:
5651
url: ${{ secrets.SLACK_WEBHOOK }}
5752
commit: true
5853
token: ${{ secrets.GITHUB_TOKEN }}
54+
5955
release:
6056
name: Release
6157
needs: test
62-
runs-on: ubuntu-20.04
63-
container:
64-
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
65-
image: ghcr.io/day8/chrome-56:2
66-
credentials:
67-
username: ${{ github.actor }}
68-
password: ${{ secrets.GITHUB_TOKEN }}
58+
runs-on: ubuntu-22.04
59+
6960
env:
7061
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
7162
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7263
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
7364
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
65+
7466
steps:
7567
- uses: actions/checkout@v1
76-
- name: Maven cache
77-
id: maven-cache
78-
uses: actions/cache@v1
68+
69+
- name: Setup java
70+
uses: actions/setup-java@v3
7971
with:
80-
path: /root/.m2/repository
81-
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj', '.github/workflows/**') }}
82-
restore-keys: |
83-
${{ runner.os }}-maven-
84-
- name: Run lein release
85-
if: steps.maven-cache.outputs.cache-hit != 'true'
86-
env:
87-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
88-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
89-
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
90-
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
91-
GITHUB_USERNAME: ${{ github.actor }}
92-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93-
run: |
94-
lein release
95-
- name: Run lein -o release
96-
if: steps.maven-cache.outputs.cache-hit == 'true'
72+
distribution: 'temurin'
73+
java-version: '21'
74+
75+
- name: Install clojure tools
76+
uses: DeLaGuardo/[email protected]
77+
with:
78+
cli: 'latest'
79+
bb: 'latest'
80+
81+
- name: Cache clojure dependencies
82+
uses: actions/cache@v3
83+
with:
84+
path: |
85+
~/.m2/repository
86+
~/.gitlibs
87+
~/.deps.clj
88+
~/.npm
89+
.shadow-cljs
90+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
91+
restore-keys: cljdeps-
92+
93+
- run: lein release
9794
env:
9895
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
9996
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
10097
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
10198
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
10299
GITHUB_USERNAME: ${{ github.actor }}
103100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104-
run: |
105-
lein -o release
101+
106102
# This creates a 'GitHub Release' from the tag and includes link to CHANGELOG.md at the current
107103
# git ref. We do not use draft or prerelease features as we always want
108104
# the latest release to show in the right hand column of the project page regardless
109105
# of if it is a stable release.
110-
- name: Create GitHub Release
111-
uses: actions/create-release@v1
112-
env:
113-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114-
with:
115-
tag_name: ${{ github.ref }}
116-
release_name: ${{ github.ref }}
117-
body: |
118-
[Changelog](https://github.com/day8/re-com/blob/master/CHANGELOG.md)
119-
draft: false
120-
prerelease: false
106+
# - name: Create GitHub Release
107+
# uses: actions/create-release@v1
108+
# env:
109+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
# with:
111+
# tag_name: ${{ github.ref }}
112+
# release_name: ${{ github.ref }}
113+
# body: |
114+
# [Changelog](https://github.com/day8/re-com/blob/master/CHANGELOG.md)
115+
# draft: false
116+
# prerelease: false
117+
121118
- name: Slack notification
122119
uses: homoluctus/[email protected]
123120
if: always()

.github/workflows/continuous-integration-workflow.yml

+36-35
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,52 @@ name: ci
22
on: [push]
33

44
jobs:
5+
56
test:
7+
68
name: Test
7-
runs-on: ubuntu-20.04
8-
container:
9-
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
10-
image: ghcr.io/day8/chrome-56:2
11-
credentials:
12-
username: ${{ github.actor }}
13-
password: ${{ secrets.GITHUB_TOKEN }}
9+
10+
runs-on: ubuntu-22.04
11+
1412
steps:
1513
- uses: actions/checkout@v1
16-
- name: Maven cache
17-
uses: actions/cache@v1
18-
id: maven-cache
14+
15+
- name: Setup java
16+
uses: actions/setup-java@v3
1917
with:
20-
path: /root/.m2/repository
21-
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj', 'deps.edn', '.github/workflows/**') }}
22-
restore-keys: |
23-
${{ runner.os }}-maven-
24-
- name: npm cache
25-
uses: actions/cache@v1
18+
distribution: 'temurin'
19+
java-version: '21'
20+
21+
- name: Install clojure tools
22+
uses: DeLaGuardo/[email protected]
2623
with:
27-
path: ~/.npm
28-
key: ${{ runner.os }}-npm-${{ hashFiles('package.json', 'package-lock.json') }}
29-
restore-keys: |
30-
${{ runner.os }}-npm-
31-
- name: shadow-cljs compiler cache
32-
uses: actions/cache@v1
24+
cli: 'latest'
25+
bb: 'latest'
26+
27+
- name: Cache clojure dependencies
28+
uses: actions/cache@v3
3329
with:
34-
path: .shadow-cljs
35-
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
36-
restore-keys: |
37-
${{ runner.os }}-shadow-cljs-
38-
- if: steps.maven-cache.outputs.cache-hit != 'true'
39-
run: |
40-
lein ci
41-
lein build-report-ci
42-
- if: steps.maven-cache.outputs.cache-hit == 'true'
43-
run: |
44-
lein -o ci
45-
lein -o build-report-ci
46-
- uses: actions/upload-artifact@v2
30+
path: |
31+
~/.m2/repository
32+
~/.gitlibs
33+
~/.deps.clj
34+
~/.npm
35+
.shadow-cljs
36+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
37+
restore-keys: cljdeps-
38+
39+
- name: Fix git dubious directory ownership error
40+
run: git config --global --add safe.directory /__w/re-com/re-com
41+
42+
- run: bb ci
43+
44+
- run: bb build-report-ci
45+
46+
- uses: actions/upload-artifact@v4
4747
with:
4848
name: build-report
4949
path: target/build-report.html
50+
5051
- name: Slack notification
5152
uses: homoluctus/[email protected]
5253
if: failure() || cancelled()

.github/workflows/docs-workflow.yml

+29-33
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,42 @@ on:
77
jobs:
88
deploy:
99
name: Deploy
10-
runs-on: ubuntu-20.04
11-
container:
12-
# Source: https://github.com/day8/dockerfiles-for-dev-ci-images
13-
image: ghcr.io/day8/chrome-56:2
10+
runs-on: ubuntu-22.04
11+
1412
env:
1513
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
1614
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1715
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
1816
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
17+
1918
steps:
2019
- uses: actions/checkout@v1
21-
- name: Maven cache
22-
id: maven-cache
23-
uses: actions/cache@v1
20+
21+
- name: Setup java
22+
uses: actions/setup-java@v3
2423
with:
25-
path: /root/.m2/repository
26-
key: ${{ runner.os }}-maven-${{ hashFiles('**/project.clj') }}
27-
restore-keys: |
28-
${{ runner.os }}-maven-
29-
- name: npm cache
30-
uses: actions/cache@v1
24+
distribution: 'temurin'
25+
java-version: '21'
26+
27+
- name: Install clojure tools
28+
uses: DeLaGuardo/[email protected]
3129
with:
32-
path: ~/.npm
33-
key: ${{ runner.os }}-npm-${{ hashFiles('project.clj') }}-${{ hashFiles('**/deps.cljs') }}
34-
restore-keys: |
35-
${{ runner.os }}-npm-
36-
- name: Run lein deploy-aws
37-
if: steps.maven-cache.outputs.cache-hit != 'true'
38-
env:
39-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
40-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
41-
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
42-
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
43-
GITHUB_USERNAME: ${{ github.actor }}
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
AWS_EC2_METADATA_DISABLED: true
46-
run: |
47-
lein deploy-aws
48-
- name: Run lein -o deploy-aws
49-
if: steps.maven-cache.outputs.cache-hit == 'true'
30+
cli: 'latest'
31+
bb: 'latest'
32+
33+
- name: Cache clojure dependencies
34+
uses: actions/cache@v3
35+
with:
36+
path: |
37+
~/.m2/repository
38+
~/.gitlibs
39+
~/.deps.clj
40+
~/.npm
41+
.shadow-cljs
42+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
43+
restore-keys: cljdeps-
44+
45+
- run: bb deploy-aws
5046
env:
5147
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
5248
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -55,8 +51,7 @@ jobs:
5551
GITHUB_USERNAME: ${{ github.actor }}
5652
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5753
AWS_EC2_METADATA_DISABLED: true
58-
run: |
59-
lein -o deploy-aws
54+
6055
- name: Invalidate CloudFront Distribution
6156
uses: chetan/invalidate-cloudfront-action@master
6257
env:
@@ -65,6 +60,7 @@ jobs:
6560
AWS_REGION: 'us-east-1'
6661
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
6762
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
63+
6864
- name: Slack notification
6965
uses: homoluctus/[email protected]
7066
if: always()

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
> Committed but unreleased changes are put here, at the top. Older releases are detailed chronologically below.
44
5+
## 2.21.0 (2024-04-24)
6+
7+
#### Added
8+
9+
- New tooling, using `bb.edn` and `deps.edn`.
10+
11+
512
## 2.20.0 (2024-04-23)
613

714
#### Added

0 commit comments

Comments
 (0)