Skip to content

feat(release): automatically prepare an SVU and GoReleaser release PR #239

Open

Description

@KalebCole

Goal

Automatically create and maintain one release-preparation PR from Conventional Commits, then publish only when a human merges that PR.

The human decision is simple: review and merge the generated release PR. The automation owns version selection, release-note drafting, tag creation, artifact publication, and post-publication verification.

Why this design

  • GoReleaser is the sole publisher of GitHub Release metadata, archives, and checksums.
  • SVU is only the small Go tool that determines the next semantic version from commits since the latest tag.
  • A custom workflow owns the release PR because this is a single-module Go CLI with repository-specific safety gates.
  • The workflow that publishes must create the tag and invoke GoReleaser in the same job. Do not rely on a tag created by one GitHub Actions workflow to trigger another workflow.
  • Do not add Release Please, Node, npm, semantic-release, or a second release publisher.

Proposed lifecycle

A fix/feature PR merges to main
        ↓
Release-prep workflow calculates the candidate with SVU
        ↓
It creates or updates exactly one open release PR
        ↓
A human reviews and merges that release PR
        ↓
Publish workflow validates the merged candidate, tags it, then runs GoReleaser in the same job

1. Automatically maintained release PR

Create a workflow triggered by pushes to main that:

  1. Checks out main with complete tag history (fetch-depth: 0).
  2. Installs a pinned SVU version.
  3. Uses svu next to determine whether unreleased Conventional Commits require a version.
  4. Does nothing if no release-worthy commit exists.
  5. Otherwise creates or updates one bot-owned release branch and PR, titled chore(release): vX.Y.Z.
  6. Generates deterministic release notes covering commits since the previous tag and updates CHANGELOG.md in that PR.
  7. Marks the PR clearly as generated release preparation and records the candidate version, base tag, and base commit in its body.
  8. Updates the existing open generated PR instead of opening duplicate PRs after additional eligible merges.
  9. Ensures release-preparation commits do not themselves cause SVU to increment a version.

The generated PR is the reviewable human gate. It has a real, useful diff: the reviewed changelog/release notes that correspond to the public GitHub Release.

2. Publish after human merge

Create a separate publish workflow triggered only when the generated release PR is merged. It must:

  1. Check out the resulting main merge commit and require complete tag history.
  2. Recompute and validate the expected candidate version from the previous tag and the released commit range.
  3. Validate the generated PR metadata/release notes agree with that candidate. Refuse publication if the PR was stale, tampered with, or does not represent current main.
  4. Validate the candidate is a new vX.Y.Z tag and no tag or GitHub Release already exists for it.
  5. Run canonical Go gates: module verification, tests with race detector, vet, build, source smoke test, and native archive verification.
  6. Create and push an annotated tag only after every gate passes.
  7. Invoke GoReleaser in that same job to create the GitHub Release and upload the six archives plus checksums.
  8. Download the published macOS arm64 archive, validate its checksum, inspect archive paths, and verify partiful --version equals the candidate version.
  9. Emit a concise GitHub Actions summary with version, commit SHA, release URL, asset names, and verification result.

Version boundary

This issue depends on #238. After that work, dev is the final fallback only: GoReleaser injects the immutable release version, tagged go install resolves the module version, and the supported local build command injects git describe metadata. The generated release PR does not rewrite product source or broad test snapshots.

Safety requirements

  • contents: write is limited to the release-prep and publish workflows.
  • Release-prep may only create or update its designated branch/PR and CHANGELOG.md.
  • Publish may only run for a merged generated release PR targeting main.
  • Refuse to tag a non-main commit.
  • Refuse an existing tag or existing release instead of overwriting it.
  • Do not publish if any verification gate fails.
  • Do not use a PAT solely to make a tag trigger a second workflow. The publish job owns tag creation and GoReleaser execution together.
  • Retire or make mutually exclusive the existing tag-triggered publisher before enabling this workflow. Never allow two workflows to publish the same tag.
  • Dependabot remains separate and is not involved in application-version selection or publication.

Acceptance criteria

  • fix: commits yield a patch candidate, feat: yields a minor candidate, and Conventional Commit breaking-change syntax yields a major candidate.
  • A qualifying merge to main creates a release-prep PR without manual dispatch.
  • Further qualifying merges update that same open release-prep PR; they do not create duplicates.
  • The generated PR contains deterministic release notes and identifies its candidate version and base tag.
  • Merging the generated PR is the only human release approval step.
  • A successful publish creates exactly one tag, exactly one GitHub Release, six platform archives, and one checksum file.
  • Existing-tag/release, stale-PR, and failed-gate paths create no new public release artifact.
  • The published arm64 archive checksum and executable version are verified by the workflow.
  • The workflow uses no Node/npm release dependency.

Dependency

Blocked by #238. Implement and merge that prerequisite first.

Activity

  1. added
    enhancement
    on Sep 18, 2026
  2. self-assigned this
    on Sep 18, 2026
  3. changed the title [-]feat(release): add deterministic SVU and GoReleaser release dispatch[/-] [+]feat(release): automatically prepare an SVU and GoReleaser release PR[/+] on Sep 18, 2026
  4. KalebCole commented on Nov 14, 2026

    @KalebCole
    OwnerAuthor

    Triage bot: fits the Go-only release path, no hold. Publishing stays gated on a human merging the release PR, and no Node or npm in the release workflow.

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

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions