Skip to content

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
masterfrom
fix-publishing-packages-to-github-release-from-maintenance-branches
Open

chore: Publish packages to GitHub release corresponding to highest-versioned tag reachable from the current branch#223
AlexDanDuna wants to merge 2 commits into
masterfrom
fix-publishing-packages-to-github-release-from-maintenance-branches

Conversation

@AlexDanDuna

@AlexDanDuna AlexDanDuna commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

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 publish will 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 --tag parameter to semantic-release publish, which will pass the latest tag reachable from the current branch. This will direct publish to 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 master branch). 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=0 properly returns the latest released tag reachable from the currently active branch:

  • when run from the master branch, it returned the latest v2.32.1
  • when run from the 1.6.x branch, it returned v1.6.1

At the time of writing, these were indeed the latest tags reachable from their respective branches.

@AlexDanDuna AlexDanDuna changed the title Modify semantic-release publish to use latest GitHub release tag reac… chore: Publish packages to GitHub release corresponding to latest tag reachable from the current branch Jul 16, 2026
@AlexDanDuna AlexDanDuna changed the title chore: Publish packages to GitHub release corresponding to latest tag reachable from the current branch chore: Publish packages to GitHub release corresponding to highest-versioned tag reachable from the current branch Jul 16, 2026
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.

1 participant