From 8097bdd5a9f56636de891c5b309df997662bed1c Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:32:32 +0200 Subject: [PATCH 01/28] Bump version to 0.9.5 --- README.md | 4 +-- pom.xml | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 89 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b7abf43..ee46b4c 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ This API client provides a type-safe Java interface for WooCommerce REST API v3, ## 📦 Version information -- **Current version**: `0.9.4` +- **Current version**: `0.9.5` - **Supported WooCommerce API version**: `v3` - **Java compatibility**: Java 8+ @@ -93,7 +93,7 @@ Then add the locally built artifact to your project: pl.wtx.woocommerce woocommerce-api-client - 0.9.4 + 0.9.5 ``` diff --git a/pom.xml b/pom.xml index 36d1c82..ca6a742 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ pl.wtx.woocommerce woocommerce-api-client - 0.9.4 + 0.9.5 jar WooCommerce REST API Client @@ -24,8 +24,20 @@ 1.9.0 3.0.2 1.3.2 + true + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + @@ -164,6 +176,33 @@ + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://s01.oss.sonatype.org/ + true + + + @@ -201,4 +240,51 @@ + + + release + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + + + + + + From 60482c91ab0cc169314a51a7eac7b21948d5d80a Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:35:00 +0200 Subject: [PATCH 02/28] Add GitHub Actions workflow for Maven Central publishing --- .github/workflows/maven-central.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/maven-central.yml diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml new file mode 100644 index 0000000..e9ea180 --- /dev/null +++ b/.github/workflows/maven-central.yml @@ -0,0 +1,46 @@ +name: Publish to Maven Central + +on: + push: + tags: + - 'v*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + cache: 'maven' + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + + - name: Build and Publish + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD_TOKEN }} + run: | + echo "Starting Maven build and deploy..." + mvn clean deploy -P release \ + -Dmaven.javadoc.skip=false \ + -Dmaven.deploy.skip=false \ + -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ + -Dmaven.test.failure.ignore=false + + echo "Checking deployment status..." + mvn nexus-staging:rc-list + + echo "Closing staging repository..." + mvn nexus-staging:rc-close + + echo "Releasing to Maven Central..." + mvn nexus-staging:rc-release \ No newline at end of file From 3a2d7e9d2d2bb0fea3fd9ceca75d321d7b935213 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:46:23 +0200 Subject: [PATCH 03/28] Update GitHub Actions workflow with improved GPG configuration --- .github/workflows/maven-central.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index e9ea180..ec6c372 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -23,17 +23,21 @@ jobs: with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} + git_user_signingkey: true - name: Build and Publish env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: | echo "Starting Maven build and deploy..." mvn clean deploy -P release \ -Dmaven.javadoc.skip=false \ -Dmaven.deploy.skip=false \ -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ + -Dgpg.executable=gpg \ + -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dmaven.test.failure.ignore=false echo "Checking deployment status..." From fd488c88bccd126d2f8302ad0a6e457eeebf16f9 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:50:26 +0200 Subject: [PATCH 04/28] Add GPG key listing and disable GPG agent in Maven configuration --- .github/workflows/maven-central.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index ec6c372..2a00693 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -25,6 +25,12 @@ jobs: passphrase: ${{ secrets.GPG_PASSPHRASE }} git_user_signingkey: true + - name: List GPG keys + run: | + echo "Listing GPG keys..." + gpg --list-secret-keys --keyid-format LONG + gpg --list-keys --keyid-format LONG + - name: Build and Publish env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} @@ -38,6 +44,7 @@ jobs: -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ -Dgpg.executable=gpg \ -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ + -Dgpg.useagent=false \ -Dmaven.test.failure.ignore=false echo "Checking deployment status..." From 465195eee671f34cbddb3ac5e91020d5ae6b0d3c Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:52:25 +0200 Subject: [PATCH 05/28] Simplify GPG key import process --- .github/workflows/maven-central.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 2a00693..7fa6a35 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -18,15 +18,11 @@ jobs: distribution: 'temurin' cache: 'maven' - - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - git_user_signingkey: true - - - name: List GPG keys + - name: Setup GPG run: | + echo "${{ secrets.GPG_PRIVATE_KEY }}" > private.key + gpg --batch --import private.key + rm private.key echo "Listing GPG keys..." gpg --list-secret-keys --keyid-format LONG gpg --list-keys --keyid-format LONG From d0336375ff301e6c553930270da5a8074ea4e93f Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:57:34 +0200 Subject: [PATCH 06/28] Add debug mode to Maven Central workflow --- .github/workflows/maven-central.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 7fa6a35..68990f7 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -41,7 +41,8 @@ jobs: -Dgpg.executable=gpg \ -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dgpg.useagent=false \ - -Dmaven.test.failure.ignore=false + -Dmaven.test.failure.ignore=false \ + -X echo "Checking deployment status..." mvn nexus-staging:rc-list From 7c7c8ee1143a7a6d4d428ca873c51167784655ff Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 01:59:42 +0200 Subject: [PATCH 07/28] Enhance GPG key setup and add more diagnostic information --- .github/workflows/maven-central.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 68990f7..fbe0f0d 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -20,12 +20,21 @@ jobs: - name: Setup GPG run: | + echo "Setting up GPG..." + mkdir -p ~/.gnupg + chmod 700 ~/.gnupg echo "${{ secrets.GPG_PRIVATE_KEY }}" > private.key + echo "Importing GPG key..." gpg --batch --import private.key - rm private.key + echo "Trusting GPG key..." + echo -e "5\ny\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} trust echo "Listing GPG keys..." gpg --list-secret-keys --keyid-format LONG gpg --list-keys --keyid-format LONG + echo "GPG configuration:" + gpg --version + gpgconf --list-dirs + rm private.key - name: Build and Publish env: From 26a2ee362d1a22e0884e7f1d4496c91e5f8480f1 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:02:07 +0200 Subject: [PATCH 08/28] Enhance GPG configuration with explicit default key and agent settings --- .github/workflows/maven-central.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index fbe0f0d..2682e50 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -28,6 +28,14 @@ jobs: gpg --batch --import private.key echo "Trusting GPG key..." echo -e "5\ny\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} trust + echo "Setting default key..." + echo "default-key ${{ secrets.GPG_KEYNAME }}" >> ~/.gnupg/gpg.conf + echo "Setting GPG agent..." + echo "use-agent" >> ~/.gnupg/gpg.conf + echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf + echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf + echo "GPG configuration:" + cat ~/.gnupg/gpg.conf echo "Listing GPG keys..." gpg --list-secret-keys --keyid-format LONG gpg --list-keys --keyid-format LONG @@ -49,7 +57,7 @@ jobs: -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ -Dgpg.executable=gpg \ -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ - -Dgpg.useagent=false \ + -Dgpg.useagent=true \ -Dmaven.test.failure.ignore=false \ -X From 2937b686dcf777b457499eb76b48fc05744dfaa8 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:07:29 +0200 Subject: [PATCH 09/28] Add feature/release-1 branch trigger to Maven Central workflow --- .github/workflows/maven-central.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 2682e50..26c5d03 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -4,6 +4,8 @@ on: push: tags: - 'v*' + branches: + - 'feature/release-1' jobs: publish: From f191a97e29287bcec5ed447b92667832e0fd0ac0 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:12:40 +0200 Subject: [PATCH 10/28] Add more debug flags to Maven command --- .github/workflows/maven-central.yml | 50 +++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 26c5d03..8b117ff 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -25,26 +25,44 @@ jobs: echo "Setting up GPG..." mkdir -p ~/.gnupg chmod 700 ~/.gnupg + + # Import private key echo "${{ secrets.GPG_PRIVATE_KEY }}" > private.key - echo "Importing GPG key..." gpg --batch --import private.key - echo "Trusting GPG key..." - echo -e "5\ny\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} trust - echo "Setting default key..." - echo "default-key ${{ secrets.GPG_KEYNAME }}" >> ~/.gnupg/gpg.conf - echo "Setting GPG agent..." - echo "use-agent" >> ~/.gnupg/gpg.conf - echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf - echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf - echo "GPG configuration:" + rm private.key + + # Configure GPG + cat > ~/.gnupg/gpg.conf << EOF + default-key ${{ secrets.GPG_KEYNAME }} + use-agent + pinentry-mode loopback + EOF + + cat > ~/.gnupg/gpg-agent.conf << EOF + allow-loopback-pinentry + default-cache-ttl 600 + max-cache-ttl 7200 + EOF + + # Trust the key + echo -e "trust\n5\ny\nquit\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} + + # Restart GPG agent + gpgconf --kill gpg-agent + gpg-agent --daemon + + # Debug information + echo "=== GPG Configuration ===" cat ~/.gnupg/gpg.conf - echo "Listing GPG keys..." + echo "=== GPG Agent Configuration ===" + cat ~/.gnupg/gpg-agent.conf + echo "=== GPG Keys ===" gpg --list-secret-keys --keyid-format LONG gpg --list-keys --keyid-format LONG - echo "GPG configuration:" + echo "=== GPG Version ===" gpg --version + echo "=== GPG Directories ===" gpgconf --list-dirs - rm private.key - name: Build and Publish env: @@ -61,7 +79,11 @@ jobs: -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dgpg.useagent=true \ -Dmaven.test.failure.ignore=false \ - -X + -X \ + -e \ + --debug \ + -Dgpg.verbose=true \ + -Dgpg.debug=true echo "Checking deployment status..." mvn nexus-staging:rc-list From dc498e2e2cc9a0d71c0b17f682a24b20d73d78f8 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:18:13 +0200 Subject: [PATCH 11/28] Use non-interactive GPG trust mode --- .github/workflows/maven-central.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 8b117ff..462839c 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -44,8 +44,8 @@ jobs: max-cache-ttl 7200 EOF - # Trust the key - echo -e "trust\n5\ny\nquit\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} + # Trust the key (non-interactive) + gpg --batch --yes --trust-model always --edit-key ${{ secrets.GPG_KEYNAME }} trust quit # Restart GPG agent gpgconf --kill gpg-agent From 61dd7a8266ef919844c76fab44647b6698a4ec6b Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:22:20 +0200 Subject: [PATCH 12/28] Modify GPG trust configuration --- .github/workflows/maven-central.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 462839c..950b5aa 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -36,6 +36,7 @@ jobs: default-key ${{ secrets.GPG_KEYNAME }} use-agent pinentry-mode loopback + trust-model always EOF cat > ~/.gnupg/gpg-agent.conf << EOF @@ -44,8 +45,8 @@ jobs: max-cache-ttl 7200 EOF - # Trust the key (non-interactive) - gpg --batch --yes --trust-model always --edit-key ${{ secrets.GPG_KEYNAME }} trust quit + # Set trust level + echo -e "5\ny\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} trust # Restart GPG agent gpgconf --kill gpg-agent From ead5cdc19a37f70d034e96472e025681251607e8 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:26:11 +0200 Subject: [PATCH 13/28] Enhance GPG configuration with more debugging and direct trust setting --- .github/workflows/maven-central.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 950b5aa..c911f37 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -28,27 +28,35 @@ jobs: # Import private key echo "${{ secrets.GPG_PRIVATE_KEY }}" > private.key + echo "Importing GPG key..." gpg --batch --import private.key rm private.key # Configure GPG + echo "Configuring GPG..." cat > ~/.gnupg/gpg.conf << EOF default-key ${{ secrets.GPG_KEYNAME }} use-agent pinentry-mode loopback trust-model always + debug-level guru + verbose EOF cat > ~/.gnupg/gpg-agent.conf << EOF allow-loopback-pinentry default-cache-ttl 600 max-cache-ttl 7200 + debug-level guru + verbose EOF - # Set trust level - echo -e "5\ny\n" | gpg --command-fd 0 --edit-key ${{ secrets.GPG_KEYNAME }} trust + # Set trust level directly + echo "Setting trust level..." + gpg --batch --yes --trust-model always --import-ownertrust < <(echo "${{ secrets.GPG_KEYNAME }}:6:") # Restart GPG agent + echo "Restarting GPG agent..." gpgconf --kill gpg-agent gpg-agent --daemon @@ -64,6 +72,11 @@ jobs: gpg --version echo "=== GPG Directories ===" gpgconf --list-dirs + echo "=== GPG Trust ===" + gpg --list-ownertrust + echo "=== GPG Agent Status ===" + gpgconf --list-dirs agent-socket + gpg-agent --version - name: Build and Publish env: From a02c5e7ef264683fecbfb6a71d08cc9a6e02ad28 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:28:43 +0200 Subject: [PATCH 14/28] Simplify GPG configuration and downgrade maven-gpg-plugin --- .github/workflows/maven-central.yml | 33 ----------------------------- pom.xml | 12 ++++++++++- 2 files changed, 11 insertions(+), 34 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index c911f37..7d71adc 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -38,45 +38,12 @@ jobs: default-key ${{ secrets.GPG_KEYNAME }} use-agent pinentry-mode loopback - trust-model always - debug-level guru - verbose EOF - cat > ~/.gnupg/gpg-agent.conf << EOF - allow-loopback-pinentry - default-cache-ttl 600 - max-cache-ttl 7200 - debug-level guru - verbose - EOF - - # Set trust level directly - echo "Setting trust level..." - gpg --batch --yes --trust-model always --import-ownertrust < <(echo "${{ secrets.GPG_KEYNAME }}:6:") - - # Restart GPG agent - echo "Restarting GPG agent..." - gpgconf --kill gpg-agent - gpg-agent --daemon - # Debug information - echo "=== GPG Configuration ===" - cat ~/.gnupg/gpg.conf - echo "=== GPG Agent Configuration ===" - cat ~/.gnupg/gpg-agent.conf echo "=== GPG Keys ===" gpg --list-secret-keys --keyid-format LONG gpg --list-keys --keyid-format LONG - echo "=== GPG Version ===" - gpg --version - echo "=== GPG Directories ===" - gpgconf --list-dirs - echo "=== GPG Trust ===" - gpg --list-ownertrust - echo "=== GPG Agent Status ===" - gpgconf --list-dirs agent-socket - gpg-agent --version - name: Build and Publish env: diff --git a/pom.xml b/pom.xml index ca6a742..08b02a4 100644 --- a/pom.xml +++ b/pom.xml @@ -179,7 +179,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.0.1 sign-artifacts @@ -187,6 +187,16 @@ sign + + ${gpg.keyname} + ${gpg.passphrase} + + --batch + --yes + --pinentry-mode + loopback + + From 85fabd7bbfff4a9b4bc1fd6106eaccd722744af9 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 02:35:52 +0200 Subject: [PATCH 15/28] Add Maven settings.xml configuration --- .github/workflows/maven-central.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 7d71adc..5f010f1 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -45,6 +45,33 @@ jobs: gpg --list-secret-keys --keyid-format LONG gpg --list-keys --keyid-format LONG + - name: Configure Maven + run: | + mkdir -p ~/.m2 + cat > ~/.m2/settings.xml << EOF + + + + ossrh + \${env.OSSRH_USERNAME} + \${env.OSSRH_PASSWORD} + + + + + ossrh + + true + + + gpg + \${env.GPG_PASSPHRASE} + + + + + EOF + - name: Build and Publish env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} @@ -55,8 +82,6 @@ jobs: mvn clean deploy -P release \ -Dmaven.javadoc.skip=false \ -Dmaven.deploy.skip=false \ - -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \ - -Dgpg.executable=gpg \ -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dgpg.useagent=true \ -Dmaven.test.failure.ignore=false \ From 9b836190daedb2a52c7171479c530ac7a48b9ded Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:03:50 +0200 Subject: [PATCH 16/28] Fix Sonatype OSSRH authentication configuration --- .github/workflows/maven-central.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 5f010f1..079dbd9 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -53,8 +53,8 @@ jobs: ossrh - \${env.OSSRH_USERNAME} - \${env.OSSRH_PASSWORD} + ${{ secrets.OSSRH_USERNAME_TOKEN }} + ${{ secrets.OSSRH_PASSWORD_TOKEN }} @@ -65,7 +65,7 @@ jobs: gpg - \${env.GPG_PASSPHRASE} + ${{ secrets.GPG_PASSPHRASE }} @@ -85,6 +85,8 @@ jobs: -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dgpg.useagent=true \ -Dmaven.test.failure.ignore=false \ + -DnexusUrl=https://s01.oss.sonatype.org/ \ + -DserverId=ossrh \ -X \ -e \ --debug \ From 982e8cf7f5520483cf4017862b45a69b45d979ef Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:06:44 +0200 Subject: [PATCH 17/28] Pass Sonatype OSSRH credentials directly in Maven commands --- .github/workflows/maven-central.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 079dbd9..7c699d1 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -87,6 +87,10 @@ jobs: -Dmaven.test.failure.ignore=false \ -DnexusUrl=https://s01.oss.sonatype.org/ \ -DserverId=ossrh \ + -DaltDeploymentRepository=ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \ + -DrepositoryId=ossrh \ + -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ + -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ -X \ -e \ --debug \ @@ -94,10 +98,19 @@ jobs: -Dgpg.debug=true echo "Checking deployment status..." - mvn nexus-staging:rc-list + mvn nexus-staging:rc-list \ + -DserverId=ossrh \ + -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ + -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} echo "Closing staging repository..." - mvn nexus-staging:rc-close + mvn nexus-staging:rc-close \ + -DserverId=ossrh \ + -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ + -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} echo "Releasing to Maven Central..." - mvn nexus-staging:rc-release \ No newline at end of file + mvn nexus-staging:rc-release \ + -DserverId=ossrh \ + -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ + -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ No newline at end of file From 36586e67c7fa18e66f7d2d2404cd26812589ee35 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:09:23 +0200 Subject: [PATCH 18/28] Add Sonatype credentials verification step --- .github/workflows/maven-central.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 7c699d1..abb49f2 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -72,6 +72,20 @@ jobs: EOF + - name: Verify Sonatype Credentials + run: | + echo "Verifying Sonatype credentials..." + echo "Username: ${{ secrets.OSSRH_USERNAME_TOKEN }}" + echo "Password length: ${#OSSRH_PASSWORD_TOKEN}" + + # Test connection to Sonatype + curl -v -u "${{ secrets.OSSRH_USERNAME_TOKEN }}:${{ secrets.OSSRH_PASSWORD_TOKEN }}" \ + https://s01.oss.sonatype.org/service/local/user/profile + + # Test Maven connection + mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout + mvn help:evaluate -Dexpression=settings.servers -q -DforceStdout + - name: Build and Publish env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} From 0b73028fa3bb5f59f8f9b826de3fc0341fad663d Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:21:03 +0200 Subject: [PATCH 19/28] Update URLs to Central Publishing Portal while keeping OSSRH secrets --- .github/workflows/maven-central.yml | 43 ++++++++--------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index abb49f2..6fc0cab 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -5,21 +5,24 @@ on: tags: - 'v*' branches: - - 'feature/release-1' + - 'feature/release-*' jobs: publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up JDK 8 uses: actions/setup-java@v4 with: java-version: '8' distribution: 'temurin' - cache: 'maven' - + cache: maven + - name: Setup GPG run: | echo "Setting up GPG..." @@ -80,11 +83,7 @@ jobs: # Test connection to Sonatype curl -v -u "${{ secrets.OSSRH_USERNAME_TOKEN }}:${{ secrets.OSSRH_PASSWORD_TOKEN }}" \ - https://s01.oss.sonatype.org/service/local/user/profile - - # Test Maven connection - mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout - mvn help:evaluate -Dexpression=settings.servers -q -DforceStdout + https://central.sonatype.com/api/internal/repository/status - name: Build and Publish env: @@ -99,9 +98,7 @@ jobs: -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dgpg.useagent=true \ -Dmaven.test.failure.ignore=false \ - -DnexusUrl=https://s01.oss.sonatype.org/ \ - -DserverId=ossrh \ - -DaltDeploymentRepository=ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \ + -DaltDeploymentRepository=ossrh::default::https://central.sonatype.com/api/internal/repository/maven-central/ \ -DrepositoryId=ossrh \ -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ @@ -109,22 +106,4 @@ jobs: -e \ --debug \ -Dgpg.verbose=true \ - -Dgpg.debug=true - - echo "Checking deployment status..." - mvn nexus-staging:rc-list \ - -DserverId=ossrh \ - -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ - -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} - - echo "Closing staging repository..." - mvn nexus-staging:rc-close \ - -DserverId=ossrh \ - -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ - -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} - - echo "Releasing to Maven Central..." - mvn nexus-staging:rc-release \ - -DserverId=ossrh \ - -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ - -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ No newline at end of file + -Dgpg.debug=true \ No newline at end of file From b9a4b397f5f42c0b7784bfde40ca34f6e1ae244a Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:22:56 +0200 Subject: [PATCH 20/28] Update nexus-staging-maven-plugin URL to Central Publishing Portal --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08b02a4..82edd9b 100644 --- a/pom.xml +++ b/pom.xml @@ -208,7 +208,7 @@ true ossrh - https://s01.oss.sonatype.org/ + https://central.sonatype.com/ true From 04ee3ed443296163fb131cd944b84ba12454428d Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:25:57 +0200 Subject: [PATCH 21/28] Update deployment URLs to new Central Publishing Portal API endpoints --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 82edd9b..20718ce 100644 --- a/pom.xml +++ b/pom.xml @@ -30,11 +30,11 @@ ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots + https://central.sonatype.com/api/internal/repository/maven-central-snapshots/ ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + https://central.sonatype.com/api/internal/repository/maven-central/ @@ -208,7 +208,7 @@ true ossrh - https://central.sonatype.com/ + https://central.sonatype.com/api/internal/ true From 8ae3096e37581325043cbbfc8aac1c82a6da1ae7 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:31:41 +0200 Subject: [PATCH 22/28] Replace nexus-staging-maven-plugin with central-publishing-maven-plugin --- pom.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 20718ce..91a54af 100644 --- a/pom.xml +++ b/pom.xml @@ -30,11 +30,11 @@ ossrh - https://central.sonatype.com/api/internal/repository/maven-central-snapshots/ + https://central.sonatype.com/api/v1/publisher/upload ossrh - https://central.sonatype.com/api/internal/repository/maven-central/ + https://central.sonatype.com/api/v1/publisher/upload @@ -203,12 +203,11 @@ org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 + central-publishing-maven-plugin + 1.0.0 true ossrh - https://central.sonatype.com/api/internal/ true From 2383aa71bd41ff58b81cae614f4c8a26c8f4cbe3 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:34:20 +0200 Subject: [PATCH 23/28] Update to new Central Publishing Portal API --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 91a54af..3f259e9 100644 --- a/pom.xml +++ b/pom.xml @@ -203,15 +203,25 @@ org.sonatype.plugins - central-publishing-maven-plugin - 1.0.0 + nexus-staging-maven-plugin + 1.6.13 true ossrh + https://s01.oss.sonatype.org/ true + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.1 + + ossrh::default::https://central.sonatype.com/api/v1/publisher/upload + + + From 034a31fae961af7bdde66d92c900279b7ec87b96 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:34:56 +0200 Subject: [PATCH 24/28] Update workflow to use new Central Publishing Portal API --- .github/workflows/maven-central.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index 6fc0cab..ae0d39b 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -75,16 +75,6 @@ jobs: EOF - - name: Verify Sonatype Credentials - run: | - echo "Verifying Sonatype credentials..." - echo "Username: ${{ secrets.OSSRH_USERNAME_TOKEN }}" - echo "Password length: ${#OSSRH_PASSWORD_TOKEN}" - - # Test connection to Sonatype - curl -v -u "${{ secrets.OSSRH_USERNAME_TOKEN }}:${{ secrets.OSSRH_PASSWORD_TOKEN }}" \ - https://central.sonatype.com/api/internal/repository/status - - name: Build and Publish env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME_TOKEN }} @@ -98,7 +88,7 @@ jobs: -Dgpg.keyname=${{ secrets.GPG_KEYNAME }} \ -Dgpg.useagent=true \ -Dmaven.test.failure.ignore=false \ - -DaltDeploymentRepository=ossrh::default::https://central.sonatype.com/api/internal/repository/maven-central/ \ + -DaltDeploymentRepository=ossrh::default::https://central.sonatype.com/api/v1/publisher/upload \ -DrepositoryId=ossrh \ -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ From 0f24e09e109011aea535df8b17f5b3d07222def2 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:44:26 +0200 Subject: [PATCH 25/28] Replace nexus-staging-maven-plugin with central-publishing-maven-plugin --- pom.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 3f259e9..d6a7d22 100644 --- a/pom.xml +++ b/pom.xml @@ -202,14 +202,16 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true ossrh - https://s01.oss.sonatype.org/ - true + https://central.sonatype.com + WooCommerce API Client - ${project.version} + required + false From 678d4e88593814355c0493442f9cf4ab323df19c Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:47:10 +0200 Subject: [PATCH 26/28] Update server ID to central for Central Publishing Portal --- .github/workflows/maven-central.yml | 4 ++-- pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index ae0d39b..f6baa97 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -55,14 +55,14 @@ jobs: - ossrh + central ${{ secrets.OSSRH_USERNAME_TOKEN }} ${{ secrets.OSSRH_PASSWORD_TOKEN }} - ossrh + central true diff --git a/pom.xml b/pom.xml index d6a7d22..27a89f1 100644 --- a/pom.xml +++ b/pom.xml @@ -207,7 +207,7 @@ 0.7.0 true - ossrh + central https://central.sonatype.com WooCommerce API Client - ${project.version} required From 9c759759d519624d1425bcf78f754e2129b7b66b Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:55:46 +0200 Subject: [PATCH 27/28] Remove debug flags from Maven build --- .github/workflows/maven-central.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/maven-central.yml b/.github/workflows/maven-central.yml index f6baa97..83864ed 100644 --- a/.github/workflows/maven-central.yml +++ b/.github/workflows/maven-central.yml @@ -91,9 +91,4 @@ jobs: -DaltDeploymentRepository=ossrh::default::https://central.sonatype.com/api/v1/publisher/upload \ -DrepositoryId=ossrh \ -Dusername=${{ secrets.OSSRH_USERNAME_TOKEN }} \ - -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ - -X \ - -e \ - --debug \ - -Dgpg.verbose=true \ - -Dgpg.debug=true \ No newline at end of file + -Dpassword=${{ secrets.OSSRH_PASSWORD_TOKEN }} \ No newline at end of file From 716d5a1c1729eaeab698a9265f178871d6468f17 Mon Sep 17 00:00:00 2001 From: bartsli Date: Sat, 14 Jun 2025 03:58:06 +0200 Subject: [PATCH 28/28] Add MIT license information --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index 27a89f1..d46febe 100644 --- a/pom.xml +++ b/pom.xml @@ -308,4 +308,12 @@ + + + MIT License + https://opensource.org/licenses/MIT + repo + + +