12
12
branches : ['**']
13
13
push :
14
14
branches : ['**']
15
- tags : [v*, v* ]
15
+ tags : [v*]
16
16
17
17
env :
18
+ PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
18
19
SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
19
- JABBA_INDEX : ' https://github.com/typelevel/jdk-index/raw/main/index.json'
20
20
SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
21
21
PGP_SECRET : ${{ secrets.PGP_SECRET }}
22
22
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -28,19 +28,21 @@ jobs:
28
28
fail-fast : false
29
29
matrix :
30
30
os : [ubuntu-latest]
31
- scala : [2 .12.15, 2.13.8, 3.0.2 ]
32
- java : [adoptium @8]
31
+ scala : [3.0.2, 2 .12.15, 2.13.8]
32
+ java : [temurin @8]
33
33
runs-on : ${{ matrix.os }}
34
34
steps :
35
35
- name : Checkout current branch (full)
36
36
uses : actions/checkout@v2
37
37
with :
38
38
fetch-depth : 0
39
39
40
- - name : Setup Java and Scala
41
- uses : olafurpg/setup-scala@v13
40
+ - name : Setup Java (temurin@8)
41
+ if : matrix.java == 'temurin@8'
42
+ uses : actions/setup-java@v2
42
43
with :
43
- java-version : ${{ matrix.java }}
44
+ distribution : temurin
45
+ java-version : 8
44
46
45
47
- name : Cache sbt
46
48
uses : actions/cache@v2
55
57
key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
56
58
57
59
- name : Check that workflows are up to date
58
- run : sbt ++${{ matrix.scala }} githubWorkflowCheck
60
+ run : sbt ' ++${{ matrix.scala }}' 'project /' githubWorkflowCheck
59
61
60
- - run : sbt ++${{ matrix.scala }} validate-ci
62
+ - name : Check headers and formatting
63
+ run : sbt '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck
64
+
65
+ - name : Test
66
+ run : sbt '++${{ matrix.scala }}' test
67
+
68
+ - name : Check binary compatibility
69
+ run : sbt '++${{ matrix.scala }}' mimaReportBinaryIssues
70
+
71
+ - name : Generate API documentation
72
+ run : sbt '++${{ matrix.scala }}' doc
73
+
74
+ - name : Check Java formatting
75
+ run : sbt '++${{ matrix.scala }}' '${{ matrix.ci }}' javafmtCheckAll
76
+
77
+ - name : Check unused compile dependencies
78
+ run : sbt '++${{ matrix.scala }}' unusedCompileDependenciesTest
79
+
80
+ - name : Make target directories
81
+ run : mkdir -p target examples/target http/target core/target testkit/target project/target
82
+
83
+ - name : Compress target directories
84
+ run : tar cf targets.tar target examples/target http/target core/target testkit/target project/target
85
+
86
+ - name : Upload target directories
87
+ uses : actions/upload-artifact@v2
88
+ with :
89
+ name : target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
90
+ path : targets.tar
61
91
62
92
publish :
63
93
name : Publish Artifacts
@@ -67,18 +97,20 @@ jobs:
67
97
matrix :
68
98
os : [ubuntu-latest]
69
99
scala : [2.13.8]
70
- java : [adoptium @8]
100
+ java : [temurin @8]
71
101
runs-on : ${{ matrix.os }}
72
102
steps :
73
103
- name : Checkout current branch (full)
74
104
uses : actions/checkout@v2
75
105
with :
76
106
fetch-depth : 0
77
107
78
- - name : Setup Java and Scala
79
- uses : olafurpg/setup-scala@v13
108
+ - name : Setup Java (temurin@8)
109
+ if : matrix.java == 'temurin@8'
110
+ uses : actions/setup-java@v2
80
111
with :
81
- java-version : ${{ matrix.java }}
112
+ distribution : temurin
113
+ java-version : 8
82
114
83
115
- name : Cache sbt
84
116
uses : actions/cache@v2
@@ -92,10 +124,46 @@ jobs:
92
124
~/Library/Caches/Coursier/v1
93
125
key : ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
94
126
127
+ - name : Download target directories (3.0.2)
128
+ uses : actions/download-artifact@v2
129
+ with :
130
+ name : target-${{ matrix.os }}-3.0.2-${{ matrix.java }}
131
+
132
+ - name : Inflate target directories (3.0.2)
133
+ run : |
134
+ tar xf targets.tar
135
+ rm targets.tar
136
+
137
+ - name : Download target directories (2.12.15)
138
+ uses : actions/download-artifact@v2
139
+ with :
140
+ name : target-${{ matrix.os }}-2.12.15-${{ matrix.java }}
141
+
142
+ - name : Inflate target directories (2.12.15)
143
+ run : |
144
+ tar xf targets.tar
145
+ rm targets.tar
146
+
147
+ - name : Download target directories (2.13.8)
148
+ uses : actions/download-artifact@v2
149
+ with :
150
+ name : target-${{ matrix.os }}-2.13.8-${{ matrix.java }}
151
+
152
+ - name : Inflate target directories (2.13.8)
153
+ run : |
154
+ tar xf targets.tar
155
+ rm targets.tar
156
+
95
157
- name : Import signing key
158
+ if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
96
159
run : echo $PGP_SECRET | base64 -d | gpg --import
97
160
98
- - run : sbt ++${{ matrix.scala }} +publish
161
+ - name : Import signing key and strip passphrase
162
+ if : env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
163
+ run : |
164
+ echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg
165
+ echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
166
+ (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)
99
167
100
- - if : startsWith(github.ref, 'refs/tags/v')
101
- run : sbt ++${{ matrix.scala }} sonatypeBundleRelease
168
+ - name : Publish
169
+ run : sbt ' ++${{ matrix.scala }}' tlRelease
0 commit comments