Release rdsh with tagpr and GoReleaser, and report the version from --version - #66
Merged
Conversation
GoReleaser embeds it with -ldflags -X; a go install or go build binary falls back to the version the toolchain recorded.
A push to main keeps a release PR up to date; merging it cuts the tag, and the same job then builds the six archives, the GitHub Release and the Homebrew cask. CI gains a goreleaser check so a broken config fails on the PR rather than once the tag is pushed.
go install needs a Go toolchain, which the users and agents rdsh is for do not always have.
The cask name, the quarantine hook's binary path and the ldflags symbol each spelled rdsh again; templating them leaves .goreleaser.yaml with only the values a sibling CLI has to change. release.yml reads its owner and repository from the workflow context for the same reason, and its Go setup is now gated like the release step it exists for. resolveVersion takes the recorded module version rather than the function that reads it, which makes it a pure function of two strings.
178inaba
marked this pull request as ready for review
August 30, 2026 18:01
Merged
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
rdsh installs only with
go install, which needs a Go toolchain on the machine. The users and the AI coding agents rdsh is built for do not always have one, so there is nothing to install on a bare macOS or a CI container.This is the first half of #63: the pipeline that publishes prebuilt binaries. After it, a push to
mainkeeps a tagpr release PR up to date, merging that PR cuts the tag, and the same job then builds six archives into a GitHub Release and writes a cask into178inaba/homebrew-tap.rdsh --versionreports which build you have — a version that means something only once releases exist.Merging this PR alone publishes nothing: no tag is cut until the release PR is merged.
What
rdsh --version—internal/cmdgets aversionvar that GoReleaser fills through-ldflags -X.resolveVersionprefers it, falls back to the version the toolchain recorded (go install …@vX.Y.Z's module version, or a VCS-stamped pseudo-version fromgo build), and reportsunknownwhen there is no build information. cobra printsrdsh version X.Y.Z..tagpr—releaseBranch = main,versionFile = -(no version constant in the repository),vPrefix = true,release = falseso GoReleaser owns the GitHub Release.changelogis left at its default, which gives the release PR aCHANGELOG.mddiff..goreleaser.yaml—CGO_ENABLED=0,darwin/linux/windows×amd64/arm64,zipon Windows,checksums.txt, and a Homebrew cask pushed to the shared tap..github/workflows/release.yml— tagpr and GoReleaser in one job, the latter gated onsteps.tagpr.outputs.tag != ''..github/workflows/ci.yml— agoreleaser checkstep in the lint job.README.md— the Install section now lists Homebrew, the Releases archive andgo install, in that order.CLAUDE.md—.goreleaser.yamljoins the synced surfaces for the one-line description.skills/rdsh/SKILL.mdneeds no change: it states no install route and lists no flags, which is what its router-style rule asks for.Closes #64
Part of #63
Before merging
The Before #64 is merged items under #63's Manual release steps have to be done first — this workflow runs on every push to
mainand fails at the token step without them:178inaba/homebrew-tapexists and has amainbranch.178inaba/rdshand178inaba/homebrew-tap. Alongside the read & write on contents and pull requests that Distribute prebuilt rdsh binaries through GitHub Releases and Homebrew #63 lists, tagpr's own docs ask for read on issues — worth checking while installing.APP_ID(repository variable) andAPP_PRIVATE_KEY(repository secret) are set on178inaba/rdsh.Decisions worth a second look
persist-credentials: falseon the checkout step, beyond thefetch-depth: 0the issue asks for. tagpr skips installing its own token when checkout has already left anhttp.https://<host>/.extraheaderin the git config, so without this its pushes are made with the defaultGITHUB_TOKEN— and a release PR whose branchGITHUB_TOKENpushed gets no CI until a maintainer approves it in the merge box, which is exactly what the App is there to avoid. It is also what tagpr's own docs recommend.Newer action majors than the issue implies:
actions/create-github-app-token@v3andgoreleaser/goreleaser-action@v7, following "pin action major versions likeci.ymldoes". v3 takesclient-idand treatsapp-idas a deprecated alias, so the release log will carry aUse 'client-id' instead.notice on every run. Moving toclient-idwould mean registering the App's Client ID as a second repository variable, against #63's plan of reusing the existing App and variables, soapp-idstays.-vcomes along with--version: cobra registers the shorthand when nothing else claimsv, and nothing here does. One more flag on the agent-facing surface, mentioned because that surface is a contract.setup-gois gated on the tag too. It exists only for the GoReleaser step below it, and most pushes tomainmerely refresh the release PR.The release job does not wait for CI on the merge commit. That commit was already tested on the release PR itself; the workflow says so in a comment.
Values a sibling CLI would have to change are kept to a minimum, per #63's rule that cflio and slio copy this configuration.
release.ymlreads its owner and repository from the workflow context, and.goreleaser.yamltemplates{{ .ProjectName }}and{{ .ModulePath }}, so the only rdsh-specific values left there are the project name, the cask homepage and the description.How this was checked
Locally, with GoReleaser v2.18.0 (
go run github.com/goreleaser/goreleaser/v2@latest):The snapshot produces exactly six archives (
darwin/linux.tar.gz,windows.zip, eachamd64andarm64) pluschecksums.txt, and no386artifact.dist/rdsh_darwin_arm64_v8.0/rdsh --versionprintsrdsh version 0.0.0-SNAPSHOT-<sha>, which is what confirms the templated-Xpath still resolves; the generatedCasks/rdsh.rbcarries the right name,descand quarantine hook. A plaingo buildbinary prints its VCS pseudo-version andrdsh --helplists-v, --version.What only the merge can show: that the workflow runs on an ordinary push with the GoReleaser step skipped, that the release PR gets CI without approval, and that merging it produces the tag, the Release and
Casks/rdsh.rb. The first release PR will also add.github/release.yml, which tagpr generates on its first run.