Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cmd-version): add --tag/--no-tag option to version command #752

Conversation

codejedi365
Copy link
Contributor

Purpose

  • Provide the user the ability to turn off the application of tags to the repository.
  • Provide the ability to prevent pushing commits when only using tags to indicate versions

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 when semantic-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.

@codejedi365
Copy link
Contributor Author

@bernardcooke53, @relekang, would either of you mind to do a PR review?

Copy link
Contributor

@bernardcooke53 bernardcooke53 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, the workflow you described makes sense and this seems well suited to it- thank you!

@bernardcooke53 bernardcooke53 merged commit de6b9ad into python-semantic-release:master Dec 7, 2023
8 checks passed
@codejedi365 codejedi365 deleted the feat/toggle-tag-creation branch December 7, 2023 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants