feat(cmd-version): add --tag/--no-tag
option to version command
#752
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.
Purpose
Rationale
I need the ability to run
semantic-release
to apply versions across the file base prior to the build process and not have to manually remove the tag after it is executed. It fits in to the use of--no-commit
but its not something I want to implement myself to commit-parse and apply to files whensemantic-release
already can provide this. The reason for this is to ensure that during my pipeline builds the actual release artifact during the build stage and passes it along to be tested rather than re-building an artifact at the end of the pipeline (which then I'm releasing an artifact that isn't actually tested).I also had to adjust the push mechanism because I do not intend to commit the generated files (like the changelog or the modified version files to the repository) If I use
--no-commit
, it won't push the tag and I do want the tag to be published.How I tested it
Wrote 2 integration tests that validate that versions are stamped into the code without creating a commit or a tag. The second test ensured that the tag was pushed but no commit was pushed.