Release Guide
This repo ships prebuilt binaries via GoReleaser and an npm wrapper (npm/) that downloads the correct binary on install. Follow this guide to cut and publish a new version.
Prerequisites
ghauthenticated:gh auth login(used bymise run release_gh).GITHUB_TOKENavailable to GoReleaser (therelease_ghtask reads it fromgh auth token).- Node/npm installed for publishing the npm package.
- Ensure
.goreleaser.ymlarchives produce binary-only tarballs (no extra files).
Versioning Rules
- Git tag:
vX.Y.Z(with leadingv). - npm package version (
npm/package.json):X.Y.Z(nov). - Asset names (from GoReleaser):
copilot-proxy_{{.Version}}_{{.Os}}_{{.Arch}}.tar.gz.
Standard Release Workflow
- Pick a version
X.Y.Z(SemVer). - Update npm version to match:
- Edit
npm/package.jsonto set"version": "X.Y.Z"(or runnpm version X.Y.Z --no-git-tag-versioninnpm/).
- Edit
- Commit the change:
git add npm/package.json && git commit -m "Release vX.Y.Z"
- Create and push tag:
git tag -a vX.Y.Z -m "Release vX.Y.Z"git push && git push --tags
- Create GitHub draft release artifacts:
mise run release_gh(runs GoReleaser with--clean, producing a Draft release on GitHub).
- Verify assets in the Draft release:
- Assets should be
copilot-proxy_X.Y.Z_<os>_<arch>.tar.gzpluschecksums.txt. - Spot check one asset: download locally and confirm
tar -tzfcontains only thecopilot-api-proxy[.exe]binary.
- Assets should be
- Publish the GitHub release (remove Draft):
- Npm postinstall downloads from the published
releases/download/vX.Y.Z/…URL; Draft releases will 404.
- Npm postinstall downloads from the published
- Publish the npm package:
cd npm- First-time only:
npm publish --access public - Subsequent releases:
npm publish .npmignoreensures local binaries aren’t bundled.
- Sanity check install:
npm install -g copilot-api-proxy@X.Y.Z- Confirm the install downloads the right asset and places the
copilot-api-proxybinary in the package directory.
Local Dry‑Run (optional)
- Build snapshot artifacts locally:
mise run release - Test npm install against local
dist:COPILOT_PROXY_BASE_URL="file://$(pwd)/dist" npm install -g ./npm
Troubleshooting
- 404 during npm postinstall: The GitHub release is likely still a Draft or versions don’t match; publish the release and ensure
npm/package.jsonversion matches the tag. - Checksum mismatch: Rebuild and re-upload assets; don’t edit tarballs after checksums are generated.
- Wrong asset name: Ensure
.goreleaser.ymlarchives.name_templateiscopilot-proxy_{{ .Version }}_{{ .Os }}_{{ .Arch }}.
Handy Commands
- Format/build locally:
mise run fmt && mise run build - Release (GitHub Draft):
mise run release_gh - Snapshot release (local
dist/):mise run release