Skip to content

Commit fbfc806

Browse files
committed
Set release version from git tag using versions:set instead of git versioning extension
1 parent db80cb7 commit fbfc806

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ name: Release
66
# the pre-release to a full release when satisfied.
77
# - Publishing a full release → rebuilds and publishes artifacts to Maven Central immediately.
88
#
9-
# The project version is derived automatically from the git tag via maven-git-versioning-extension.
10-
# No pom.xml version commits are needed.
9+
# The project version is derived from the git tag (e.g. v3.0.0 → 3.0.0) and applied to all
10+
# modules in-place via versions:set before building. No pom.xml version commits are needed.
1111
on:
1212
release:
1313
types: [prereleased, released]
@@ -68,21 +68,14 @@ jobs:
6868
echo "MAVEN_CENTRAL_PORTAL_TOKEN_USERNAME=$MVN_USER"
6969
echo "MAVEN_CENTRAL_PORTAL_TOKEN_PASSWORD=$MVN_PASS"
7070
} >> "$GITHUB_ENV"
71-
- name: Debug - show resolved version before build
71+
- name: Set release version from tag
7272
run: |
73-
echo "=== Git state ==="
74-
git describe --tags --exact-match HEAD || echo "(no exact tag match)"
75-
git branch --show-current || echo "(detached HEAD)"
76-
git log --oneline -1
77-
echo "=== Extension config ==="
78-
cat .mvn/maven-git-versioning-extension.xml
79-
echo "=== Maven resolved version ==="
80-
mvn help:evaluate -Dexpression=project.version -q -DforceStdout -Dversioning.verbose=true 2>&1 | tail -20
73+
TAG="${{ github.event.release.tag_name }}"
74+
VERSION="${TAG#v}"
75+
echo "Setting version: $VERSION"
76+
mvn --batch-mode -ntp versions:set -DnewVersion="$VERSION" -DprocessAllModules=true -DgenerateBackupPoms=false
8177
- name: Stage artifacts
82-
run: mvn deploy -Ppublication -Dprettier.skip=true -ntp -e
83-
- name: Debug - show staged artifacts
84-
if: always()
85-
run: find target/staging-deploy -name "*.pom" | sort | head -30
78+
run: mvn deploy -Ppublication -Dprettier.skip=true -ntp
8679
- name: Deploy to Maven Central
8780
# prereleased: USER_MANAGED — artifacts sit pending in the portal for review.
8881
# released: AUTOMATIC — artifacts are published immediately after validation.

0 commit comments

Comments
 (0)