Skip to content

Bump python-semantic-release and support release from minor and patch branches - #218

Merged
AlexDanDuna merged 11 commits into
ni:masterfrom
AlexDanDuna:support-release-from-minor-and-patch-branches
Jul 14, 2026
Merged

AlexDanDuna merged 11 commits into
ni:masterfrom
AlexDanDuna:support-release-from-minor-and-patch-branches

Conversation

@AlexDanDuna

@AlexDanDuna AlexDanDuna commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

What does this Pull Request accomplish?

Allow releasing new minor and patch versions from branches following the format `1.x' and '1.2.x':

  • The GitHub Action was modified to trigger on pushes and PRs targetting "*.x" branches
  • In order to allow for matching such branches for Python Semantic Release, it was required to bump python-semantic-release version as v7 (which was used previously) did not allow for regex in the branch name. I bumped the version to the latest v10.6.1, given the fact that v10 and v9 did not really introduce breaking changes, and upgrading to v8 would require adaptations anyway:
    • the toml configuration for python-semantic-release to match the new branch configuration format of python semantic release, as indicated here and here
    • semantic-release publish no longer creates the GitHub release, nor publishes to PyPi. According to the docs (see here and here), this now has to be replaced by running semantic-release version (which builds the packages, creates the GH release, and the tag), publishing the package to the GH release by running semantic-release publish, and publishing the package to PyPi (I used twine for this).

Why should this Pull Request be merged?

To ease the release of patched versions in the future. The implementation is generic and supports all branches that have a version, ending in ".x", as their names.

What testing has been done?

I tested the modifications on my own fork, with my own PyPi account:

  • verified that the pipeline triggers work on the patch branches
  • verified that the pipeline successfully publishes a GH Release and a PyPi release, when run on the patch branches

Added environment variable GH_TOKEN for semantic-release.
Comment thread CONTRIBUTING.md Outdated
Comment thread .github/workflows/python-package.yml Outdated
Comment thread CONTRIBUTING.md Outdated
@AlexDanDuna
AlexDanDuna requested a review from Copilot July 14, 2026 18:38
@AlexDanDuna AlexDanDuna changed the title Support release from minor and patch branches Bump python-semantic-release and support release from minor and patch branches Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the release tooling/configuration to support cutting minor/patch releases from maintenance branches named like 1.x and 1.2.x, alongside the primary branch release flow.

Changes:

  • Updated python-package.yml to run CI on *.x branches and adjusted the release job to use python-semantic-release v10 with separate version/publish steps plus Twine-based PyPI upload.
  • Updated pyproject.toml tool.semantic_release configuration to allow releases from master and maintenance branches matching a versioned *.x pattern.
  • Added contributor documentation describing the workflow for patching older versions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Switches semantic-release branch configuration to support maintenance *.x branches.
CONTRIBUTING.md Documents the process and naming convention for patch/minor maintenance branches.
.github/workflows/python-package.yml Expands workflow triggers to *.x branches and updates the release job to the v10 semantic-release flow with Twine publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/python-package.yml
Comment thread pyproject.toml
…kages uneder dist/

Previous implementation assumed that just running `semantic-release version` will set the 'released' parameter in the 'release' step's output to 'true', which was incorrect. This only happens for the Python Semantic Release GitHub Action, not when running `version` from the command line.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread pyproject.toml
Comment thread .github/workflows/python-package.yml Outdated
Comment thread CONTRIBUTING.md Outdated
AlexDanDuna and others added 2 commits July 14, 2026 23:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@AlexDanDuna
AlexDanDuna merged commit 95f67b5 into ni:master Jul 14, 2026
14 checks passed
AlexDanDuna added a commit to AlexDanDuna/nisystemlink-clients-python that referenced this pull request Jul 15, 2026
AlexDanDuna added a commit that referenced this pull request Jul 15, 2026
…mp python-semantic-release and support release from minor and patch branches (#218) (#219)
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.

3 participants