Skip to content

ci: add workflow to automate release PR creation - #409

Merged
hassayag merged 3 commits into
developfrom
feature/automate-release-pr
Jul 27, 2026
Merged

hassayag merged 3 commits into
developfrom
feature/automate-release-pr

Conversation

@LVL1024

@LVL1024 LVL1024 commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a create-release-pr.yaml workflow that can be triggered manually via workflow_dispatch with a version bump type input (patch/minor/major). It checks out the develop branch, computes the next version, creates a release/vX.X.X branch, pushes it, and opens a pull request against master.

Comment on lines +7 to +9
description: 'Version number for the release (e.g., 1.15.0)'
required: true
type: string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be better as an input of "major" "minor" or "patch", as that removes even more thinking from the equation. See

- name: Increment version
run: python3 ./scripts/increment_version.py beta
which uses an existing script to bump "beta"

@hassayag hassayag Jul 24, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(might need to modify or make a copy of the function to allow just getting the next version number, rather than actually bumping it)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is what I have now more what you were looking for?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah looks great, just one comment to deal with

@LVL1024
LVL1024 force-pushed the feature/automate-release-pr branch 3 times, most recently from f625a66 to 12f43d6 Compare July 24, 2026 17:46
@LVL1024
LVL1024 force-pushed the feature/automate-release-pr branch from 12f43d6 to c0d8e79 Compare July 24, 2026 20:27
@LVL1024

LVL1024 commented Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Also, I cant figure out why the lint check is failing.

Edit: Figured it out. pre-commit uses a pinned ruff version (0.6.2) while the CI uses the latest version. And the latest version of ruff came out yesterday and has breaking changes.

https://github.com/astral-sh/ruff/releases

@LVL1024
LVL1024 requested a review from hassayag July 24, 2026 20:29
run: |
git fetch origin master
# Extract the clean MAJOR.MINOR.PATCH from master, ignoring develop's beta suffix
MASTER_VERSION=$(git show origin/master:pyproject.toml | grep -Po '(?<=version = ")[0-9]+\.[0-9]+\.[0-9]+')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this necessary if the script already reads the version for you?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's necessary. The workflow checks out develop, which has a beta-suffixed version (e.g., 1.16.0-beta.4). The script's read_version() reads from the current pyproject.toml, so without --base the bump math would be calculated against that beta version rather than the last stable release on master. Fetching master and passing it via --base is exactly why that flag was added.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The script is designed to handle beta versions. Eg. 1.16.0-beta.4 minor release would return 1.17.0

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah, my mistake. I misunderstood the script on that part.

@hassayag

Copy link
Copy Markdown
Member

Also, I cant figure out why the lint check is failing.

Edit: Figured it out. pre-commit uses a pinned ruff version (0.6.2) while the CI uses the latest version. And the latest version of ruff came out yesterday and has breaking changes.

https://github.com/astral-sh/ruff/releases

Ah interesting, I'll sort that out in a separate PR

@LVL1024
LVL1024 requested a review from hassayag July 24, 2026 23:18

@hassayag hassayag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Noice, will test on the next release 🤞

@hassayag
hassayag merged commit edcbc0c into develop Jul 27, 2026
1 of 2 checks passed
@hassayag
hassayag deleted the feature/automate-release-pr branch July 27, 2026 21:09
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.

2 participants