21
21
DEVELOCITY_ACCESS_KEY : ${{ secrets.DEVELOCITY_ACCESS_KEY }}
22
22
STAGING_REPO_URL : https://central.sonatype.com/api/v1/publisher/deployment/${{ inputs.deploymentId }}/download
23
23
RELEASE_TAG : r${{ inputs.releaseVersion }}
24
+ RELEASE_VERSION : ${{ inputs.releaseVersion }}
24
25
25
26
jobs :
26
27
47
48
run : |
48
49
curl --silent --fail --location --output /tmp/reference.jar \
49
50
--header "Authorization: Bearer $MAVEN_CENTRAL_USER_TOKEN" \
50
- "${{ env. STAGING_REPO_URL }} /org/junit/jupiter/junit-jupiter-api/${{ inputs.releaseVersion }} /junit-jupiter-api-${{ inputs.releaseVersion } }.jar"
51
+ "${STAGING_REPO_URL} /org/junit/jupiter/junit-jupiter-api/${RELEASE_VERSION} /junit-jupiter-api-${RELEASE_VERSION }.jar"
51
52
sudo apt-get update && sudo apt-get install --yes jc
52
53
unzip -c /tmp/reference.jar META-INF/MANIFEST.MF | jc --jar-manifest | jq '.[0]' > /tmp/manifest.json
53
54
echo "createdBy=$(jq --raw-output .Created_By /tmp/manifest.json)" >> "$GITHUB_OUTPUT"
@@ -95,15 +96,15 @@ jobs:
95
96
distribution : temurin
96
97
- uses : sbt/setup-sbt@f20dc1bc1f8be605c44ffbcec6f17f708a4af9d1 # v1.1.12
97
98
- name : Update JUnit dependencies in examples
98
- run : java src/Updater.java ${{ inputs.releaseVersion } }
99
+ run : java src/Updater.java ${RELEASE_VERSION }
99
100
working-directory : junit-examples
100
101
- name : Prepare Maven Central user token
101
102
uses : ./junit-framework/.github/actions/maven-central-user-token
102
103
with :
103
104
username : ${{ secrets.MAVEN_CENTRAL_USERNAME }}
104
105
password : ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
105
106
- name : Inject staging repository URL
106
- run : java src/StagingRepoInjector.java ${{ env. STAGING_REPO_URL } }
107
+ run : java src/StagingRepoInjector.java ${STAGING_REPO_URL}
107
108
working-directory : junit-examples
108
109
- name : Build examples
109
110
run : java src/Builder.java --exclude=junit-jupiter-starter-bazel,junit-jupiter-starter-sbt
@@ -123,6 +124,7 @@ jobs:
123
124
with :
124
125
result-encoding : string
125
126
script : |
127
+ const releaseVersion = process.env.RELEASE_VERSION;
126
128
const query = `
127
129
query ($owner: String!, $repo: String!, $title: String!) {
128
130
repository(owner: $owner, name: $repo) {
@@ -139,14 +141,14 @@ jobs:
139
141
const {repository} = await github.graphql(query, {
140
142
owner: context.repo.owner,
141
143
repo: context.repo.repo,
142
- title: "${{ inputs. releaseVersion }}"
144
+ title: releaseVersion
143
145
});
144
- const [milestone] = repository.milestones.nodes.filter(it => it.title === "${{ inputs. releaseVersion }}" )
146
+ const [milestone] = repository.milestones.nodes.filter(it => it.title === releaseVersion)
145
147
if (!milestone) {
146
- throw new Error(' Milestone "${{ inputs. releaseVersion }} " not found' );
148
+ throw new Error(` Milestone "${releaseVersion} " not found` );
147
149
}
148
150
if (milestone.openIssueCount > 0) {
149
- throw new Error(`Milestone "${{ inputs. releaseVersion } }" has ${milestone.openIssueCount} open issue(s)`);
151
+ throw new Error(`Milestone "${releaseVersion}" has ${milestone.openIssueCount} open issue(s)`);
150
152
}
151
153
const requestBody = {
152
154
owner: context.repo.owner,
@@ -228,14 +230,16 @@ jobs:
228
230
id : pagesDeployment
229
231
timeout-minutes : 20
230
232
run : |
231
- URL="https://docs.junit.org/${{ inputs.releaseVersion }} /user-guide/junit-user-guide-${{ inputs.releaseVersion } }.pdf"
233
+ URL="https://docs.junit.org/${RELEASE_VERSION} /user-guide/junit-user-guide-${RELEASE_VERSION }.pdf"
232
234
./.github/scripts/waitForUrl.sh "$URL"
233
235
echo "pdfUrl=$URL" >> "$GITHUB_OUTPUT"
234
236
- name : Verify integrity of PDF version of User Guide
235
237
if : ${{ inputs.dryRun == false }}
236
238
run : |
237
- curl --silent --fail --location --output /tmp/junit-user-guide.pdf "${{ steps.pagesDeployment.outputs.pdfUrl } }"
239
+ curl --silent --fail --location --output /tmp/junit-user-guide.pdf "${PDF_URL }"
238
240
pdfinfo /tmp/junit-user-guide.pdf
241
+ env :
242
+ PDF_URL : ${{ steps.pagesDeployment.outputs.pdfUrl }}
239
243
240
244
update_examples :
241
245
name : Update examples
@@ -257,26 +261,26 @@ jobs:
257
261
distribution : temurin
258
262
- uses : sbt/setup-sbt@f20dc1bc1f8be605c44ffbcec6f17f708a4af9d1 # v1.1.12
259
263
- name : Update JUnit dependencies in examples
260
- run : java src/Updater.java ${{ inputs.releaseVersion } }
264
+ run : java src/Updater.java ${RELEASE_VERSION }
261
265
- name : Build examples
262
266
if : ${{ inputs.dryRun == false }}
263
267
run : java src/Builder.java
264
268
- name : Create release branch
265
269
run : |
266
270
git config user.name "JUnit Team"
267
271
git config user.email "[email protected] "
268
- git switch -c "${{ env. RELEASE_TAG } }"
272
+ git switch -c "${RELEASE_TAG}"
269
273
git status
270
- git commit -a -m "Use ${{ inputs.releaseVersion } }"
274
+ git commit -a -m "Use ${RELEASE_VERSION }"
271
275
- name : Push release branch
272
276
if : ${{ inputs.dryRun == false }}
273
277
run : |
274
- git push origin "${{ env. RELEASE_TAG } }"
278
+ git push origin "${RELEASE_TAG}"
275
279
- name : Update main branch (only for GA releases)
276
280
if : ${{ inputs.dryRun == false && !contains(inputs.releaseVersion, '-') }}
277
281
run : |
278
282
git switch main
279
- git merge --ff-only "${{ env. RELEASE_TAG } }"
283
+ git merge --ff-only "${RELEASE_TAG}"
280
284
git push origin main
281
285
282
286
create_github_release :
@@ -291,7 +295,7 @@ jobs:
291
295
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
292
296
with :
293
297
script : |
294
- const releaseVersion = "${{ inputs.releaseVersion }}" ;
298
+ const releaseVersion = process.env.RELEASE_VERSION ;
295
299
const requestBody = {
296
300
owner: context.repo.owner,
297
301
repo: context.repo.repo,
0 commit comments