Skip to content

Commit f6f175e

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

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

.github/workflows/maven-publish.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,12 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v3
20-
21-
- name: Set up JDK 17 for publishing to GitHub Packages
22-
uses: actions/setup-java@v3
23-
with:
24-
java-version: '17'
25-
distribution: 'temurin'
26-
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
27-
settings-path: ${{ github.workspace }} # location for the settings.xml file
28-
2920

3021
- name: Install gpg secret key
3122
run: |
3223
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
3324
gpg --list-secret-keys --keyid-format LONG
3425
35-
- name: Build with Maven for publishing to GitHub Packages
36-
run: mvn -B package --file pom.xml -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
37-
38-
- name: Publish to GitHub Packages Apache Maven
39-
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
40-
env:
41-
GITHUB_TOKEN: ${{ github.token }}
42-
4326
- name: Set up Java for publishing to Maven Central Repository
4427
uses: actions/setup-java@v3
4528
with:
@@ -48,9 +31,12 @@ jobs:
4831
server-id: ossrh
4932
server-username: MAVEN_USERNAME
5033
server-password: MAVEN_PASSWORD
51-
34+
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
35+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
36+
5237
- name: Publish to the Maven Central Repository
53-
run: mvn --batch-mode deploy -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
38+
run: mvn --batch-mode deploy
5439
env:
5540
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
5641
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
42+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@
5656
</scm>
5757

5858
<distributionManagement>
59-
<snapshotRepository>
60-
<id>github</id>
61-
<name>GitHub Packages</name>
62-
<url>https://maven.pkg.github.com/codepenguin-org/codepenguin-randomuser-java-pojo</url>
63-
</snapshotRepository>
6459
<repository>
6560
<id>ossrhx</id>
6661
<name>OSSRHX</name>

0 commit comments

Comments
 (0)