Skip to content

Commit bb4647a

Browse files
Vikram KaltaVikram Kalta
authored andcommitted
fix: trying to publish with original config
1 parent 2a5a4a8 commit bb4647a

File tree

1 file changed

+23
-38
lines changed

1 file changed

+23
-38
lines changed

.github/workflows/maven-publish.yml

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Publish package to the Maven Central Repository
22
on:
33
pull_request:
4-
# release:
5-
# types: [ created ]
4+
# types: [ created ]
65
jobs:
76
publish-maven:
87
runs-on: ubuntu-latest
@@ -21,39 +20,25 @@ jobs:
2120
server-password: MAVEN_PASSWORD
2221
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2322
gpg-passphrase: GPG_PASSPHRASE
24-
# Build and publish to a local Maven repository for testing
25-
# - name: Build and Publish to Local Maven Repository
26-
# run: mvn --batch-mode clean install deploy -Dgpg.skip=true -DskipTests=true -DskipNexusStaging=true -DaltDeploymentRepository=local::default::file://$HOME/.m2/repository
27-
- name: Set up Maven settings
28-
run: |
29-
mkdir -p $HOME/.m2
30-
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.OSSRH_USERNAME }}</username><password>${{ secrets.OSSRH_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
31-
32-
- name: Build and Publish to Local Maven Repository
33-
run: mvn --batch-mode clean install deploy -Dgpg.skip=true -DskipTests=true -DskipNexusStaging=true -DaltDeploymentRepository=local::default::file://$HOME/.m2/repository
34-
35-
# - name: Publish package
36-
# run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
37-
# env:
38-
# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
39-
# MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
40-
# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
41-
# Optional: Verify the artifacts are published in the local repository
42-
- name: Verify Local Publish
43-
run: ls -R $HOME/.m2/repository/com.contentstack.sdk/utils
44-
# publish-github:
45-
# runs-on: ubuntu-latest
46-
# steps:
47-
# - uses: actions/checkout@v3
48-
# - name: Set up Java for publishing to GitHub Packages
49-
# uses: actions/setup-java@v3
50-
# with:
51-
# java-version: '11'
52-
# distribution: 'adopt'
53-
# server-id: github
54-
# gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
55-
# gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
56-
# - name: Publish to GitHub Packages
57-
# run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
58-
# env:
59-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Publish package
24+
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
25+
env:
26+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
27+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
28+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
29+
publish-github:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set up Java for publishing to GitHub Packages
34+
uses: actions/setup-java@v3
35+
with:
36+
java-version: '11'
37+
distribution: 'adopt'
38+
server-id: github
39+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
40+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
41+
- name: Publish to GitHub Packages
42+
run: mvn --batch-mode -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} deploy
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)