7
7
concurrency :
8
8
group : " ${{ github.workflow }}-${{ github.ref }}"
9
9
cancel-in-progress : true
10
+ permissions :
11
+ contents : write
12
+ id-token : write
13
+
10
14
env :
11
15
STAGING_HOST : " oss.sonatype.org"
12
16
OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
13
17
OSSRH_TOKEN : ${{ secrets.OSSRH_TOKEN }}
14
18
MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
15
19
jobs :
16
20
open-release :
21
+ name : Open release
17
22
runs-on : ubuntu-latest
18
23
outputs :
19
24
INITIAL_MASTER_POSITION : ${{ steps.create-tag.outputs.INITIAL_MASTER_POSITION }}
@@ -104,7 +109,15 @@ jobs:
104
109
- uses : actions/checkout@v4
105
110
with :
106
111
ref : ${{ needs.open-release.outputs.TAG }}
107
- - uses : actions/setup-java@v4
112
+ fetch-depth : 0
113
+
114
+ - name : Configure Git User
115
+ run : |
116
+ git config user.email "cowwoc2020@gmail.com"
117
+ git config user.name "Gili Tzabari"
118
+
119
+ - name : Install Java
120
+ uses : actions/setup-java@v4
108
121
with :
109
122
distribution : zulu
110
123
java-version : 21
@@ -130,31 +143,13 @@ jobs:
130
143
./mvnw --batch-mode -V -e -pl '!test,!benchmark,!benchmark/java,!benchmark/guava,!benchmark/assertj'
131
144
-Dstaging_repository_id=${{ needs.open-release.outputs.STAGING_REPOSITORY_ID }}
132
145
-Dstaging_host="${{ env.STAGING_HOST }}"
133
- deploy -P release
134
-
135
- document :
136
- name : Publish Javadoc documentation
137
- needs : [ open-release, deploy ]
138
- runs-on : ubuntu-latest
139
- steps :
140
- - uses : actions/checkout@v4
141
- with :
142
- ref : ${{ needs.open-release.outputs.TAG }}
143
- fetch-depth : 0
144
- token : ${{ secrets.WORKFLOW_TOKEN }}
145
- - uses : actions/setup-java@v4
146
- with :
147
- distribution : zulu
148
- java-version : 21
149
-
150
- - name : Configure Git User
151
- run : |
152
- git config user.email "cowwoc2020@gmail.com"
153
- git config user.name "Gili Tzabari"
146
+ -P release
147
+ deploy
154
148
149
+ # Must quote exclamation mark on bash: https://stackoverflow.com/a/27177197/14731
155
150
- name : Generate Javadoc
156
151
run : |
157
- ./mvnw --batch-mode -V -e verify javadoc:aggregate
152
+ ./mvnw --batch-mode -V -e -pl '!test,!benchmark,!benchmark/java,!benchmark/guava,!benchmark/assertj' javadoc:aggregate
158
153
mkdir --parents "${{ needs.open-release.outputs.VERSION }}/docs"
159
154
mv target/reports/apidocs "${{ needs.open-release.outputs.VERSION }}/docs/api"
160
155
@@ -167,13 +162,13 @@ jobs:
167
162
git push
168
163
169
164
close-release :
170
- needs : [ open-release, deploy, document ]
165
+ name : Close release
166
+ needs : [ open-release, deploy ]
171
167
runs-on : ubuntu-latest
172
168
steps :
173
169
- uses : actions/checkout@v4
174
170
with :
175
171
ref : ${{ needs.open-release.outputs.TAG }}
176
- token : ${{ secrets.WORKFLOW_TOKEN }}
177
172
- uses : actions/setup-java@v4
178
173
with :
179
174
distribution : zulu
@@ -200,6 +195,7 @@ jobs:
200
195
201
196
# Cleanup on failure: https://stackoverflow.com/a/74562058/14731
202
197
on-failure :
198
+ name : On failure
203
199
needs : [ open-release, deploy, close-release ]
204
200
runs-on : ubuntu-latest
205
201
if : ${{ failure() || cancelled() }}
@@ -208,8 +204,8 @@ jobs:
208
204
with :
209
205
ref : ${{ github.ref }}
210
206
fetch-depth : 0
211
- token : ${{ secrets.WORKFLOW_TOKEN }}
212
- - uses : actions/setup-java@v4
207
+ - name : Install Java
208
+ uses : actions/setup-java@v4
213
209
with :
214
210
distribution : zulu
215
211
java-version : 21
0 commit comments