From a21e3015eea6e4e19a780562e89de5fc45f88e28 Mon Sep 17 00:00:00 2001 From: Naama Bendalak <74866605+8naama@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:17:03 +0200 Subject: [PATCH 1/7] fix typo --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 03b8788..076421b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,7 +15,7 @@ jobs: with: java-version: 11 distribution: 'zulu' - server_id: ossrh-nexus + server-id: ossrh-nexus server-username: ${{ secrets.OSSRH_USERNAME }} server-password: ${{ secrets.OSSRH_PASSWORD }} gpg-private-key: ${{ secrets.GPG_KEY }} From feae7c7fd41379ea4f32f037e100f020013e07d3 Mon Sep 17 00:00:00 2001 From: 8naama Date: Tue, 12 Nov 2024 10:59:03 +0200 Subject: [PATCH 2/7] add settings-security creation and debug --- .github/workflows/release.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 076421b..b705436 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,6 +8,8 @@ jobs: publish: runs-on: ubuntu-latest steps: + - name: Debug release event + run: echo "${{ toJSON(github.event) }}" - name: Get the code uses: actions/checkout@v4 - name: Setup Java 11 @@ -20,6 +22,11 @@ jobs: server-password: ${{ secrets.OSSRH_PASSWORD }} gpg-private-key: ${{ secrets.GPG_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Create settings-security.xml + run: | + echo '' > ~/.m2/settings-security.xml + echo " ${{ secrets.MVN_MASTER_PASSWORD }}" >> ~/.m2/settings-security.xml + echo '' >> ~/.m2/settings-security.xml - name: Verify the pom.xml run: mvn verify - name: Publish to the Maven Central Repository From 177e62c783ac1b79163a9f82890c5977a9a4a020 Mon Sep 17 00:00:00 2001 From: 8naama Date: Tue, 12 Nov 2024 11:08:23 +0200 Subject: [PATCH 3/7] fix typo and remove debug --- .github/workflows/release.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b705436..48dd2cf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,14 +2,12 @@ name: Release new version to Maven on: release: - type: [published] + types: [published] jobs: publish: runs-on: ubuntu-latest steps: - - name: Debug release event - run: echo "${{ toJSON(github.event) }}" - name: Get the code uses: actions/checkout@v4 - name: Setup Java 11 From 88fe49c9e175f89aabfdef70ff3765676f1868ab Mon Sep 17 00:00:00 2001 From: 8naama Date: Tue, 12 Nov 2024 11:47:24 +0200 Subject: [PATCH 4/7] try another release approach --- .github/workflows/release.yaml | 12 ++++++------ pom.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 48dd2cf..5870c8f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,12 +20,12 @@ jobs: server-password: ${{ secrets.OSSRH_PASSWORD }} gpg-private-key: ${{ secrets.GPG_KEY }} gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} - - name: Create settings-security.xml - run: | - echo '' > ~/.m2/settings-security.xml - echo " ${{ secrets.MVN_MASTER_PASSWORD }}" >> ~/.m2/settings-security.xml - echo '' >> ~/.m2/settings-security.xml +# - name: Create settings-security.xml +# run: | +# echo '' > ~/.m2/settings-security.xml +# echo " ${{ secrets.MVN_MASTER_PASSWORD }}" >> ~/.m2/settings-security.xml +# echo '' >> ~/.m2/settings-security.xml - name: Verify the pom.xml run: mvn verify - name: Publish to the Maven Central Repository - run: mvn clean deploy + run: mvn deploy --batch-mode -D skipTests --activate-profiles release --no-transfer-progress diff --git a/pom.xml b/pom.xml index 42e214f..d2c7d62 100644 --- a/pom.xml +++ b/pom.xml @@ -187,4 +187,32 @@ + + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + + \ No newline at end of file From 7c9b03e798bcb8cc82ac140493d1e5464b839730 Mon Sep 17 00:00:00 2001 From: 8naama Date: Tue, 12 Nov 2024 12:05:36 +0200 Subject: [PATCH 5/7] try env variables --- .github/workflows/release.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5870c8f..a0452b4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,16 +16,24 @@ jobs: java-version: 11 distribution: 'zulu' server-id: ossrh-nexus - server-username: ${{ secrets.OSSRH_USERNAME }} - server-password: ${{ secrets.OSSRH_PASSWORD }} + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.GPG_KEY }} - gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + gpg-passphrase: GPG_PASSPHRASE # - name: Create settings-security.xml # run: | # echo '' > ~/.m2/settings-security.xml # echo " ${{ secrets.MVN_MASTER_PASSWORD }}" >> ~/.m2/settings-security.xml # echo '' >> ~/.m2/settings-security.xml - - name: Verify the pom.xml - run: mvn verify +# - name: Verify the pom.xml +# env: +# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} +# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: mvn verify - name: Publish to the Maven Central Repository + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: mvn deploy --batch-mode -D skipTests --activate-profiles release --no-transfer-progress From b41c0839bdba6ba60831cb6d08af7f8faa42e797 Mon Sep 17 00:00:00 2001 From: 8naama Date: Tue, 12 Nov 2024 12:07:42 +0200 Subject: [PATCH 6/7] fix typo --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a0452b4..21eada0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,6 +34,6 @@ jobs: - name: Publish to the Maven Central Repository env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: mvn deploy --batch-mode -D skipTests --activate-profiles release --no-transfer-progress From d52ac470410b0a3f1febbe936957f170919fb939 Mon Sep 17 00:00:00 2001 From: 8naama Date: Tue, 12 Nov 2024 12:55:15 +0200 Subject: [PATCH 7/7] remove comments --- .github/workflows/release.yaml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 21eada0..5bf79fe 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,17 +20,6 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.GPG_KEY }} gpg-passphrase: GPG_PASSPHRASE -# - name: Create settings-security.xml -# run: | -# echo '' > ~/.m2/settings-security.xml -# echo " ${{ secrets.MVN_MASTER_PASSWORD }}" >> ~/.m2/settings-security.xml -# echo '' >> ~/.m2/settings-security.xml -# - name: Verify the pom.xml -# env: -# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} -# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} -# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} -# run: mvn verify - name: Publish to the Maven Central Repository env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}