1515 tags : [v*]
1616
1717env :
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 }}
2318 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2419
20+
21+ concurrency :
22+ group : ${{ github.workflow }} @ ${{ github.ref }}
23+ cancel-in-progress : true
24+
2525jobs :
2626 build :
27- name : Build and Test
27+ name : Test
2828 strategy :
2929 matrix :
30- os : [ubuntu-latest ]
30+ os : [ubuntu-22.04 ]
3131 scala : [3, 2.13, 2.12]
3232 java : [temurin@17]
33+ project : [java-time-literals-rootJS, java-time-literals-rootJVM, java-time-literals-rootNative]
3334 runs-on : ${{ matrix.os }}
35+ timeout-minutes : 60
3436 steps :
3537 - name : Checkout current branch (full)
36- uses : actions/checkout@v3
38+ uses : actions/checkout@v5
3739 with :
3840 fetch-depth : 0
3941
40- - name : Download Java (temurin@17)
41- id : download-java-temurin-17
42- if : matrix.java == 'temurin@17'
43- uses : typelevel/download-java@v2
44- with :
45- distribution : temurin
46- java-version : 17
42+ - name : Setup sbt
43+ uses : sbt/setup-sbt@v1
4744
4845 - name : Setup Java (temurin@17)
46+ id : setup-java-temurin-17
4947 if : matrix.java == 'temurin@17'
50- uses : actions/setup-java@v3
48+ uses : actions/setup-java@v5
5149 with :
52- distribution : jdkfile
50+ distribution : temurin
5351 java-version : 17
54- jdkFile : ${{ steps.download-java-temurin-17.outputs.jdkFile }}
52+ cache : sbt
5553
56- - name : Cache sbt
57- uses : actions/cache@v3
58- with :
59- path : |
60- ~/.sbt
61- ~/.ivy2/cache
62- ~/.coursier/cache/v1
63- ~/.cache/coursier/v1
64- ~/AppData/Local/Coursier/Cache/v1
65- ~/Library/Caches/Coursier/v1
66- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
54+ - name : sbt update
55+ if : matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
56+ run : sbt +update
6757
6858 - name : Check that workflows are up to date
6959 run : sbt githubWorkflowCheck
7060
61+ - name : scalaJSLink
62+ if : matrix.project == 'java-time-literals-rootJS'
63+ run : sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult
64+
65+ - name : nativeLink
66+ if : matrix.project == 'java-time-literals-rootNative'
67+ run : sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink
68+
7169 - name : Test
72- run : sbt '++ ${{ matrix.scala }}' test
70+ run : sbt 'project ${{ matrix.project }}' ' ++ ${{ matrix.scala }}' test
7371
7472 - name : Check binary compatibility
75- if : matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest '
76- run : sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues
73+ if : matrix.java == 'temurin@17' && matrix.os == 'ubuntu-22.04 '
74+ run : sbt 'project ${{ matrix.project }}' ' ++ ${{ matrix.scala }}' mimaReportBinaryIssues
7775
7876 - name : Generate API documentation
79- if : matrix.java == 'temurin@17' && matrix.os == 'ubuntu-latest '
80- run : sbt '++ ${{ matrix.scala }}' doc
77+ if : matrix.java == 'temurin@17' && matrix.os == 'ubuntu-22.04 '
78+ run : sbt 'project ${{ matrix.project }}' ' ++ ${{ matrix.scala }}' doc
8179
8280 - name : Make target directories
8381 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
84- run : mkdir -p target core/js /target core/jvm/target core/native /target project/target
82+ run : mkdir -p core/native /target core/jvm/target core/js /target project/target
8583
8684 - name : Compress target directories
8785 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
88- run : tar cf targets.tar target core/js /target core/jvm/target core/native /target project/target
86+ run : tar cf targets.tar core/native /target core/jvm/target core/js /target project/target
8987
9088 - name : Upload target directories
9189 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
92- uses : actions/upload-artifact@v3
90+ uses : actions/upload-artifact@v4
9391 with :
94- name : target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
92+ name : target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
9593 path : targets.tar
9694
9795 publish :
@@ -100,83 +98,177 @@ jobs:
10098 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
10199 strategy :
102100 matrix :
103- os : [ubuntu-latest ]
101+ os : [ubuntu-22.04 ]
104102 java : [temurin@17]
105103 runs-on : ${{ matrix.os }}
106104 steps :
107105 - name : Checkout current branch (full)
108- uses : actions/checkout@v3
106+ uses : actions/checkout@v5
109107 with :
110108 fetch-depth : 0
111109
112- - name : Download Java (temurin@17)
113- id : download-java-temurin-17
110+ - name : Setup sbt
111+ uses : sbt/setup-sbt@v1
112+
113+ - name : Setup Java (temurin@17)
114+ id : setup-java-temurin-17
114115 if : matrix.java == 'temurin@17'
115- uses : typelevel/download -java@v2
116+ uses : actions/setup -java@v5
116117 with :
117118 distribution : temurin
118119 java-version : 17
120+ cache : sbt
119121
120- - name : Setup Java (temurin@17)
121- if : matrix.java == 'temurin@17'
122- uses : actions/setup-java@v3
122+ - name : sbt update
123+ if : matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
124+ run : sbt +update
125+
126+ - name : Download target directories (3, java-time-literals-rootJS)
127+ uses : actions/download-artifact@v4
123128 with :
124- distribution : jdkfile
125- java-version : 17
126- jdkFile : ${{ steps.download-java-temurin-17.outputs.jdkFile }}
129+ name : target-${{ matrix.os }}-${{ matrix.java }}-3-java-time-literals-rootJS
130+
131+ - name : Inflate target directories (3, java-time-literals-rootJS)
132+ run : |
133+ tar xf targets.tar
134+ rm targets.tar
127135
128- - name : Cache sbt
129- uses : actions/cache@v3
136+ - name : Download target directories (3, java-time-literals-rootJVM)
137+ uses : actions/download-artifact@v4
130138 with :
131- path : |
132- ~/.sbt
133- ~/.ivy2/cache
134- ~/.coursier/cache/v1
135- ~/.cache/coursier/v1
136- ~/AppData/Local/Coursier/Cache/v1
137- ~/Library/Caches/Coursier/v1
138- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
139+ name : target-${{ matrix.os }}-${{ matrix.java }}-3-java-time-literals-rootJVM
139140
140- - name : Download target directories (3)
141- uses : actions/download-artifact@v3
141+ - name : Inflate target directories (3, java-time-literals-rootJVM)
142+ run : |
143+ tar xf targets.tar
144+ rm targets.tar
145+
146+ - name : Download target directories (3, java-time-literals-rootNative)
147+ uses : actions/download-artifact@v4
142148 with :
143- name : target-${{ matrix.os }}-${{ matrix.java }}-3
149+ name : target-${{ matrix.os }}-${{ matrix.java }}-3-java-time-literals-rootNative
144150
145- - name : Inflate target directories (3)
151+ - name : Inflate target directories (3, java-time-literals-rootNative )
146152 run : |
147153 tar xf targets.tar
148154 rm targets.tar
149155
150- - name : Download target directories (2.13)
151- uses : actions/download-artifact@v3
156+ - name : Download target directories (2.13, java-time-literals-rootJS )
157+ uses : actions/download-artifact@v4
152158 with :
153- name : target-${{ matrix.os }}-${{ matrix.java }}-2.13
159+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-java-time-literals-rootJS
154160
155- - name : Inflate target directories (2.13)
161+ - name : Inflate target directories (2.13, java-time-literals-rootJS )
156162 run : |
157163 tar xf targets.tar
158164 rm targets.tar
159165
160- - name : Download target directories (2.12 )
161- uses : actions/download-artifact@v3
166+ - name : Download target directories (2.13, java-time-literals-rootJVM )
167+ uses : actions/download-artifact@v4
162168 with :
163- name : target-${{ matrix.os }}-${{ matrix.java }}-2.12
169+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-java-time-literals-rootJVM
164170
165- - name : Inflate target directories (2.12)
171+ - name : Inflate target directories (2.13, java-time-literals-rootJVM)
172+ run : |
173+ tar xf targets.tar
174+ rm targets.tar
175+
176+ - name : Download target directories (2.13, java-time-literals-rootNative)
177+ uses : actions/download-artifact@v4
178+ with :
179+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13-java-time-literals-rootNative
180+
181+ - name : Inflate target directories (2.13, java-time-literals-rootNative)
182+ run : |
183+ tar xf targets.tar
184+ rm targets.tar
185+
186+ - name : Download target directories (2.12, java-time-literals-rootJS)
187+ uses : actions/download-artifact@v4
188+ with :
189+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-java-time-literals-rootJS
190+
191+ - name : Inflate target directories (2.12, java-time-literals-rootJS)
192+ run : |
193+ tar xf targets.tar
194+ rm targets.tar
195+
196+ - name : Download target directories (2.12, java-time-literals-rootJVM)
197+ uses : actions/download-artifact@v4
198+ with :
199+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-java-time-literals-rootJVM
200+
201+ - name : Inflate target directories (2.12, java-time-literals-rootJVM)
202+ run : |
203+ tar xf targets.tar
204+ rm targets.tar
205+
206+ - name : Download target directories (2.12, java-time-literals-rootNative)
207+ uses : actions/download-artifact@v4
208+ with :
209+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.12-java-time-literals-rootNative
210+
211+ - name : Inflate target directories (2.12, java-time-literals-rootNative)
166212 run : |
167213 tar xf targets.tar
168214 rm targets.tar
169215
170216 - name : Import signing key
171217 if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
172- run : echo $PGP_SECRET | base64 -di | gpg --import
218+ env :
219+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
220+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
221+ run : echo $PGP_SECRET | base64 -d -i - | gpg --import
173222
174223 - name : Import signing key and strip passphrase
175224 if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
225+ env :
226+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
227+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
176228 run : |
177- echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
229+ echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
178230 echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
179231 (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)
180232
181233 - name : Publish
234+ env :
235+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
236+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
237+ SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
182238 run : sbt tlCiRelease
239+
240+ dependency-submission :
241+ name : Submit Dependencies
242+ if : github.event.repository.fork == false && github.event_name != 'pull_request'
243+ strategy :
244+ matrix :
245+ os : [ubuntu-22.04]
246+ java : [temurin@17]
247+ runs-on : ${{ matrix.os }}
248+ steps :
249+ - name : Checkout current branch (full)
250+ uses : actions/checkout@v5
251+ with :
252+ fetch-depth : 0
253+
254+ - name : Setup sbt
255+ uses : sbt/setup-sbt@v1
256+
257+ - name : Setup Java (temurin@17)
258+ id : setup-java-temurin-17
259+ if : matrix.java == 'temurin@17'
260+ uses : actions/setup-java@v5
261+ with :
262+ distribution : temurin
263+ java-version : 17
264+ cache : sbt
265+
266+ - name : sbt update
267+ if : matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
268+ run : sbt +update
269+
270+ - name : Submit Dependencies
271+ uses : scalacenter/sbt-dependency-submission@v2
272+ with :
273+ modules-ignore : java-time-literals-rootjs_2.13 java-time-literals-rootjs_2.12 java-time-literals-rootjs_3 java-time-literals-rootjvm_2.13 java-time-literals-rootjvm_2.12 java-time-literals-rootjvm_3 java-time-literals-rootnative_2.13 java-time-literals-rootnative_2.12 java-time-literals-rootnative_3
274+ configs-ignore : test scala-tool scala-doc-tool test-internal
0 commit comments