Skip to content

Commit 165e447

Browse files
Update release.yml
1 parent 736bcbc commit 165e447

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
name: Release
22

3-
env:
4-
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
6-
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
7-
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
8-
93
on:
104
release:
115
types: [ published ]
@@ -16,28 +10,40 @@ jobs:
1610
runs-on: ubuntu-latest
1711

1812
steps:
19-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
2014

21-
- name: Import GPG key
22-
run: |
23-
echo "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}" | gpg --batch --import
24-
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
15+
# - name: Import GPG key
16+
# run: |
17+
# echo "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}" | gpg --batch --import
18+
# echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
2519

2620
- name: Set up JDK
27-
uses: actions/setup-java@v1
21+
uses: actions/setup-java@v4
2822
with:
2923
java-version: 1.8
30-
server-id: central
31-
server-username: MAVEN_CENTRAL_USERNAME
32-
server-password: MAVEN_CENTRAL_PASSWORD
33-
gpg-private-key: ${{ env.MAVEN_GPG_PRIVATE_KEY }}
34-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
3524

36-
- name: List GPG secret keys
37-
run: gpg --list-secret-keys --keyid-format LONG
38-
39-
- name: Build
25+
- name: Build with Maven
4026
run: mvn -B package --file auto-generated-sdk/pom.xml
4127

28+
- name: Publish to Github Packages Apache Maven
29+
run: cd auto-generated-sdk && mvn -Psign-artifacts verify deploy
30+
env:
31+
GITHUB_TOKEN: ${{ github.token }}
32+
33+
- name: Set up Apache Maven Central
34+
uses: actions/setup-java@v4
35+
with: # running setup-java again overwrites the settings.xml
36+
distribution: 'temurin'
37+
java-version: '11'
38+
server-id: central # Value of the distributionManagement/repository/id field of the pom.xml
39+
server-username: MAVEN_USERNAME # env variable for username in deploy
40+
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
41+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
42+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
43+
4244
- name: Publish to Apache Maven Central
43-
run: cd auto-generated-sdk && mvn -Psign-artifacts verify deploy
45+
run: mvn deploy
46+
env:
47+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
48+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
49+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)