7
7
jobs :
8
8
test :
9
9
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
+
17
12
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
22
19
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
29
25
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
36
31
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
+
49
46
- name : Slack notification
50
47
uses : homoluctus/slatify@v2.0.1
51
48
if : failure() || cancelled()
@@ -56,68 +53,72 @@ jobs:
56
53
url : ${{ secrets.SLACK_WEBHOOK }}
57
54
commit : true
58
55
token : ${{ secrets.GITHUB_TOKEN }}
56
+
59
57
release :
60
58
name : Release
61
59
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
+
69
62
env :
70
63
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
71
64
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
72
65
CLOJARS_USERNAME : ${{ secrets.CLOJARS_USERNAME }}
73
66
CLOJARS_TOKEN : ${{ secrets.CLOJARS_TOKEN }}
67
+
74
68
steps :
75
- - uses : actions/checkout@v1
76
- - name : Maven cache
77
- id : maven-cache
78
- uses : actions/cache@v1
69
+ - uses : actions/checkout@v4
79
70
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
97
98
env :
98
99
AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
99
100
AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
100
101
CLOJARS_USERNAME : ${{ secrets.CLOJARS_USERNAME }}
101
102
CLOJARS_TOKEN : ${{ secrets.CLOJARS_TOKEN }}
102
103
GITHUB_USERNAME : ${{ github.actor }}
103
104
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104
- run : |
105
- lein -o release
105
+
106
106
# This creates a 'GitHub Release' from the tag and includes link to CHANGELOG.md at the current
107
107
# git ref. We do not use draft or prerelease features as we always want
108
108
# the latest release to show in the right hand column of the project page regardless
109
109
# 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
+
121
122
- name : Slack notification
122
123
uses : homoluctus/slatify@v2.0.1
123
124
if : always()
0 commit comments