15
15
tags : [v*]
16
16
17
17
env :
18
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
19
- SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
18
+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
20
19
SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
20
+ SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
21
+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
21
22
PGP_SECRET : ${{ secrets.PGP_SECRET }}
23
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
22
24
23
25
jobs :
24
26
build :
25
27
name : Build and Test
26
28
strategy :
29
+ fail-fast : false
27
30
matrix :
28
31
os : [ubuntu-latest]
29
32
scala : [3.1.1, 2.12.15, 2.13.8]
30
- java : [temurin@8]
33
+ java : [temurin@8, temurin@11, temurin@17]
34
+ project : [rootJS, rootJVM]
35
+ jsenv : [NodeJS, Chrome, Firefox]
36
+ exclude :
37
+ - scala : 3.1.1
38
+ java : temurin@11
39
+ - scala : 3.1.1
40
+ java : temurin@17
41
+ - scala : 2.12.15
42
+ java : temurin@11
43
+ - scala : 2.12.15
44
+ java : temurin@17
45
+ - project : rootJS
46
+ java : temurin@11
47
+ - project : rootJS
48
+ java : temurin@17
49
+ - scala : 3.1.1
50
+ jsenv : Chrome
51
+ - scala : 3.1.1
52
+ jsenv : Firefox
53
+ - scala : 2.12.15
54
+ jsenv : Chrome
55
+ - scala : 2.12.15
56
+ jsenv : Firefox
57
+ - project : rootJVM
58
+ jsenv : Chrome
59
+ - project : rootJVM
60
+ jsenv : Firefox
31
61
runs-on : ${{ matrix.os }}
32
62
steps :
33
63
- name : Checkout current branch (full)
42
72
distribution : temurin
43
73
java-version : 8
44
74
75
+ - name : Setup Java (temurin@11)
76
+ if : matrix.java == 'temurin@11'
77
+ uses : actions/setup-java@v2
78
+ with :
79
+ distribution : temurin
80
+ java-version : 11
81
+
82
+ - name : Setup Java (temurin@17)
83
+ if : matrix.java == 'temurin@17'
84
+ uses : actions/setup-java@v2
85
+ with :
86
+ distribution : temurin
87
+ java-version : 17
88
+
45
89
- name : Cache sbt
46
90
uses : actions/cache@v2
47
91
with :
@@ -55,22 +99,50 @@ jobs:
55
99
key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
56
100
57
101
- name : Setup NodeJS v14 LTS
102
+ if : matrix.project == 'rootJS' && matrix.jsenv == 'NodeJS'
58
103
59
104
with :
60
105
node-version : 14
61
106
62
107
- name : Check that workflows are up to date
63
- run : sbt ++${{ matrix.scala }} githubWorkflowCheck
108
+ run : ' sbt '' project ${{ matrix.project }} '' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }} '' '' project / '' githubWorkflowCheck'
64
109
65
- - run : sbt ++${{ matrix.scala }} ci
110
+ - name : Check headers and formatting
111
+ if : matrix.java == 'temurin@8'
112
+ run : ' sbt '' project ${{ matrix.project }}'' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' headerCheckAll scalafmtCheckAll '' project /'' scalafmtSbtCheck'
113
+
114
+ - name : scalaJSLink
115
+ if : matrix.project == 'rootJS'
116
+ run : ' sbt '' project ${{ matrix.project }}'' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' Test/scalaJSLinkerResult'
117
+
118
+ - name : Test
119
+ run : ' sbt '' project ${{ matrix.project }}'' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' test'
120
+
121
+ - name : Check binary compatibility
122
+ if : matrix.java == 'temurin@8'
123
+ run : ' sbt '' project ${{ matrix.project }}'' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' mimaReportBinaryIssues'
124
+
125
+ - name : Generate API documentation
126
+ if : matrix.java == 'temurin@8'
127
+ run : ' sbt '' project ${{ matrix.project }}'' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' doc'
128
+
129
+ - name : Check unused compile dependencies
130
+ if : matrix.java == 'temurin@8'
131
+ run : ' sbt '' project ${{ matrix.project }}'' '' ++${{ matrix.scala }}'' '' set Global / useJSEnv := JSEnv.${{ matrix.jsenv }}'' unusedCompileDependenciesTest'
132
+
133
+ - name : Make target directories
134
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
135
+ run : mkdir -p crypto/jvm/target target .js/target .jvm/target .native/target test-runtime/.jvm/target crypto/js/target test-runtime/.js/target project/target
66
136
67
137
- name : Compress target directories
68
- run : tar cf targets.tar crypto/jvm/target target rootJS/target rootJVM/target test-runtime/.jvm/target crypto/js/target test-runtime/.js/target project/target
138
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
139
+ run : tar cf targets.tar crypto/jvm/target target .js/target .jvm/target .native/target test-runtime/.jvm/target crypto/js/target test-runtime/.js/target project/target
69
140
70
141
- name : Upload target directories
142
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
71
143
uses : actions/upload-artifact@v2
72
144
with :
73
- name : target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
145
+ name : target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix. scala }}-${{ matrix.jsenv }}-${{ matrix.project }}
74
146
path : targets.tar
75
147
76
148
publish :
@@ -96,6 +168,20 @@ jobs:
96
168
distribution : temurin
97
169
java-version : 8
98
170
171
+ - name : Setup Java (temurin@11)
172
+ if : matrix.java == 'temurin@11'
173
+ uses : actions/setup-java@v2
174
+ with :
175
+ distribution : temurin
176
+ java-version : 11
177
+
178
+ - name : Setup Java (temurin@17)
179
+ if : matrix.java == 'temurin@17'
180
+ uses : actions/setup-java@v2
181
+ with :
182
+ distribution : temurin
183
+ java-version : 17
184
+
99
185
- name : Cache sbt
100
186
uses : actions/cache@v2
101
187
with :
@@ -108,37 +194,76 @@ jobs:
108
194
~/Library/Caches/Coursier/v1
109
195
key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
110
196
111
- - name : Download target directories (3.1.1)
197
+ - name : Download target directories (3.1.1, NodeJS, rootJS)
198
+ uses : actions/download-artifact@v2
199
+ with :
200
+ name : target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-NodeJS-rootJS
201
+
202
+ - name : Inflate target directories (3.1.1, NodeJS, rootJS)
203
+ run : |
204
+ tar xf targets.tar
205
+ rm targets.tar
206
+
207
+ - name : Download target directories (3.1.1, NodeJS, rootJVM)
112
208
uses : actions/download-artifact@v2
113
209
with :
114
- name : target-${{ matrix.os }}-3.1.1- ${{ matrix.java }}
210
+ name : target-${{ matrix.os }}-${{ matrix.java }}-3.1.1-NodeJS-rootJVM
115
211
116
- - name : Inflate target directories (3.1.1)
212
+ - name : Inflate target directories (3.1.1, NodeJS, rootJVM )
117
213
run : |
118
214
tar xf targets.tar
119
215
rm targets.tar
120
216
121
- - name : Download target directories (2.12.15)
217
+ - name : Download target directories (2.12.15, NodeJS, rootJS )
122
218
uses : actions/download-artifact@v2
123
219
with :
124
- name : target-${{ matrix.os }}-2.12.15- ${{ matrix.java }}
220
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-NodeJS-rootJS
125
221
126
- - name : Inflate target directories (2.12.15)
222
+ - name : Inflate target directories (2.12.15, NodeJS, rootJS )
127
223
run : |
128
224
tar xf targets.tar
129
225
rm targets.tar
130
226
131
- - name : Download target directories (2.13.8 )
227
+ - name : Download target directories (2.12.15, NodeJS, rootJVM )
132
228
uses : actions/download-artifact@v2
133
229
with :
134
- name : target-${{ matrix.os }}-2.13.8- ${{ matrix.java }}
230
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12.15-NodeJS-rootJVM
135
231
136
- - name : Inflate target directories (2.13.8)
232
+ - name : Inflate target directories (2.12.15, NodeJS, rootJVM)
233
+ run : |
234
+ tar xf targets.tar
235
+ rm targets.tar
236
+
237
+ - name : Download target directories (2.13.8, NodeJS, rootJS)
238
+ uses : actions/download-artifact@v2
239
+ with :
240
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-NodeJS-rootJS
241
+
242
+ - name : Inflate target directories (2.13.8, NodeJS, rootJS)
243
+ run : |
244
+ tar xf targets.tar
245
+ rm targets.tar
246
+
247
+ - name : Download target directories (2.13.8, NodeJS, rootJVM)
248
+ uses : actions/download-artifact@v2
249
+ with :
250
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13.8-NodeJS-rootJVM
251
+
252
+ - name : Inflate target directories (2.13.8, NodeJS, rootJVM)
137
253
run : |
138
254
tar xf targets.tar
139
255
rm targets.tar
140
256
141
257
- name : Import signing key
142
- run : echo $PGP_SECRET | base64 -d | gpg --import
258
+ if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
259
+ run : echo $PGP_SECRET | base64 -di | gpg --import
260
+
261
+ - name : Import signing key and strip passphrase
262
+ if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
263
+ run : |
264
+ echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
265
+ echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
266
+ (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
143
267
144
- - run : sbt ++${{ matrix.scala }} release
268
+ - name : Publish
269
+ run : sbt '++${{ matrix.scala }}' tlRelease
0 commit comments