Skip to content

Enable releases from GitHub Actions - #60

Merged
milanshen merged 2 commits into
mainfrom
milan/release
Aug 12, 2026
Merged

Enable releases from GitHub Actions#60
milanshen merged 2 commits into
mainfrom
milan/release

Conversation

@milanshen

Copy link
Copy Markdown
Contributor

Context

The manual release workflow only builds and smoke-tests artifacts. Publishing still requires creating protected tags outside GitHub Actions.

Add guarded Actions UI modes for publishing an RC from main and promoting an accepted RC commit to stable, while retaining human-pushed tags as a fallback.

Changes

  • Add dry-run, publish-rc, and promote-stable operations with input and release-state validation.
  • Build and smoke-test the exact release commit before creating a protected tag.
  • Publish verified RC and stable assets through Release Drafter, updating Homebrew only for stable releases.
  • Gate manual publication through the release environment and a narrowly scoped GitHub App.
  • Prevent duplicate runs from App-created tags while preserving human tag-push releases.
  • Support safe retries for matching tags, drafts, and assets.

Repository setup

  • Created the release environment and restricted it to protected branches.
  • Configured RELEASE_APP_CLIENT_ID and RELEASE_APP_PRIVATE_KEY.
  • Installed the release GitHub App and added it to the protected-tag ruleset bypass list.

Test

  • make -C collector test — passed
  • go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 -ignore 'label "macos-15-intel" is unknown' .github/workflows/release.yml — passed
  • All 15 embedded shell blocks passed bash -n.
  • Manual: verified the workflow's gh release view command reads the current rolling draft outside a Git checkout.
  • Live publication not run because it would create public tags and releases.

Comment thread .github/workflows/release.yml
@milanshen
milanshen requested a review from luhe19001 August 11, 2026 23:21
Comment thread .github/workflows/release.yml Outdated
Comment on lines +70 to +72
version_pattern='^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z][0-9A-Za-z.-]*)?$'
stable_pattern='^v[0-9]+\.[0-9]+\.[0-9]+$'
rc_pattern='^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[1-9][0-9]*$'

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.

[P2] Reject noncanonical SemVer before the workflow creates the tag

publish-rc accepts v01.2.3-rc.1, and promote-stable accepts v01.2.3. These values have leading zeros and are not canonical SemVer.

Release Drafter first uses strict parse(). If that function fails, it uses coerce(), which changes 01.2.3-rc.1 to 1.2.3.

The workflow creates the protected tag before Release Drafter runs. Release Drafter then writes VERSION=v1.2.3 in the release notes. The later check expects VERSION=v01.2.3-rc.1 and fails. This leaves the protected tag and draft release behind.

Require each numeric component to match 0|[1-9][0-9]*.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch—fixed locally in a follow-up commit. The workflow now rejects leading-zero major, minor, and patch components before creating a tag.

@milanshen milanshen added github_actions Pull requests that update GitHub Actions code and removed devtools labels Aug 12, 2026
@milanshen
milanshen requested a review from calvintvu August 12, 2026 03:34
@milanshen
milanshen merged commit d29a914 into main Aug 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants