Skip to content

Commit ed31722

Browse files
Fix #901 - Add GPG configuration to setup-java action (#902)
Signed-off-by: Ricardo Zanini <[email protected]>
1 parent ad01909 commit ed31722

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ on:
66
paths:
77
- '.github/project.yml'
88

9+
permissions:
10+
contents: write
11+
912
jobs:
1013
release:
1114
runs-on: ubuntu-latest
1215
name: release
1316
if: ${{ github.event.pull_request.merged == true }}
17+
env:
18+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
19+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
20+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
1421

1522
steps:
1623
- uses: radcortez/project-metadata-action@main
@@ -21,13 +28,8 @@ jobs:
2128
metadata-file-path: '.github/project.yml'
2229

2330
- uses: actions/checkout@v4
24-
25-
- name: Import GPG key
26-
id: import_gpg
27-
uses: crazy-max/ghaction-import-gpg@v5
2831
with:
29-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
30-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
32+
fetch-depth: 0
3133

3234
- name: Set up JDK 17
3335
uses: actions/setup-java@v4
@@ -38,6 +40,8 @@ jobs:
3840
server-id: central
3941
server-username: MAVEN_USERNAME
4042
server-password: MAVEN_PASSWORD
43+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
44+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4145

4246
- name: Configure Git author
4347
run: |
@@ -52,9 +56,6 @@ jobs:
5256
git checkout ${{github.base_ref}}
5357
git rebase release
5458
mvn -B release:perform -Prelease
55-
env:
56-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
57-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
5859
5960
- name: Push tags
6061
run: git push && git push --tags

0 commit comments

Comments
 (0)