Add release CI and publish cross-compiled binaries - #17
Merged
Conversation
The module was declared as a bare `quartr-cli`, so `go install github.com/TJC-LP/quartr-cli/cmd/quartr@latest` could not resolve it — Go fetches the URL in the module path. Renaming is free right now: there are no tags, no releases, and no importers. After v0.1.0 it would be a breaking change for anyone who had imported the package. The version was also stated twice and injectable neither time: a `const Version = "0.1.0"` in cli, and a separate hardcoded `UserAgent = "quartr-cli/0.1.0"` in quartr. A const cannot be set by `-ldflags -X`, so a release build had no way to stamp itself, and the two copies could drift so that `--version` and the wire disagreed. Version resolution now lives in internal/quartr/version.go, below cli, so both readers share one value. It prefers the linker-injected string, then falls back to what the go tool already stamps into every binary: the module version for `go install pkg@v0.1.0`, or the VCS revision for a build from a checkout. "dev" only when none is available. That means an install straight from the module path reports its real version without the Makefile being involved at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Pushing a v* tag now runs the tests, cross-compiles for darwin, linux and windows on amd64 and arm64, and publishes the archives with generated notes. Tags carry the `v`; the reported version does not, so v0.1.0 ships `quartr 0.1.0`. A hyphenated tag (v0.2.0-rc1) publishes as a prerelease. `make dist` is the only build recipe — the workflow calls it rather than reimplementing the matrix in YAML, so what a maintainer builds locally and what gets uploaded cannot diverge. For the same reason ci.yml gains a dist job: a broken cross-compile should fail on the PR that caused it, not after a tag is already pushed and immutable. The workflow asserts the built binary reports the version its tag implies before it publishes anything. A release that ships a mislabeled binary is worse than one that fails to ship. Archives bundle README.md and LICENSE with the binary and are published alongside a SHA256SUMS file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
README gains an Install section: release archives with checksum verification and the Gatekeeper note, `go install ...@latest`, and the make targets. The old text claimed a plain `go build` reports "dev", which is no longer the whole story now that build info is consulted. The skill's command reference had drifted from resources.go in three places, each verified against the binary with --debug rather than by reading the map: - `--type-ids` was listed as working on audio. /audio has no typeIds param, so the CLI drops it and the caller silently gets unfiltered rows — the exact failure mode the --sort-by rejection exists to prevent. - `--transcript-version` was listed for `transcripts get` and `audio get`. Both take only `expand`; it is dropped there. It reaches the API on live and live-transcripts only. - `live transcripts` was missing its `download` operation, which the resource map has had via downloadField all along. `--expand` is now split into its two rows, because the API-side `event` expansion and the client-side `company` join apply to different resources — notably `--expand company` does work on events, which the single combined row left ambiguous. CLAUDE.md documents the release process and records that the module path must keep matching the repo URL. It also called the repo private; it is public. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Sets up release automation so
v*tags publish binaries, and corrects skill-doc drift found while verifying the CLI surface.Release automation
Pushing a tag is the whole process:
release.ymlthen tests, runsmake dist, asserts the binary reports the version its tag implies, and publishes with--generate-notes.make distis the single build recipe. The workflow calls it instead of reimplementing the matrix in YAML, so local and published artifacts come from the same code path.ci.ymlgains adistjob so a broken cross-compile fails on the PR that caused it, rather than after a tag is already pushed and immutable.SHA256SUMS.v0.2.0-rc1) publish as prereleases.Version plumbing
The version was stated twice and injectable neither time —
const Version = "0.1.0"incliplus a separate hardcodedUserAgent = "quartr-cli/0.1.0"inquartr. Aconstcan't be set by-ldflags -X, so release builds had no way to stamp themselves, and the two copies could drift so--versionand the wire disagreed.Resolution now lives in
internal/quartr/version.go(belowcli, so both readers share one value) and prefers, in order: the injected string →debug.ReadBuildInfo(module version forgo install pkg@v0.1.0, VCS revision for a checkout) →dev.Module rename
go.moddeclared a baremodule quartr-cli, sogo install github.com/TJC-LP/quartr-cli/cmd/quartr@latestcould not resolve. Renaming is free right now — no tags, no releases, no importers — and becomes a breaking change the moment v0.1.0 exists. The GitHub repo, clone URL, and binary name are unchanged.Skill doc corrections
Three drift points, each verified against the built binary with
--debugrather than by reading the resource map:--type-idsworks onaudio/audiohas notypeIds; silently dropped, so callers get unfiltered rows--transcript-versionworks ontranscripts get/audio getexpand; it reaches the API onlive/live-transcriptsonlylive transcriptshaslist, get, streamdownloadviadownloadField--expandis split into two rows, since the API-sideeventexpansion and the client-sidecompanyjoin cover different resources —--expand companydoes work onevents, which the combined row left ambiguous.CLAUDE.md also called the repo private; it is public.
Verification
go test ./...,golangci-lint run(0 issues), pre-commit cleanmake distbuilds all 5 targets; archives and checksums verifiedUser-Agent: quartr-cli/0.1.0against a local server+dirtysuffix🤖 Generated with Claude Code