Skip to content

add a manual release workflow - #112

Merged
adssib merged 1 commit into
mainfrom
release-workflow
Nov 19, 2026
Merged

adssib merged 1 commit into
mainfrom
release-workflow

Conversation

@adssib

@adssib adssib commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Releases become a button. A new Release workflow (.github/workflows/release.yml), run by hand from Actions → Release → Run workflow, tags main's HEAD with the next version and publishes a GitHub release with generated notes. Nothing is tagged on push.

  • Trigger: workflow_dispatch only, input bump = patch (default) or minor. v1.0.0 and later majors are deliberately not an option: that's a decision a maintainer makes and tags by hand.
  • Version: the next semver after the latest vX.Y.Z tag (v0.1.0 today → v0.1.1 / v0.2.0); no tag yet → v0.1.0.
  • Refuses when run from a branch other than main, when main's HEAD already has a tag, or when the computed tag already exists.
  • Fail closed: on the exact commit being tagged it runs python3 scripts/leak_guard.py --all, gitleaks over the whole history (the same pinned, checksum-verified v8.30.1 as CI_leak_guard), go build ./..., go vet ./..., gofmt -l . and go test -race -count=1 ./... (Go from go.mod). Any failure ends the run before a tag exists.
  • Then: an annotated tag pushed with GITHUB_TOKEN, and gh release create <tag> --verify-tag --generate-notes.
  • Safety: permissions: contents: write only; concurrency: release (a second run waits, never cancels); third-party actions pinned by commit SHA (actions/checkout v7.0.1, actions/setup-go v7.1.0).
  • Never delete or move a pushed tag (said in the workflow and the docs): Go's module proxy and checksum database keep every version forever. A bad release is fixed forward with a new patch.
  • .github/release.yml: release-notes categories by label: Plugins (plugin, enhancement), Fixes (bug), Docs (documentation), Other changes. I created the plugin label.
  • Docs: CONTRIBUTING gets a Releasing section and a Release row in the CI table; README a short Releases section; AGENTS.md: agents never tag or release, a maintainer runs the Release workflow.

Checklist

  • Added to / updated in docs/plugins.md. Not applicable: no plugin added, changed or removed.
  • Every commit is signed off (git commit -s, DCO)
  • Golden test over a real saved copy of the source. Not applicable: no plugin.
  • testdata/README.md lists each file. Not applicable.
  • One pinned drop test. Not applicable.
  • providers/<api>.md. Not applicable.
  • Fetches only through env.Get / kit/. Not applicable: no Go code changed.
  • go build ./... && go vet ./... && gofmt -l . && go test -race ./... pass locally
  • Nothing private: no credentials, internal hosts, private links, customer names (python3 scripts/leak_guard.py --all passes)

Notes for the reviewer

  • Validated with yaml.safe_load and actionlint (clean). The version logic was run locally against the current tags (v0.1.0 → v0.1.1 patch, v0.2.0 minor). The workflow itself hasn't run: it can only be run after merge, by a maintainer.
  • The tag's tagger is github-actions[bot]; the tag message names who ran the workflow.
  • A tag and release pushed with GITHUB_TOKEN don't trigger other workflows (none listen for them).
  • Running gitleaks over the whole history (not just new commits) means a finding the weekly scan would also report blocks a release until it's fixed or allow-listed. That's on purpose.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @adssib's task in 3m 8s —— View job


✅ Ready to merge. The Release workflow fails closed, refuses the edge cases it should, uses only contents: write, pins its actions by SHA, and all CI is green on the current head (bcb4817).

The branch was force-pushed during the review. The PR is now one commit and no longer touches plugins/openapi/vercel_test.go. I reviewed the current head.

Rules

Rule Status Evidence
Plugin list (docs/plugins.md) ✅ n/a No plugin added, changed or removed. Only the workflow, release-notes config and docs change.
Provider page ✅ n/a No new provider
Golden test + quote ✅ n/a No plugin code
Drop test ✅ n/a No plugin code
Fetch only via env ✅ n/a No Go code changed
Nothing private ✅ No credentials, internal names or private links in the diff, commit message or PR body. The workflow only uses github.token. leak_guard.py --all and CI_leak_guard pass.

Bugs

None found. I checked:

  • Version logic: only vX.Y.Z tags count, sorted with sort -V. || true covers the case with no tags yet (→ v0.1.0). Pre-release tags are ignored. It refuses when HEAD is already tagged or the computed tag already exists.
  • Ref guard: it refuses to run from any ref but main, and it checks out main explicitly. Every check runs on the exact commit that gets tagged, using the SHA saved by the version step.
  • Gitleaks: same pinned version and checksum as CI_leak_guard, run over the whole history, the same way the weekly scan runs it.
  • Release: gh release create --verify-tag only creates the release if the tag exists on the remote. concurrency: release with cancel-in-progress: false makes a second run wait instead of cancelling the first.

Verified

These ran locally on the checkout I started with (e58b6ee, before the force-push):

  • go build ./...: ok
  • go vet ./...: ok
  • go test -race ./...: all 19 packages ok
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"
  • gofmt -l .: listed plugins/openapi/vercel_test.go, the realigned version from the commit that was since dropped.

CI on the current head bcb4817: CI_go ✅ (its gofmt step passed with main's original vercel_test.go), CI_leak_guard ✅, CI_dco ✅, CI_contract ✅. So main is gofmt-clean under the Go version in go.mod, and dropping the realignment commit was the right call. The Release workflow's gofmt step won't block the first release.

I couldn't run actionlint, and I couldn't check the action SHAs against their release tags from here.

Non-blocking

  • The PR description is out of date. It still describes the second commit, gofmt the vercel test, and says main isn't gofmt-clean. Neither is true any more (see above). Worth editing so the history makes sense later.
  • A tag with no release: if gh release create fails after the tag push, a re-run refuses because HEAD is already tagged. A one-line recovery step in CONTRIBUTING's Releasing section would help (see my inline comment on release.yml:146).
  • Checks the Release workflow skips: CI_go also runs go mod tidy and the import-allowlist and net/http guards; the Release workflow doesn't. Every PR already passes these, so it's optional. Copying them in would make the release gate a full superset of CI_go.
  • Tag rulesets: if tag protection rulesets are ever added, check that github-actions[bot] can still push v* tags.

env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }}
run: gh release create "$TAG" --verify-tag --generate-notes --title "$TAG"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Non-blocking: if this step fails after the tag push succeeds (a GitHub API error, for example), the run leaves a tag with no release. Re-running won't fix it, because the next version step refuses when HEAD is already tagged. You could add a one-liner to CONTRIBUTING's Releasing section: "if the tag exists but the release doesn't, run gh release create <tag> --verify-tag --generate-notes". That still follows the "never move a tag" rule.

@adssib
adssib merged commit bc8356e into main Nov 19, 2026
6 checks passed
@adssib
adssib deleted the release-workflow branch November 19, 2026 19:08
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