From dd8fbeb7e9dfa3200559262a726938faede452d1 Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Thu, 17 Oct 2024 08:55:28 +1300 Subject: [PATCH] fix: introduce release profile introduce release profile to avoid requiring gpg signing for the branch merges. --- .github/workflows/build.yml | 14 ++------ .github/workflows/release.yml | 2 +- pom.xml | 65 ++++++++++++++++++++--------------- 3 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 976e2ab..6cfd2b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,10 +51,10 @@ jobs: - name: Build and verify Maven sample projects run: | - mvn install + mvn install -B cd examples/maven for x in $(find . -maxdepth 1 -type d -not -name '.' -print); do - (cd $x && mvn package) + (cd $x && mvn package -B) done build-maven: @@ -69,11 +69,6 @@ jobs: with: # running setup-java again overwrites the settings.xml distribution: 'temurin' java-version: '8' - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_CENTRAL_TOKEN - gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Setup LXD uses: canonical/setup-lxd@main @@ -89,11 +84,6 @@ jobs: - name: Build and verify maven project run: | mvn -B install invoker:install invoker:run - env: - MAVEN_USERNAME: do-not-deploy - MAVEN_CENTRAL_TOKEN: do-not-deploy - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_PASSPHRASE }} - build-gradle: name: Build Gradle diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47f0620..17a119e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,7 +48,7 @@ jobs: - name: Publish to Maven central id: deploy-maven run: | - mvn deploy -B + mvn deploy -B -Prelease env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_TOKEN_USERNAME }} MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN_PASSWORD }} diff --git a/pom.xml b/pom.xml index cdd3b26..8e9eee7 100644 --- a/pom.xml +++ b/pom.xml @@ -48,34 +48,43 @@ - - maven-gpg-plugin - 3.2.7 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - org.sonatype.central - central-publishing-maven-plugin - 0.6.0 - true - - central - - + + + release + + + + maven-gpg-plugin + 3.2.7 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.6.0 + true + + central + + + + + +