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 ]
31- scala : [2.13.11 , 3.3.0 ]
30+ os : [ubuntu-22.04 ]
31+ scala : [2.13, 3]
3232 java : [temurin@8]
3333 runs-on : ${{ matrix.os }}
34+ timeout-minutes : 60
3435 steps :
3536 - name : Checkout current branch (full)
36- uses : actions/checkout@v3
37+ uses : actions/checkout@v4
3738 with :
3839 fetch-depth : 0
3940
40- - name : Download Java (temurin@8)
41- id : download-java-temurin-8
42- if : matrix.java == 'temurin@8'
43- uses : typelevel/download-java@v2
44- with :
45- distribution : temurin
46- java-version : 8
41+ - name : Setup sbt
42+ uses : sbt/setup-sbt@v1
4743
4844 - name : Setup Java (temurin@8)
45+ id : setup-java-temurin-8
4946 if : matrix.java == 'temurin@8'
50- uses : actions/setup-java@v3
47+ uses : actions/setup-java@v4
5148 with :
52- distribution : jdkfile
49+ distribution : temurin
5350 java-version : 8
54- jdkFile : ${{ steps.download-java-temurin-8.outputs.jdkFile }}
51+ cache : sbt
5552
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') }}
53+ - name : sbt update
54+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
55+ run : sbt +update
6756
6857 - name : Check that workflows are up to date
6958 run : sbt githubWorkflowCheck
7059
7160 - name : Check headers and formatting
72- if : matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest '
61+ if : matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04 '
7362 run : sbt '++ ${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
7463
7564 - name : Test
7665 run : sbt '++ ${{ matrix.scala }}' test
7766
7867 - name : Check binary compatibility
79- if : matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest '
68+ if : matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04 '
8069 run : sbt '++ ${{ matrix.scala }}' mimaReportBinaryIssues
8170
8271 - name : Generate API documentation
83- if : matrix.java == 'temurin@8' && matrix.os == 'ubuntu-latest '
72+ if : matrix.java == 'temurin@8' && matrix.os == 'ubuntu-22.04 '
8473 run : sbt '++ ${{ matrix.scala }}' doc
8574
8675 - name : Make target directories
8776 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
88- run : mkdir -p target project/target
77+ run : mkdir -p target core/.jvm/target core/.native/target core/.js/target project/target
8978
9079 - name : Compress target directories
9180 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
92- run : tar cf targets.tar target project/target
81+ run : tar cf targets.tar target core/.jvm/target core/.native/target core/.js/target project/target
9382
9483 - name : Upload target directories
9584 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
96- uses : actions/upload-artifact@v3
85+ uses : actions/upload-artifact@v4
9786 with :
9887 name : target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
9988 path : targets.tar
@@ -104,73 +93,71 @@ jobs:
10493 if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
10594 strategy :
10695 matrix :
107- os : [ubuntu-latest ]
96+ os : [ubuntu-22.04 ]
10897 java : [temurin@8]
10998 runs-on : ${{ matrix.os }}
11099 steps :
111100 - name : Checkout current branch (full)
112- uses : actions/checkout@v3
101+ uses : actions/checkout@v4
113102 with :
114103 fetch-depth : 0
115104
116- - name : Download Java (temurin@8)
117- id : download-java-temurin-8
118- if : matrix.java == 'temurin@8'
119- uses : typelevel/download-java@v2
120- with :
121- distribution : temurin
122- java-version : 8
105+ - name : Setup sbt
106+ uses : sbt/setup-sbt@v1
123107
124108 - name : Setup Java (temurin@8)
109+ id : setup-java-temurin-8
125110 if : matrix.java == 'temurin@8'
126- uses : actions/setup-java@v3
111+ uses : actions/setup-java@v4
127112 with :
128- distribution : jdkfile
113+ distribution : temurin
129114 java-version : 8
130- jdkFile : ${{ steps.download-java-temurin-8.outputs.jdkFile }}
115+ cache : sbt
131116
132- - name : Cache sbt
133- uses : actions/cache@v3
134- with :
135- path : |
136- ~/.sbt
137- ~/.ivy2/cache
138- ~/.coursier/cache/v1
139- ~/.cache/coursier/v1
140- ~/AppData/Local/Coursier/Cache/v1
141- ~/Library/Caches/Coursier/v1
142- key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
143-
144- - name : Download target directories (2.13.11)
145- uses : actions/download-artifact@v3
117+ - name : sbt update
118+ if : matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
119+ run : sbt +update
120+
121+ - name : Download target directories (2.13)
122+ uses : actions/download-artifact@v4
146123 with :
147- name : target-${{ matrix.os }}-${{ matrix.java }}-2.13.11
124+ name : target-${{ matrix.os }}-${{ matrix.java }}-2.13
148125
149- - name : Inflate target directories (2.13.11 )
126+ - name : Inflate target directories (2.13)
150127 run : |
151128 tar xf targets.tar
152129 rm targets.tar
153130
154- - name : Download target directories (3.3.0 )
155- uses : actions/download-artifact@v3
131+ - name : Download target directories (3)
132+ uses : actions/download-artifact@v4
156133 with :
157- name : target-${{ matrix.os }}-${{ matrix.java }}-3.3.0
134+ name : target-${{ matrix.os }}-${{ matrix.java }}-3
158135
159- - name : Inflate target directories (3.3.0 )
136+ - name : Inflate target directories (3)
160137 run : |
161138 tar xf targets.tar
162139 rm targets.tar
163140
164141 - name : Import signing key
165142 if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
166- run : echo $PGP_SECRET | base64 -di | gpg --import
143+ env :
144+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
145+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
146+ run : echo $PGP_SECRET | base64 -d -i - | gpg --import
167147
168148 - name : Import signing key and strip passphrase
169149 if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
150+ env :
151+ PGP_SECRET : ${{ secrets.PGP_SECRET }}
152+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
170153 run : |
171- echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
154+ echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
172155 echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
173156 (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)
174157
175158 - name : Publish
159+ env :
160+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
161+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
162+ SONATYPE_CREDENTIAL_HOST : ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
176163 run : sbt tlCiRelease
0 commit comments