Skip to content

Commit ba71a66

Browse files
💚 (ci) Updated pom.xml for only Maven Central.
1 parent f6f175e commit ba71a66

File tree

1 file changed

+20
-37
lines changed

1 file changed

+20
-37
lines changed

.github/workflows/maven-publish.yml

+20-37
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,25 @@
1-
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2-
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3-
4-
name: Maven Package
5-
1+
name: Publish package to the Maven Central Repository
62
on:
73
release:
8-
types: [created]
9-
4+
types: [ created ]
105
jobs:
11-
build:
12-
6+
publish:
137
runs-on: ubuntu-latest
14-
permissions:
15-
contents: read
16-
packages: write
17-
188
steps:
19-
- uses: actions/checkout@v3
20-
21-
- name: Install gpg secret key
22-
run: |
23-
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
24-
gpg --list-secret-keys --keyid-format LONG
25-
26-
- name: Set up Java for publishing to Maven Central Repository
27-
uses: actions/setup-java@v3
28-
with:
29-
java-version: '11'
30-
distribution: 'temurin'
31-
server-id: ossrh
32-
server-username: MAVEN_USERNAME
33-
server-password: MAVEN_PASSWORD
34-
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
35-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
36-
37-
- name: Publish to the Maven Central Repository
38-
run: mvn --batch-mode deploy
39-
env:
40-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
42-
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
9+
- uses: actions/checkout@v3
10+
- name: Set up Maven Central Repository
11+
uses: actions/setup-java@v3
12+
with:
13+
java-version: '17'
14+
distribution: 'temurin'
15+
server-id: ossrh
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
19+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
20+
- name: Publish package
21+
run: mvn --batch-mode deploy
22+
env:
23+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
24+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
25+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

0 commit comments

Comments
 (0)