Skip to content

Commit ecf6f66

Browse files
author
Pedro González Marcos
committed
feat: simplify Github Actions
1 parent 73d598c commit ecf6f66

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Publish package to the Maven Central Repository
22
on:
3-
release:
4-
types: [created]
3+
release:
4+
types: [created]
55
jobs:
66
publish:
77
runs-on: ubuntu-latest
@@ -12,22 +12,14 @@ jobs:
1212
with:
1313
java-version: "17"
1414
distribution: "temurin"
15-
server-id: ossrh
15+
server-id: central
1616
server-username: MAVEN_USERNAME
1717
server-password: MAVEN_PASSWORD
18-
- name: Install gpg secret key
19-
run: |
20-
# Install gpg secret key
21-
echo "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | base64 --decode | gpg --batch --import
22-
# Verify that the key ID is shown in the logs
23-
gpg --list-secret-keys --keyid-format LONG | grep "${{ secrets.OSSRH_GPG_SECRET_KEY_ID }}"
18+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
19+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2420
- name: Publish to Central Repository
2521
env:
2622
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
2723
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
28-
run: |
29-
mvn \
30-
--no-transfer-progress \
31-
--batch-mode \
32-
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
33-
clean deploy
24+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
25+
run: mvn --batch-mode deploy

0 commit comments

Comments
 (0)