Skip to content

Commit ddaa58a

Browse files
committed
Fix release action
1 parent 8cc5fa3 commit ddaa58a

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/release-and-deploy.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# releases the project with specified version
44
# deploys it to the sonatype staging repo
55
name: Release and deploy to Sonatype staging repo
6+
67
env:
78
GITHUB_PAT: ${{ secrets.QUDTLIB_BOT_GITHUB_TOKEN }}
89
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
910
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
1011
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
12+
1113
on:
1214
workflow_dispatch:
1315
inputs:
@@ -32,6 +34,9 @@ on:
3234
jobs:
3335
build:
3436
runs-on: ubuntu-latest
37+
permissions:
38+
contents: write
39+
pull-requests: write
3540

3641
steps:
3742
- name: Check write access to repo
@@ -54,24 +59,25 @@ jobs:
5459
tag: v${{ inputs.release_version }}
5560
env:
5661
GITHUB_TOKEN: ${{ secrets.QUDTLIB_BOT_GITHUB_TOKEN }}
62+
5763
- name: Fail if tag v${{ inputs.release_version }} exists
5864
if: steps.checkTag.outputs.exists == 'true'
5965
run: |
6066
echo Tag v${{ inputs.release_version }} already exists, release aborted >> $GITHUB_STEP_SUMMARY
6167
exit 1
6268
6369
# Set up java with maven cache
64-
- uses: actions/checkout@v6
65-
- name: Set up JDK 21
66-
uses: actions/setup-java@v5
70+
- uses: actions/checkout@v3
71+
- name: Set up JDK 17
72+
uses: actions/setup-java@v3
6773
with:
6874
distribution: 'temurin'
6975
java-version: '21'
7076
cache: 'maven'
7177

7278
# import the secret key
7379
- name: Set up Apache Maven Central
74-
uses: actions/setup-java@v5
80+
uses: actions/setup-java@v3
7581
with: # running setup-java again overwrites the settings.xml
7682
distribution: 'temurin'
7783
java-version: '21'
@@ -143,6 +149,11 @@ jobs:
143149
version: ${{ inputs.release_version }}
144150
operation: read
145151

152+
# configure git
153+
- name: setup git token
154+
run: |
155+
git config --global url."https://x-access-token:${{ secrets.QUDTLIB_BOT_GITHUB_TOKEN }}@github.com/".insteadOf https://github.com/
156+
146157
# create the pull request
147158
- name: Create Pull Request
148159
uses: peter-evans/create-pull-request@v8
@@ -167,8 +178,8 @@ jobs:
167178
# Next Steps
168179
169180
Please rebase this PR on top of `main` after publishing the release via the
170-
[Sonatype Repository Manager](https://central.sonatype.com/publishing/deployments).
181+
[Sonatype Repository Manager](https://central.sonatype.com/publishing/deployments).
171182
172183
# print the summary
173184
- name: Print summary
174-
run: echo "Release ${{ inputs.release_version }} deployed to sonatype staging repo. Please go there, close the repo and publish it." >> $GITHUB_STEP_SUMMARY
185+
run: echo "Release ${{ inputs.release_version }} deployed to sonatype staging repo. Please go there, close the repo and publish it." >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)