build: derive version from Git tag via axion-release plugin#50
Merged
build: derive version from Git tag via axion-release plugin#50
Conversation
Replace hardcoded version = '0.1.0' with scmVersion.version from the pl.allegro.tech.build.axion-release plugin. Tag prefix is set to empty string to match existing plain-semver tags (e.g. 0.1.1, not v0.1.1). On a tagged commit the version resolves to the exact tag; on subsequent commits it becomes a SNAPSHOT (e.g. 0.1.2-SNAPSHOT), removing the need to manually update build.gradle before each release. Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…sion Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the publish pipeline building
0.1.0when releasing0.1.1.pl.allegro.tech.build.axion-release:1.18.0tag.prefix = ''to match existing plain-semver tags (0.1.1, notv0.1.1)versionCreator 'simple'so snapshots arex.y.z-SNAPSHOT(notx.y.z-branch-name)version = '0.1.0'withversion = scmVersion.versionVersion resolution behaviour:
0.1.1(exact tag)0.1.2-SNAPSHOTNo CI workflow changes needed — the plugin reads from git state at build time.
Test plan
./gradlew currentVersionshows0.1.2-SNAPSHOT(not0.1.0, not branch-suffixed)./gradlew testpasses0.1.2, the publish workflow resolves exactly0.1.2