Skip to content

Commit 37d2900

Browse files
committed
Update & simplify github actions
1 parent c9b1571 commit 37d2900

File tree

6 files changed

+183
-147
lines changed

6 files changed

+183
-147
lines changed

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

Lines changed: 77 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,42 @@ 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:
18-
- uses: actions/checkout@v1
19-
- name: Maven cache
20-
id: maven-cache
21-
uses: actions/cache@v1
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-tags: true
16+
17+
- name: Setup java
18+
uses: actions/setup-java@v3
2219
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
20+
distribution: 'temurin'
21+
java-version: '21'
22+
23+
- name: Install clojure tools
24+
uses: DeLaGuardo/setup-clojure@12.5
2925
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
26+
cli: 'latest'
27+
bb: 'latest'
28+
29+
- name: Cache clojure dependencies
30+
uses: actions/cache@v3
3631
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
32+
path: |
33+
~/.m2/repository
34+
~/.gitlibs
35+
~/.deps.clj
36+
~/.npm
37+
.shadow-cljs
38+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
39+
restore-keys: cljdeps-
40+
41+
- name: Fix git dubious directory ownership error
42+
run: git config --global --add safe.directory /__w/re-com/re-com
43+
44+
- run: lein prod-once
45+
4946
- name: Slack notification
5047
uses: homoluctus/slatify@v2.0.1
5148
if: failure() || cancelled()
@@ -56,68 +53,72 @@ jobs:
5653
url: ${{ secrets.SLACK_WEBHOOK }}
5754
commit: true
5855
token: ${{ secrets.GITHUB_TOKEN }}
56+
5957
release:
6058
name: Release
6159
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 }}
60+
runs-on: ubuntu-22.04
61+
6962
env:
7063
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
7164
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7265
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
7366
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
67+
7468
steps:
75-
- uses: actions/checkout@v1
76-
- name: Maven cache
77-
id: maven-cache
78-
uses: actions/cache@v1
69+
- uses: actions/checkout@v4
7970
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'
71+
fetch-tags: true
72+
73+
- name: Setup java
74+
uses: actions/setup-java@v3
75+
with:
76+
distribution: 'temurin'
77+
java-version: '21'
78+
79+
- name: Install clojure tools
80+
uses: DeLaGuardo/setup-clojure@12.5
81+
with:
82+
cli: 'latest'
83+
bb: 'latest'
84+
85+
- name: Cache clojure dependencies
86+
uses: actions/cache@v3
87+
with:
88+
path: |
89+
~/.m2/repository
90+
~/.gitlibs
91+
~/.deps.clj
92+
~/.npm
93+
.shadow-cljs
94+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
95+
restore-keys: cljdeps-
96+
97+
- run: lein release
9798
env:
9899
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
99100
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
100101
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
101102
CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }}
102103
GITHUB_USERNAME: ${{ github.actor }}
103104
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104-
run: |
105-
lein -o release
105+
106106
# This creates a 'GitHub Release' from the tag and includes link to CHANGELOG.md at the current
107107
# git ref. We do not use draft or prerelease features as we always want
108108
# the latest release to show in the right hand column of the project page regardless
109109
# 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
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
121+
121122
- name: Slack notification
122123
uses: homoluctus/slatify@v2.0.1
123124
if: always()

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

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,54 @@ 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:
15-
- uses: actions/checkout@v1
16-
- name: Maven cache
17-
uses: actions/cache@v1
18-
id: maven-cache
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-tags: true
16+
17+
- name: Setup java
18+
uses: actions/setup-java@v3
1919
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
20+
distribution: 'temurin'
21+
java-version: '21'
22+
23+
- name: Install clojure tools
24+
uses: DeLaGuardo/setup-clojure@12.5
2625
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
26+
cli: 'latest'
27+
bb: 'latest'
28+
29+
- name: Cache clojure dependencies
30+
uses: actions/cache@v3
3331
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
32+
path: |
33+
~/.m2/repository
34+
~/.gitlibs
35+
~/.deps.clj
36+
~/.npm
37+
.shadow-cljs
38+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
39+
restore-keys: cljdeps-
40+
41+
- name: Fix git dubious directory ownership error
42+
run: git config --global --add safe.directory /__w/re-com/re-com
43+
44+
- run: bb ci
45+
46+
- run: bb build-report-ci
47+
48+
- uses: actions/upload-artifact@v4
4749
with:
4850
name: build-report
4951
path: target/build-report.html
52+
5053
- name: Slack notification
5154
uses: homoluctus/slatify@v2.0.1
5255
if: failure() || cancelled()

.github/workflows/docs-workflow.yml

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,44 @@ 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:
20-
- uses: actions/checkout@v1
21-
- name: Maven cache
22-
id: maven-cache
23-
uses: actions/cache@v1
19+
- uses: actions/checkout@v4
2420
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
21+
fetch-tags: true
22+
23+
- name: Setup java
24+
uses: actions/setup-java@v3
3125
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'
26+
distribution: 'temurin'
27+
java-version: '21'
28+
29+
- name: Install clojure tools
30+
uses: DeLaGuardo/setup-clojure@12.5
31+
with:
32+
cli: 'latest'
33+
bb: 'latest'
34+
35+
- name: Cache clojure dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: |
39+
~/.m2/repository
40+
~/.gitlibs
41+
~/.deps.clj
42+
~/.npm
43+
.shadow-cljs
44+
key: cljdeps-${{ hashFiles('deps.edn') }}-${{ hashFiles ('package.json') }}-${{ hashFiles ('package-lock.json') }}
45+
restore-keys: cljdeps-
46+
47+
- run: bb deploy-aws
5048
env:
5149
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
5250
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -55,8 +53,7 @@ jobs:
5553
GITHUB_USERNAME: ${{ github.actor }}
5654
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5755
AWS_EC2_METADATA_DISABLED: true
58-
run: |
59-
lein -o deploy-aws
56+
6057
- name: Invalidate CloudFront Distribution
6158
uses: chetan/invalidate-cloudfront-action@master
6259
env:
@@ -65,6 +62,7 @@ jobs:
6562
AWS_REGION: 'us-east-1'
6663
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
6764
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
65+
6866
- name: Slack notification
6967
uses: homoluctus/slatify@v2.0.1
7068
if: always()

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
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)