chore: Publish packages to GitHub release corresponding to highest-versioned tag reachable from the current branch#223
Open
AlexDanDuna wants to merge 2 commits into
Conversation
…hable from current branch
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.
What does this Pull Request accomplish?
While releasing a new patch version (1.6.1) from the 1.6.x branch, me and @spanglerco discovered that the Python packages were not published to the 1.6.1 release on GitHub, but instead they were appended to the existing 2.32.1 release (highest-versioned in the repo at the time).
This is caused by the fact that
semantic-release publishwill try to publish to the highest-versioned (not the one marked as 'latest release' on the repo) release available repo-wide, instead of the latest reachable from the current branch.Therefore, we'll pass a
--tagparameter tosemantic-release publish, which will pass the latest tag reachable from the current branch. This will directpublishto attach the packages to the release matching that tag.Why should this Pull Request be merged?
This fixes the situation where a version is released from a maintenance branch (e.g. 1.6.x), but there exists a previously-released, higher version (this would be the latest released off the
masterbranch). Without this fix, the packages will end up being published to the higher version, instead of the one released out of the maintenance branch earlier in the workflow.What testing has been done?
Verified locally that
git describe --tags --abbrev=0properly returns the latest released tag reachable from the currently active branch:masterbranch, it returned the latest v2.32.11.6.xbranch, it returned v1.6.1At the time of writing, these were indeed the latest tags reachable from their respective branches.