Infer version from git tags#951
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes how Licensed::VERSION is determined so releases and built gems derive their version from git tags (or a build-time env var), avoiding mismatches between release tags and gem filenames/installed versions.
Changes:
- Compute
Licensed::VERSIONfrom (in order) loaded gemspec version,LICENSED_VERSION, orgit describe --tags --abbrev=0. - Update release workflow to export
LICENSED_VERSIONand ensure tags are available in CI (fetch-depth: 0). - Add/adjust tests to validate version resolution and CLI version output expectations.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
lib/licensed/version.rb |
Implements dynamic version inference via loaded spec / env var / git tags. |
test/version_test.rb |
Adds coverage for VERSION inference and gemspec versioning behavior. |
test/cli_test.rb |
Updates CLI version tests to assert installed gem version output. |
README.md |
Updates release instructions to rely on vX.Y.Z tags instead of editing version.rb. |
.github/workflows/release.yml |
Fetches full git history/tags and sets LICENSED_VERSION for release builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bc94d2c to
af1792c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Infer the next patch version from `git describe` when a checkout is past the latest tag. - Fetch tags in publishing workflows and verify built gems before they can publish or update licensed artefacts. - Keep shallow CI fast by falling back to the locked path-gem version. - Use the installed gemspec version at runtime so published gems do not need `git`; report `git describe` failures clearly.
af1792c to
c20a43b
Compare
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.
VERSIONvalues causing gems to build with filenames that differ from the release tag.LICENSED_VERSIONbefore publishing so the installed gem no longer needsgit.licensed versionand gem filename expectations.