Skip to content

Commit 4e01c2b

Browse files
committed
Simplify reading of inputs
1 parent 52ae112 commit 4e01c2b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ permissions: read-all
1919

2020
env:
2121
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
22-
STAGING_REPO_URL: https://central.sonatype.com/api/v1/publisher/deployment/${{ github.event.inputs.deploymentId }}/download
23-
RELEASE_TAG: r${{ github.event.inputs.releaseVersion }}
22+
STAGING_REPO_URL: https://central.sonatype.com/api/v1/publisher/deployment/${{ inputs.deploymentId }}/download
23+
RELEASE_TAG: r${{ inputs.releaseVersion }}
2424

2525
jobs:
2626

@@ -46,7 +46,7 @@ jobs:
4646
run: |
4747
curl --silent --fail --location --output /tmp/reference.jar \
4848
--header "Authorization: Bearer $MAVEN_CENTRAL_USER_TOKEN" \
49-
"${{ env.STAGING_REPO_URL }}/org/junit/jupiter/junit-jupiter-api/${{ github.event.inputs.releaseVersion }}/junit-jupiter-api-${{ github.event.inputs.releaseVersion }}.jar"
49+
"${{ env.STAGING_REPO_URL }}/org/junit/jupiter/junit-jupiter-api/${{ inputs.releaseVersion }}/junit-jupiter-api-${{ inputs.releaseVersion }}.jar"
5050
sudo apt-get update && sudo apt-get install --yes jc
5151
unzip -c /tmp/reference.jar META-INF/MANIFEST.MF | jc --jar-manifest | jq '.[0]' > /tmp/manifest.json
5252
echo "createdBy=$(jq --raw-output .Created_By /tmp/manifest.json)" >> "$GITHUB_OUTPUT"
@@ -91,7 +91,7 @@ jobs:
9191
distribution: temurin
9292
- uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7
9393
- name: Update JUnit dependencies in samples
94-
run: java src/Updater.java ${{ github.event.inputs.releaseVersion }}
94+
run: java src/Updater.java ${{ inputs.releaseVersion }}
9595
working-directory: junit5-samples
9696
- name: Prepare Maven Central user token
9797
uses: ./junit5/.github/actions/maven-central-user-token
@@ -124,12 +124,12 @@ jobs:
124124
repo: context.repo.repo,
125125
state: 'all'
126126
});
127-
const [milestone] = milestones.data.filter(x => x.title === "${{ github.event.inputs.releaseVersion }}")
127+
const [milestone] = milestones.data.filter(x => x.title === "${{ inputs.releaseVersion }}")
128128
if (!milestone) {
129-
throw new Error('Milestone "${{ github.event.inputs.releaseVersion }}" not found');
129+
throw new Error('Milestone "${{ inputs.releaseVersion }}" not found');
130130
}
131131
if (milestone.open_issues > 0) {
132-
throw new Error(`Milestone "${{ github.event.inputs.releaseVersion }}" has ${milestone.open_issues} open issue(s)`);
132+
throw new Error(`Milestone "${{ inputs.releaseVersion }}" has ${milestone.open_issues} open issue(s)`);
133133
}
134134
const requestBody = {
135135
owner: context.repo.owner,
@@ -190,7 +190,7 @@ jobs:
190190
--no-configuration-cache \
191191
clean \
192192
gitPublishCopy \
193-
-Pdocumentation.replaceCurrentDocs=${{ contains(github.event.inputs.releaseVersion, '-') && 'false' || 'true' }}
193+
-Pdocumentation.replaceCurrentDocs=${{ contains(inputs.releaseVersion, '-') && 'false' || 'true' }}
194194
- name: Publish documentation
195195
if: ${{ inputs.dryRun == false }}
196196
uses: ./.github/actions/run-gradle
@@ -203,13 +203,13 @@ jobs:
203203
--no-build-cache \
204204
--no-configuration-cache \
205205
gitPublishPush \
206-
-Pdocumentation.replaceCurrentDocs=${{ contains(github.event.inputs.releaseVersion, '-') && 'false' || 'true' }}
206+
-Pdocumentation.replaceCurrentDocs=${{ contains(inputs.releaseVersion, '-') && 'false' || 'true' }}
207207
- name: Wait for deployment to GitHub Pages
208208
if: ${{ inputs.dryRun == false }}
209209
id: pagesDeployment
210210
timeout-minutes: 20
211211
run: |
212-
URL="https://junit.org/junit5/docs/${{ github.event.inputs.releaseVersion }}/user-guide/junit-user-guide-${{ github.event.inputs.releaseVersion }}.pdf"
212+
URL="https://junit.org/junit5/docs/${{ inputs.releaseVersion }}/user-guide/junit-user-guide-${{ inputs.releaseVersion }}.pdf"
213213
./.github/scripts/waitForUrl.sh "$URL"
214214
echo "pdfUrl=$URL" >> "$GITHUB_OUTPUT"
215215
- name: Verify integrity of PDF version of User Guide
@@ -236,7 +236,7 @@ jobs:
236236
distribution: temurin
237237
- uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7
238238
- name: Update JUnit dependencies in samples
239-
run: java src/Updater.java ${{ github.event.inputs.releaseVersion }}
239+
run: java src/Updater.java ${{ inputs.releaseVersion }}
240240
- name: Build samples
241241
if: ${{ inputs.dryRun == false }}
242242
run: java src/Builder.java
@@ -246,13 +246,13 @@ jobs:
246246
git config user.email "team@junit.org"
247247
git switch -c "${{ env.RELEASE_TAG }}"
248248
git status
249-
git commit -a -m "Use ${{ github.event.inputs.releaseVersion }}"
249+
git commit -a -m "Use ${{ inputs.releaseVersion }}"
250250
- name: Push release branch
251251
if: ${{ inputs.dryRun == false }}
252252
run: |
253253
git push origin "${{ env.RELEASE_TAG }}"
254254
- name: Update main branch (only for GA releases)
255-
if: ${{ inputs.dryRun == false && !contains(github.event.inputs.releaseVersion, '-') }}
255+
if: ${{ inputs.dryRun == false && !contains(inputs.releaseVersion, '-') }}
256256
run: |
257257
git switch main
258258
git merge --ff-only "${{ env.RELEASE_TAG }}"
@@ -270,7 +270,7 @@ jobs:
270270
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
271271
with:
272272
script: |
273-
const releaseVersion = "${{ github.event.inputs.releaseVersion }}";
273+
const releaseVersion = "${{ inputs.releaseVersion }}";
274274
const jupiterVersion = releaseVersion;
275275
const vintageVersion = releaseVersion;
276276
const platformVersion = "1." + releaseVersion.substring(2);

0 commit comments

Comments
 (0)