|
| 1 | +# .goreleaser.yml — release pipeline for the `instant` CLI. |
| 2 | +# |
| 3 | +# CLI-MCP-13R2 (BugBash QA round 2 strategic gap): the CLI had no release |
| 4 | +# workflow. Every other backend service in instanode.dev auto-builds on push |
| 5 | +# (CLAUDE.md rule 15); the CLI's only install path was `go install`, which |
| 6 | +# requires a Go toolchain and pins the user to whatever HEAD happens to be. |
| 7 | +# |
| 8 | +# This config + .github/workflows/release.yml + install.sh together close |
| 9 | +# that gap: |
| 10 | +# |
| 11 | +# * Tagging `vX.Y.Z` on master triggers cross-compiled builds for |
| 12 | +# darwin / linux / windows × amd64 / arm64. |
| 13 | +# * Binaries are stamped with the tag's version, the commit SHA, and the |
| 14 | +# UTC build time (matches the Makefile's ldflag scheme — CLAUDE.md rule |
| 15 | +# 14 build-SHA gate still applies via `instant --version`). |
| 16 | +# * `instant_v0.2.0_darwin_arm64.tar.gz` etc. land on the GitHub release |
| 17 | +# page; `checksums.txt` is signed by sigstore cosign (keyless OIDC). |
| 18 | +# * `install.sh` curl-pipe-sh fetches the right archive for the user's |
| 19 | +# platform. |
| 20 | +# |
| 21 | +# We intentionally do NOT publish to Homebrew / Scoop / apt yet — that's a |
| 22 | +# follow-up PR. This release pipeline keeps the dependency footprint to: |
| 23 | +# - goreleaser (pinned action SHA in release.yml) |
| 24 | +# - syft (SBOM, pinned) |
| 25 | +# - cosign (signing, pinned) |
| 26 | +# Everything else is removed. |
| 27 | + |
| 28 | +version: 2 |
| 29 | + |
| 30 | +project_name: instant |
| 31 | + |
| 32 | +before: |
| 33 | + hooks: |
| 34 | + - go mod tidy |
| 35 | + |
| 36 | +builds: |
| 37 | + - id: instant |
| 38 | + binary: instant |
| 39 | + main: ./ |
| 40 | + env: |
| 41 | + - CGO_ENABLED=0 |
| 42 | + goos: |
| 43 | + - linux |
| 44 | + - darwin |
| 45 | + - windows |
| 46 | + goarch: |
| 47 | + - amd64 |
| 48 | + - arm64 |
| 49 | + # No 32-bit / mips targets — the agent surface is `INSTANT_API_URL` over |
| 50 | + # HTTPS, which is hard to use from constrained devices anyway. |
| 51 | + ignore: |
| 52 | + # Windows on ARM64 ships, but it's a niche; revisit if anyone files |
| 53 | + # an issue. Linux/arm64 + Darwin/arm64 cover the GH Actions runner |
| 54 | + # matrix and Apple Silicon developer laptops. |
| 55 | + - goos: windows |
| 56 | + goarch: arm64 |
| 57 | + # ldflags mirror the Makefile's `make build` target so the release |
| 58 | + # binary's `--version` line matches the source of truth. CLAUDE.md |
| 59 | + # rule 14 (build-SHA gate) reads from these via `instant --version`. |
| 60 | + ldflags: |
| 61 | + - -s -w |
| 62 | + - -X main.Version={{.Version}} |
| 63 | + - -X main.Commit={{.ShortCommit}} |
| 64 | + - -X main.BuildTime={{.Date}} |
| 65 | + |
| 66 | +archives: |
| 67 | + - id: instant-archive |
| 68 | + # GoReleaser v2 renamed `name_template` keys — the format below is the |
| 69 | + # v2 canonical layout: `<project>_<version>_<os>_<arch>`. install.sh |
| 70 | + # depends on this exact pattern. |
| 71 | + name_template: >- |
| 72 | + {{ .ProjectName }}_{{ .Version }}_ |
| 73 | + {{- if eq .Os "darwin" }}darwin |
| 74 | + {{- else if eq .Os "linux" }}linux |
| 75 | + {{- else if eq .Os "windows" }}windows{{ end }}_ |
| 76 | + {{- .Arch }} |
| 77 | + format_overrides: |
| 78 | + - goos: windows |
| 79 | + formats: |
| 80 | + - zip |
| 81 | + formats: |
| 82 | + - tar.gz |
| 83 | + files: |
| 84 | + - LICENSE |
| 85 | + - README.md |
| 86 | + |
| 87 | +checksum: |
| 88 | + name_template: "checksums.txt" |
| 89 | + algorithm: sha256 |
| 90 | + |
| 91 | +# Sigstore keyless signing via GitHub OIDC. The release workflow grants |
| 92 | +# `id-token: write` so cosign can mint a short-lived cert from Fulcio. No |
| 93 | +# private keys to manage. Verification: |
| 94 | +# |
| 95 | +# cosign verify-blob \ |
| 96 | +# --certificate-identity-regexp 'https://github.com/InstaNode-dev/cli/.github/workflows/release.yml@.*' \ |
| 97 | +# --certificate-oidc-issuer https://token.actions.githubusercontent.com \ |
| 98 | +# --signature checksums.txt.sig \ |
| 99 | +# --certificate checksums.txt.pem \ |
| 100 | +# checksums.txt |
| 101 | +signs: |
| 102 | + - id: cosign-checksums |
| 103 | + cmd: cosign |
| 104 | + artifacts: checksums |
| 105 | + signature: "${artifact}.sig" |
| 106 | + certificate: "${artifact}.pem" |
| 107 | + args: |
| 108 | + - sign-blob |
| 109 | + - "--output-signature=${signature}" |
| 110 | + - "--output-certificate=${certificate}" |
| 111 | + - "${artifact}" |
| 112 | + - --yes |
| 113 | + output: true |
| 114 | + |
| 115 | +# SBOM generation (CycloneDX via syft). Lands alongside binaries on the |
| 116 | +# release page. cyclonedx is the CSO/CISA-preferred format. |
| 117 | +sboms: |
| 118 | + - id: instant-sbom |
| 119 | + artifacts: archive |
| 120 | + |
| 121 | +release: |
| 122 | + github: |
| 123 | + owner: InstaNode-dev |
| 124 | + name: cli |
| 125 | + draft: false |
| 126 | + prerelease: auto |
| 127 | + name_template: "v{{.Version}}" |
| 128 | + header: | |
| 129 | + `instant` CLI release {{.Version}}. |
| 130 | +
|
| 131 | + ## Install (one-liner) |
| 132 | +
|
| 133 | + ```bash |
| 134 | + curl -sSfL https://instanode.dev/install.sh | sh |
| 135 | + ``` |
| 136 | +
|
| 137 | + Or download the archive for your platform from the assets below and |
| 138 | + drop the binary on `$PATH`. |
| 139 | +
|
| 140 | + ## Verify the release |
| 141 | +
|
| 142 | + Checksums are signed with sigstore cosign (keyless OIDC). To verify: |
| 143 | +
|
| 144 | + ```bash |
| 145 | + cosign verify-blob \ |
| 146 | + --certificate-identity-regexp 'https://github.com/InstaNode-dev/cli/.github/workflows/release.yml@.*' \ |
| 147 | + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ |
| 148 | + --signature checksums.txt.sig \ |
| 149 | + --certificate checksums.txt.pem \ |
| 150 | + checksums.txt |
| 151 | + ``` |
| 152 | +
|
| 153 | +snapshot: |
| 154 | + version_template: "{{ incpatch .Version }}-next" |
| 155 | + |
| 156 | +changelog: |
| 157 | + sort: asc |
| 158 | + filters: |
| 159 | + exclude: |
| 160 | + - '^docs:' |
| 161 | + - '^chore:' |
| 162 | + - '^test:' |
| 163 | + - '^ci:' |
| 164 | + - Merge pull request |
0 commit comments