Skip to content

feat: add hk-autorelease action for automated releases - #1598

Merged
jorgepiloto merged 47 commits into
mainfrom
feat/hk-autorelease
Oct 26, 2026
Merged

jorgepiloto merged 47 commits into
mainfrom
feat/hk-autorelease

Conversation

@RobPasMue

@RobPasMue RobPasMue commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Context

ansys-api-discovery and ansys-api-geometry each carry their own copies of two near-identical bash scripts (major_minor_release.sh, patch_release.sh) plus an autorelease.yml workflow that bump a version, create/merge release branches, and push release tags. The two copies had already drifted: one handles merge conflicts on the version file safely, the other doesn't.

This PR ports that logic into a single reusable hk-autorelease action so any repo can opt in instead of copy-pasting scripts, and fixes the conflict-handling drift along the way (adopting the safer behavior everywhere).

What it does

Given a release-type (patch/minor/major), the action:

  • bumps a version stored in a VERSION file, pyproject.toml, setup.py, or a Python module (version-source input),
  • creates/merges release/<major>.<minor> branches and pushes vX.Y.Z tags,
  • for patch releases, auto-resolves a merge conflict if it's limited to the version file, and aborts with a clear error otherwise.

Like other hk-* actions, this one must live in its own workflow file triggered only by workflow_dispatch (it pushes commits/branches/tags directly). See the docs section and example added in this PR.

@RobPasMue
RobPasMue requested a review from a team as a code owner October 12, 2026 20:06
@github-actions github-actions Bot added enhancement General improvements to existing features ci Pipelines maintenance related docs Issues related to documentation labels Oct 12, 2026
@RobPasMue RobPasMue self-assigned this Oct 12, 2026
@RobPasMue

Copy link
Copy Markdown
Member Author

I'll perform active testing directly on dummy repositories but feel free to start reviewing. Feedback is appreciated.

Comment thread hk-autorelease/action.yml Resolved
Comment thread hk-autorelease/autorelease.py Resolved
Comment thread hk-autorelease/autorelease.py Resolved

@jorgepiloto jorgepiloto 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.

Just left a minor comment about using ast in favor of regex module. I think its safer but may increase the complexity of the code.

Comment thread hk-autorelease/autorelease.py Resolved
@RobPasMue

Copy link
Copy Markdown
Member Author

Given that you are adding tests, could you also extend tox configuration for testing ? I think the new group should be added here

Done in ba853d5

@RobPasMue

RobPasMue commented Oct 20, 2026 •

Copy link
Copy Markdown
Member Author

Testing summary in ansys/dummy-autorelease-repo

@RobPasMue RobPasMue added the deploy-pr-doc Deploy pull request documentation label Oct 20, 2026
@github-actions

Copy link
Copy Markdown

The documentation for this pull request will be available at https://actions.docs.ansys.com/pull/1598. Please allow some time for the documentation to be deployed.

@RobPasMue

Copy link
Copy Markdown
Member Author

@ansys/pyansys-core ... gentle reminder. Can I get a review on this?

@jorgepiloto jorgepiloto 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.

Thanks a lot for adding this. It minimizes human error. Approving on my side.

@jorgepiloto
jorgepiloto enabled auto-merge (squash) October 22, 2026 12:55
@jorgepiloto
jorgepiloto disabled auto-merge October 26, 2026 07:58
@jorgepiloto

Copy link
Copy Markdown
Member

Merging after #1623

@jorgepiloto
jorgepiloto merged commit ca28036 into main Oct 26, 2026
5 checks passed
@jorgepiloto
jorgepiloto deleted the feat/hk-autorelease branch October 26, 2026 09:48
@github-actions

Copy link
Copy Markdown

This PR has been closed. Documentation for this pull request will shortly be removed from its former deployment address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pipelines maintenance related deploy-pr-doc Deploy pull request documentation docs Issues related to documentation enhancement General improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants