From 1d9c97a8cdfdfe08f754b899a42a2efabd3c55c2 Mon Sep 17 00:00:00 2001 From: Erlend Hamnaberg Date: Thu, 26 Sep 2024 16:23:46 +0200 Subject: [PATCH] Try without the action --- .github/release-settings.xml | 9 ++++----- .github/workflows/ci.yml | 28 +++++++++++++++++----------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/release-settings.xml b/.github/release-settings.xml index e7c1433..1da3e59 100644 --- a/.github/release-settings.xml +++ b/.github/release-settings.xml @@ -11,16 +11,15 @@ true - gpg - ${env.GPG_PASSPHRASE} + gpg - ${env.SERVER_ID} - ${env.SERVER_USERNAME} - ${env.SERVER_PASSWORD} + sonatype + ${env.SONATYPE_USERNAME} + ${env.SONATYPE_PASSWORD} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95fa0f3..22f9a5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,15 +56,21 @@ jobs: - name: set version run: | - mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false + mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false - - name: Release Maven package - uses: WasiqB/maven-publish-action@v2 - with: - settings_path: .github/release-settings.xml - server_id: sonatype - maven_profiles: release - gpg_private_key: ${{ secrets.PGP_SECRET }} - gpg_passphrase: ${{ secrets.PGP_PASSPHRASE }} - server_username: ${{ secrets.SONATYPE_USERNAME }} - server_password: ${{ secrets.SONATYPE_PASSWORD }} + - name: Import signing key + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + run: | + echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg + + - name: Deploy release + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + run: | + mvn -Prelease --settings .github/release-settings.xml --batch-mode clean deploy \ No newline at end of file