Skip to content

ci: add RC prerelease and release-branch workflows#2

Open
spbsoluble wants to merge 4 commits intomainfrom
feat/release-branch-workflows
Open

ci: add RC prerelease and release-branch workflows#2
spbsoluble wants to merge 4 commits intomainfrom
feat/release-branch-workflows

Conversation

@spbsoluble
Copy link
Copy Markdown
Contributor

@spbsoluble spbsoluble commented May 6, 2026

Summary

  • Adds pr-prerelease.yml: on each push to a PR targeting a release-X.Y branch, automatically computes and pushes a vX.Y.Z-rc.N tag (0-based, increments per push) and publishes a GitHub prerelease + NuGet package
  • Rewrites release.yml: triggers on push to release-* branches (i.e. on merge) instead of push to v* tags — necessary because tags created by GITHUB_TOKEN inside a workflow do not re-trigger other workflows
  • On merge to release-X.Y, creates vX.Y.Z release tag where Z = latest non-RC patch + 1
  • Adds scripts/test-semver.sh: standalone bash script that tests the version computation logic from both workflows without requiring a git repo, network access, or any commits

Version logic

Scenario Example
Latest tag is v1.0.0, PR opened into release-1.0 v1.0.1-rc.0
Second push to same PR v1.0.1-rc.1
PR merged v1.0.1
Next PR opened v1.0.2-rc.0

Test coverage (scripts/test-semver.sh)

  • RC and release versioning isolated by exact X.Y — tags from other majors/minors are invisible
  • Zero-based RC counter increments correctly across multiple pushes
  • RC tags are ignored when computing the next release Z
  • sort -V handles double-digit patch numbers correctly (9 → 10, not lexicographic)
  • Regression case: PR into release-1.2 with v2.0.x tags present produces v1.2.x-rc.0, not a v2.x tag
  • End-to-end stateful lifecycle: PR open → pushes → merge → next PR

Test plan

  • Open a PR targeting a release-X.Y branch and confirm vX.Y.Z-rc.0 tag and prerelease are created
  • Push a second commit to the PR and confirm vX.Y.Z-rc.1 is created
  • Merge the PR and confirm vX.Y.Z release tag and full release are created
  • Confirm NuGet package is published to GitHub Packages for both RC and release
  • Run bash scripts/test-semver.sh and confirm all 23 tests pass

Replaces tag-push-triggered release with branch-push trigger on
release-* branches. Adds pr-prerelease.yml to auto-tag vX.Y.Z-rc.N
on each push to a PR targeting release-*, and rewrites release.yml
to create vX.Y.Z on merge/push to release-*.
@spbsoluble spbsoluble force-pushed the feat/release-branch-workflows branch from 20b4371 to 3b1765c Compare May 6, 2026 19:26
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