15
15
tags : [v*]
16
16
17
17
env :
18
- PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
19
- SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
20
- SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
21
- SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
22
- PGP_SECRET : ${{ secrets.PGP_SECRET }}
23
18
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
19
20
+
21
+ concurrency :
22
+ group : ${{ github.workflow }} @ ${{ github.ref }}
23
+ cancel-in-progress : true
24
+
25
25
jobs :
26
26
build :
27
27
name : Build and Test
28
28
strategy :
29
29
matrix :
30
30
os : [ubuntu-latest]
31
- scala : [2.12.17 , 2.13.10 , 3.3.0 ]
31
+ scala : [2.12, 2.13, 3]
32
32
java : [temurin@8]
33
33
project : [rootJVM]
34
34
runs-on : ${{ matrix.os }}
35
+ timeout-minutes : 60
35
36
steps :
36
37
- name : Checkout current branch (full)
37
38
uses : actions/checkout@v3
38
39
with :
39
40
fetch-depth : 0
40
41
41
- - name : Download Java (temurin@8)
42
- id : download-java-temurin-8
43
- if : matrix.java == 'temurin@8'
44
- uses : typelevel/download-java@v2
45
- with :
46
- distribution : temurin
47
- java-version : 8
48
-
49
42
- name : Setup Java (temurin@8)
43
+ id : setup-java-temurin-8
50
44
if : matrix.java == 'temurin@8'
51
45
uses : actions/setup-java@v3
52
46
with :
53
- distribution : jdkfile
47
+ distribution : temurin
54
48
java-version : 8
55
- jdkFile : ${{ steps.download-java-temurin-8.outputs.jdkFile }}
49
+ cache : sbt
56
50
57
- - name : Cache sbt
58
- uses : actions/cache@v3
59
- with :
60
- path : |
61
- ~/.sbt
62
- ~/.ivy2/cache
63
- ~/.coursier/cache/v1
64
- ~/.cache/coursier/v1
65
- ~/AppData/Local/Coursier/Cache/v1
66
- ~/Library/Caches/Coursier/v1
67
- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
51
+ - name : sbt update
52
+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
53
+ run : sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' reload +update
68
54
69
55
- name : Check that workflows are up to date
70
56
run : sbt githubWorkflowCheck
@@ -86,11 +72,11 @@ jobs:
86
72
87
73
- name : Make target directories
88
74
if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
89
- run : mkdir -p target .js/target annotation/.jvm/target .jvm/target .native /target project/target
75
+ run : mkdir -p annotation/.jvm/target project/target
90
76
91
77
- name : Compress target directories
92
78
if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
93
- run : tar cf targets.tar target .js/target annotation/.jvm/target .jvm/target .native /target project/target
79
+ run : tar cf targets.tar annotation/.jvm/target project/target
94
80
95
81
- name : Upload target directories
96
82
if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
@@ -114,74 +100,102 @@ jobs:
114
100
with :
115
101
fetch-depth : 0
116
102
117
- - name : Download Java (temurin@8)
118
- id : download-java-temurin-8
119
- if : matrix.java == 'temurin@8'
120
- uses : typelevel/download-java@v2
121
- with :
122
- distribution : temurin
123
- java-version : 8
124
-
125
103
- name : Setup Java (temurin@8)
104
+ id : setup-java-temurin-8
126
105
if : matrix.java == 'temurin@8'
127
106
uses : actions/setup-java@v3
128
107
with :
129
- distribution : jdkfile
108
+ distribution : temurin
130
109
java-version : 8
131
- jdkFile : ${{ steps.download-java-temurin-8.outputs.jdkFile }}
110
+ cache : sbt
132
111
133
- - name : Cache sbt
134
- uses : actions/cache@v3
135
- with :
136
- path : |
137
- ~/.sbt
138
- ~/.ivy2/cache
139
- ~/.coursier/cache/v1
140
- ~/.cache/coursier/v1
141
- ~/AppData/Local/Coursier/Cache/v1
142
- ~/Library/Caches/Coursier/v1
143
- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
144
-
145
- - name : Download target directories (2.12.17, rootJVM)
112
+ - name : sbt update
113
+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
114
+ run : sbt reload +update
115
+
116
+ - name : Download target directories (2.12, rootJVM)
146
117
uses : actions/download-artifact@v3
147
118
with :
148
- name : target-${{ matrix.os }}-${{ matrix.java }}-2.12.17 -rootJVM
119
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM
149
120
150
- - name : Inflate target directories (2.12.17 , rootJVM)
121
+ - name : Inflate target directories (2.12, rootJVM)
151
122
run : |
152
123
tar xf targets.tar
153
124
rm targets.tar
154
125
155
- - name : Download target directories (2.13.10 , rootJVM)
126
+ - name : Download target directories (2.13, rootJVM)
156
127
uses : actions/download-artifact@v3
157
128
with :
158
- name : target-${{ matrix.os }}-${{ matrix.java }}-2.13.10 -rootJVM
129
+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM
159
130
160
- - name : Inflate target directories (2.13.10 , rootJVM)
131
+ - name : Inflate target directories (2.13, rootJVM)
161
132
run : |
162
133
tar xf targets.tar
163
134
rm targets.tar
164
135
165
- - name : Download target directories (3.3.0 , rootJVM)
136
+ - name : Download target directories (3, rootJVM)
166
137
uses : actions/download-artifact@v3
167
138
with :
168
- name : target-${{ matrix.os }}-${{ matrix.java }}-3.3.0 -rootJVM
139
+ name : target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM
169
140
170
- - name : Inflate target directories (3.3.0 , rootJVM)
141
+ - name : Inflate target directories (3, rootJVM)
171
142
run : |
172
143
tar xf targets.tar
173
144
rm targets.tar
174
145
175
146
- name : Import signing key
176
147
if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
148
+ env :
149
+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
150
+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
177
151
run : echo $PGP_SECRET | base64 -di | gpg --import
178
152
179
153
- name : Import signing key and strip passphrase
180
154
if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
155
+ env :
156
+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
157
+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
181
158
run : |
182
159
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
183
160
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
184
161
(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)
185
162
186
163
- name : Publish
164
+ env :
165
+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
166
+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
167
+ SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
187
168
run : sbt tlCiRelease
169
+
170
+ dependency-submission :
171
+ name : Submit Dependencies
172
+ if : github.event_name != 'pull_request'
173
+ strategy :
174
+ matrix :
175
+ os : [ubuntu-latest]
176
+ java : [temurin@8]
177
+ runs-on : ${{ matrix.os }}
178
+ steps :
179
+ - name : Checkout current branch (full)
180
+ uses : actions/checkout@v3
181
+ with :
182
+ fetch-depth : 0
183
+
184
+ - name : Setup Java (temurin@8)
185
+ id : setup-java-temurin-8
186
+ if : matrix.java == 'temurin@8'
187
+ uses : actions/setup-java@v3
188
+ with :
189
+ distribution : temurin
190
+ java-version : 8
191
+ cache : sbt
192
+
193
+ - name : sbt update
194
+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
195
+ run : sbt '++ ${{ matrix.scala }}' reload +update
196
+
197
+ - name : Submit Dependencies
198
+ uses : scalacenter/sbt-dependency-submission@v2
199
+ with :
200
+ modules-ignore : root rootJS rootJVM rootNative
201
+ configs-ignore : test scala-tool scala-doc-tool
0 commit comments