diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index dc40480..878c3ef 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -23,8 +23,10 @@ jobs: server-password: MAVEN_PASSWORD # env variable for token in deploy gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - - name: Enforce project version ${{ github.event.inputs.tag }} - run: ./mvnw versions:set -B -DnewVersion=${{ github.event.inputs.tag }} + - name: Verify project version = ${{ github.event.release.tag_name }} + run: | + PROJECT_VERSION=$(./mvnw help:evaluate "-Dexpression=project.version" -q -DforceStdout) + test "$PROJECT_VERSION" = "${{ github.event.release.tag_name }}" - name: Deploy run: ./mvnw deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress env: diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 899ccdb..d527737 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -15,8 +15,10 @@ jobs: cache: 'maven' gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - - name: Enforce project version ${{ github.event.release.tag_name }} - run: ./mvnw versions:set -B -DnewVersion=${{ github.event.release.tag_name }} + - name: Verify project version = ${{ github.event.release.tag_name }} + run: | + PROJECT_VERSION=$(./mvnw help:evaluate "-Dexpression=project.version" -q -DforceStdout) + test "$PROJECT_VERSION" = "${{ github.event.release.tag_name }}" - name: Deploy run: ./mvnw deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress env: