From d6e129642d11fe900121d87767f3ba31d4587160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20D=C3=B6hler?= Date: Sun, 13 Sep 2026 23:55:51 +0200 Subject: [PATCH] ci: publish to Maven Central without a manual click The central-publishing plugin leaves a deployment in the portal as "validated" and waits for someone to press Publish. A release here is already gated on a green suite and on the tag matching the version, so that click is a place to forget rather than a decision. autoPublish takes it, and waitUntil=published makes the build fail when the portal rejects the deployment instead of reporting success on something stuck. Adds the same tag-versus-version gate the other SDKs now carry. Maven Central never lets a version be replaced. --- .github/workflows/release.yml | 10 ++++++++++ pom.xml | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6240c59..4902e92 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,16 @@ jobs: gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Refuse a tag that disagrees with the project version + run: | + tag="${GITHUB_REF_NAME#v}" + version="$(mvn --batch-mode --quiet -DforceStdout \ + help:evaluate -Dexpression=project.version)" + if [ "$tag" != "$version" ]; then + echo "tag $GITHUB_REF_NAME does not match project.version $version" >&2 + exit 1 + fi + - name: Verify run: mvn --batch-mode --no-transfer-progress verify diff --git a/pom.xml b/pom.xml index 57a3467..d58694d 100644 --- a/pom.xml +++ b/pom.xml @@ -157,6 +157,15 @@ true central + + true + + published