Skip to content

Commit 4116544

Browse files
authored
Merge pull request #3625 from typelevel/topic/2.5-publication
Migrate 2.5. to sbt-typelevel to get publication working again
2 parents 8fe0b59 + 65ccdfb commit 4116544

File tree

6 files changed

+196
-238
lines changed

6 files changed

+196
-238
lines changed

.github/workflows/ci.yml

Lines changed: 145 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -9,65 +9,83 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['**']
12+
branches: ['**', '!update/**', '!pr/**']
1313
push:
14-
branches: ['**']
14+
branches: ['**', '!update/**', '!pr/**']
1515
tags: [v*]
1616

1717
env:
18-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
19-
JABBA_INDEX: 'https://github.com/typelevel/jdk-index/raw/main/index.json'
20-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
21-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
2218
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2319

20+
21+
concurrency:
22+
group: ${{ github.workflow }} @ ${{ github.ref }}
23+
cancel-in-progress: true
24+
2425
jobs:
2526
build:
26-
name: Build and Test
27+
name: Test
2728
strategy:
2829
matrix:
2930
os: [ubuntu-latest]
30-
scala: [3.0.2, 2.12.15, 2.13.6]
31+
scala: [3, 2.12, 2.13]
3132
java: [temurin@11]
33+
project: [rootJS, rootJVM]
3234
runs-on: ${{ matrix.os }}
35+
timeout-minutes: 60
3336
steps:
3437
- name: Checkout current branch (full)
35-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4
3639
with:
3740
fetch-depth: 0
3841

39-
- name: Setup Java and Scala
40-
uses: olafurpg/setup-scala@v13
41-
with:
42-
java-version: ${{ matrix.java }}
42+
- name: Setup sbt
43+
uses: sbt/setup-sbt@v1
4344

44-
- name: Cache sbt
45-
uses: actions/cache@v2
45+
- name: Setup Java (temurin@11)
46+
id: setup-java-temurin-11
47+
if: matrix.java == 'temurin@11'
48+
uses: actions/setup-java@v4
4649
with:
47-
path: |
48-
~/.sbt
49-
~/.ivy2/cache
50-
~/.coursier/cache/v1
51-
~/.cache/coursier/v1
52-
~/AppData/Local/Coursier/Cache/v1
53-
~/Library/Caches/Coursier/v1
54-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
50+
distribution: temurin
51+
java-version: 11
52+
cache: sbt
53+
54+
- name: sbt update
55+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
56+
run: sbt +update
5557

5658
- name: Check that workflows are up to date
57-
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
59+
run: sbt githubWorkflowCheck
60+
61+
- name: scalaJSLink
62+
if: matrix.project == 'rootJS'
63+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult
5864

59-
- run: 'sbt ++${{ matrix.scala }} fmtCheck test mimaReportBinaryIssues coreJVM/it:test'
65+
- name: Test
66+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test
6067

61-
- if: matrix.scala == '2.13.6'
62-
run: sbt ++${{ matrix.scala }} microsite/mdoc
68+
- name: Check binary compatibility
69+
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
70+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues
71+
72+
- name: Generate API documentation
73+
if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest'
74+
run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc
75+
76+
- name: Make target directories
77+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/2.5.x')
78+
run: mkdir -p experimental/target core/js/target core/jvm/target io/target reactive-streams/target project/target
6379

6480
- name: Compress target directories
65-
run: tar cf targets.tar experimental/target target core/js/target core/jvm/target io/target reactive-streams/target benchmark/target project/target
81+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/2.5.x')
82+
run: tar cf targets.tar experimental/target core/js/target core/jvm/target io/target reactive-streams/target project/target
6683

6784
- name: Upload target directories
68-
uses: actions/upload-artifact@v2
85+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/2.5.x')
86+
uses: actions/upload-artifact@v4
6987
with:
70-
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
88+
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }}
7189
path: targets.tar
7290

7391
publish:
@@ -77,110 +95,146 @@ jobs:
7795
strategy:
7896
matrix:
7997
os: [ubuntu-latest]
80-
scala: [2.13.6]
8198
java: [temurin@11]
8299
runs-on: ${{ matrix.os }}
83100
steps:
84101
- name: Checkout current branch (full)
85-
uses: actions/checkout@v2
102+
uses: actions/checkout@v4
86103
with:
87104
fetch-depth: 0
88105

89-
- name: Setup Java and Scala
90-
uses: olafurpg/setup-scala@v13
91-
with:
92-
java-version: ${{ matrix.java }}
106+
- name: Setup sbt
107+
uses: sbt/setup-sbt@v1
93108

94-
- name: Cache sbt
95-
uses: actions/cache@v2
109+
- name: Setup Java (temurin@11)
110+
id: setup-java-temurin-11
111+
if: matrix.java == 'temurin@11'
112+
uses: actions/setup-java@v4
96113
with:
97-
path: |
98-
~/.sbt
99-
~/.ivy2/cache
100-
~/.coursier/cache/v1
101-
~/.cache/coursier/v1
102-
~/AppData/Local/Coursier/Cache/v1
103-
~/Library/Caches/Coursier/v1
104-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
105-
106-
- name: Download target directories (3.0.2)
107-
uses: actions/download-artifact@v2
114+
distribution: temurin
115+
java-version: 11
116+
cache: sbt
117+
118+
- name: sbt update
119+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
120+
run: sbt +update
121+
122+
- name: Download target directories (3, rootJS)
123+
uses: actions/download-artifact@v4
108124
with:
109-
name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }}
125+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS
110126

111-
- name: Inflate target directories (3.0.2)
127+
- name: Inflate target directories (3, rootJS)
112128
run: |
113129
tar xf targets.tar
114130
rm targets.tar
115131
116-
- name: Download target directories (2.12.15)
117-
uses: actions/download-artifact@v2
132+
- name: Download target directories (3, rootJVM)
133+
uses: actions/download-artifact@v4
118134
with:
119-
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
135+
name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJVM
120136

121-
- name: Inflate target directories (2.12.15)
137+
- name: Inflate target directories (3, rootJVM)
122138
run: |
123139
tar xf targets.tar
124140
rm targets.tar
125141
126-
- name: Download target directories (2.13.6)
127-
uses: actions/download-artifact@v2
142+
- name: Download target directories (2.12, rootJS)
143+
uses: actions/download-artifact@v4
128144
with:
129-
name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }}
145+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS
130146

131-
- name: Inflate target directories (2.13.6)
147+
- name: Inflate target directories (2.12, rootJS)
132148
run: |
133149
tar xf targets.tar
134150
rm targets.tar
135151
136-
- name: Import signing key
137-
run: echo $PGP_SECRET | base64 -d | gpg --import
138-
139-
- run: sbt ++${{ matrix.scala }} release
140-
141-
site:
142-
name: Deploy site
143-
needs: [publish]
144-
if: always() && needs.build.result == 'success' && (needs.publish.result == 'success' && github.ref == 'refs/heads/main')
145-
strategy:
146-
matrix:
147-
os: [ubuntu-latest]
148-
scala: [2.13.6]
149-
java: [temurin@11]
150-
runs-on: ${{ matrix.os }}
151-
steps:
152-
- name: Download target directories (3.0.2)
153-
uses: actions/download-artifact@v2
152+
- name: Download target directories (2.12, rootJVM)
153+
uses: actions/download-artifact@v4
154154
with:
155-
name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }}
155+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM
156156

157-
- name: Inflate target directories (3.0.2)
157+
- name: Inflate target directories (2.12, rootJVM)
158158
run: |
159159
tar xf targets.tar
160160
rm targets.tar
161161
162-
- name: Download target directories (2.12.15)
163-
uses: actions/download-artifact@v2
162+
- name: Download target directories (2.13, rootJS)
163+
uses: actions/download-artifact@v4
164164
with:
165-
name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
165+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS
166166

167-
- name: Inflate target directories (2.12.15)
167+
- name: Inflate target directories (2.13, rootJS)
168168
run: |
169169
tar xf targets.tar
170170
rm targets.tar
171171
172-
- name: Download target directories (2.13.6)
173-
uses: actions/download-artifact@v2
172+
- name: Download target directories (2.13, rootJVM)
173+
uses: actions/download-artifact@v4
174174
with:
175-
name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }}
175+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM
176176

177-
- name: Inflate target directories (2.13.6)
177+
- name: Inflate target directories (2.13, rootJVM)
178178
run: |
179179
tar xf targets.tar
180180
rm targets.tar
181181
182-
- name: Deploy site
183-
uses: peaceiris/actions-gh-pages@v3
182+
- name: Import signing key
183+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
184+
env:
185+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
186+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
187+
run: echo $PGP_SECRET | base64 -d -i - | gpg --import
188+
189+
- name: Import signing key and strip passphrase
190+
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
191+
env:
192+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
193+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
194+
run: |
195+
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
196+
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
197+
(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)
198+
199+
- name: Publish
200+
env:
201+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
202+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
203+
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
204+
run: sbt tlCiRelease
205+
206+
dependency-submission:
207+
name: Submit Dependencies
208+
if: github.event.repository.fork == false && github.event_name != 'pull_request'
209+
strategy:
210+
matrix:
211+
os: [ubuntu-22.04]
212+
java: [temurin@11]
213+
runs-on: ${{ matrix.os }}
214+
steps:
215+
- name: Checkout current branch (full)
216+
uses: actions/checkout@v4
217+
with:
218+
fetch-depth: 0
219+
220+
- name: Setup sbt
221+
uses: sbt/setup-sbt@v1
222+
223+
- name: Setup Java (temurin@11)
224+
id: setup-java-temurin-11
225+
if: matrix.java == 'temurin@11'
226+
uses: actions/setup-java@v4
227+
with:
228+
distribution: temurin
229+
java-version: 11
230+
cache: sbt
231+
232+
- name: sbt update
233+
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
234+
run: sbt +update
235+
236+
- name: Submit Dependencies
237+
uses: scalacenter/sbt-dependency-submission@v2
184238
with:
185-
publish_dir: ./target/website
186-
github_token: ${{ secrets.GITHUB_TOKEN }}
239+
modules-ignore: rootjs_3 rootjs_2.12 rootjs_2.13 rootjvm_3 rootjvm_2.12 rootjvm_2.13 rootnative_3 rootnative_2.12 rootnative_2.13 fs2-benchmark_3 fs2-benchmark_2.12 fs2-benchmark_2.13
240+
configs-ignore: test scala-tool scala-doc-tool test-internal

0 commit comments

Comments
 (0)