project: add versioned release workflow and squirrel version#166
Open
mbertschler wants to merge 2 commits into
Open
project: add versioned release workflow and squirrel version#166mbertschler wants to merge 2 commits into
squirrel version#166mbertschler wants to merge 2 commits into
Conversation
Give squirrel a real release/packaging story (#151): - Build-time version injection: replace the hardcoded `0.0.0-dev` agentVersion const with package-level `version`/`commit`/`date` vars (cmd/squirrel/version.go), stamped via `-ldflags -X main.*`. The same `version` string feeds the agent's GET /v1/health. - `squirrel version` subcommand (own file) prints version, commit, build date, and Go toolchain / platform. - `.goreleaser.yaml` + tag-triggered `.github/workflows/release.yml`: pushing a vX.Y.Z tag cross-compiles the CGO-free CLI (linux/darwin/ windows, amd64/arm64) and publishes archives + checksums as a GitHub Release. squirrel-desktop (Wails/CGO) stays out of scope. - README §Install documents the prebuilt-binary path alongside `go install`. No DB schema change: the tool's release version is separate from SchemaVersion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Skm2Qm6wWUB7dD4CpPTz7
There was a problem hiding this comment.
Pull request overview
Adds a first-class release/versioning story for squirrel: semver tags drive GitHub Releases with cross-platform CLI binaries, and the built binary now reports its stamped version (both via squirrel version and the agent’s /v1/health).
Changes:
- Introduces build-time-injected build metadata (
version/commit/date) and a newsquirrel versionsubcommand (with tests). - Wires the injected version string into the agent’s startup log and
/v1/healthresponse. - Adds GoReleaser configuration + a tag-triggered GitHub Actions release workflow, and updates install docs to include prebuilt binaries.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents installing from GitHub Releases alongside go install, and notes version reporting. |
| cmd/squirrel/version.go | Adds build metadata variables and implements squirrel version output formatting. |
| cmd/squirrel/version_test.go | Adds coverage for the version command output. |
| cmd/squirrel/root.go | Registers the new version subcommand. |
| cmd/squirrel/agent.go | Replaces the old hardcoded agent version with the injected build version. |
| .goreleaser.yaml | Defines cross-platform CLI builds/archives/checksums and ldflags injection. |
| .github/workflows/release.yml | Adds tag-triggered workflow to run GoReleaser and publish a GitHub Release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- .goreleaser.yaml: use `go mod download` instead of `go mod tidy` in before.hooks so a tagged release never rewrites go.mod/go.sum and fails on a dirty tree; CI already enforces tidiness on every push. - README: add a one-line Windows hint (download the `_windows_` .zip, extract squirrel.exe) so the cross-platform install is actionable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Skm2Qm6wWUB7dD4CpPTz7
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.
Summary
Gives squirrel a release/packaging story: semver tags become the source of truth for the tool version, that version is stamped into the binary at build time, and a tag push produces a GitHub Release with cross-platform binaries. Closes the gap where the only install path was
go install ...@latestfrom source and the binary could not report what it was (0.0.0-devplaceholder).Changes
cmd/squirrel/version.go): replaces the hardcodedagentVersion = "0.0.0-dev"const inagent.gowith package-levelversion/commit/datevars, injected via-ldflags -X main.*. The sameversionstring feeds the agent'sGET /v1/healthresponse and its startup log line. A plaingo build/go installkeeps the0.0.0-devplaceholder, so a source build stays distinguishable from a tagged release.squirrel versionsubcommand (own file, per the one-cobra-command-per-file convention): prints version, commit, build date, and the Go toolchain / target platform..goreleaser.yaml: cross-compiles the CGO-free CLI (modernc.org/sqliteis pure Go) for linux/darwin/windows × amd64/arm64, injects the ldflags, and producestar.gz(zip on Windows) archives plus achecksums.txt.cmd/squirrel-desktop(Wails + CGO + native WebKitGTK) is deliberately out of scope..github/workflows/release.yml: tag-triggered (v*.*.*) workflow that runs GoReleaser, modeled on the existingci.ymlstyle.README.md§Install: documents the prebuilt-binary path alongsidego install.No DB schema change — the tool's release version is separate from
SchemaVersion, which is untouched.Testing
go vet ./...— cleango test ./...— all pass (addedTestVersionCommand; existing/v1/healthtest still passes)golangci-lint run(v2.12.2) — 0 issues-ldflags -Xinjection: a build withmain.version=v1.2.3reportssquirrel v1.2.3viasquirrel versiongoreleaser check(v2.12.5) validates.goreleaser.yamlCloses #151
🤖 Generated with Claude Code
https://claude.ai/code/session_014Skm2Qm6wWUB7dD4CpPTz7
Generated by Claude Code