From 41671759e834df9fc9026ea82ffcfb620e41a98b Mon Sep 17 00:00:00 2001 From: Tim Walsh Date: Tue, 24 Feb 2026 13:33:32 -0700 Subject: [PATCH] feat: add GoReleaser config and release workflow for distribution Set up automated release pipeline: - GoReleaser v2 config for cross-platform builds (Linux, macOS, Windows on amd64/arm64) - GitHub Actions release workflow triggered by version tags (v*) - Homebrew Cask auto-generation for timimsms/homebrew-cu tap - Archives with checksums (SHA256) - Version injection via ldflags To create a release: git tag v0.1.0 && git push origin v0.1.0 Requires HOMEBREW_TAP_GITHUB_TOKEN secret for Homebrew tap updates. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/release.yml | 36 +++++++++++ .goreleaser.yml | 110 ++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0731333 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Run tests + run: go test ./... + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: '~> v2' + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..2f20802 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,110 @@ +version: 2 + +project_name: cu + +before: + hooks: + - go mod tidy + +builds: + - id: cu + main: ./cmd/cu + binary: cu + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + ignore: + - goos: windows + goarch: arm64 + ldflags: + - -s -w + - -X github.com/tim/cu/internal/version.Version={{.Version}} + - -X github.com/tim/cu/internal/version.Commit={{.Commit}} + - -X github.com/tim/cu/internal/version.Date={{.Date}} + - -X github.com/tim/cu/internal/version.BuiltBy=goreleaser + +archives: + - id: cu-archive + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else }}{{ .Arch }}{{ end }} + ids: + - cu + formats: + - tar.gz + format_overrides: + - goos: windows + formats: + - zip + files: + - README.md + - LICENSE* + +checksum: + name_template: 'checksums.txt' + algorithm: sha256 + +snapshot: + version_template: "{{ incpatch .Version }}-dev" + +changelog: + sort: asc + use: github + filters: + exclude: + - '^docs:' + - '^test:' + - '^chore:' + - '^ci:' + groups: + - title: 'New Features' + regexp: '^feat' + - title: 'Bug Fixes' + regexp: '^fix' + - title: 'Performance' + regexp: '^perf' + +homebrew_casks: + - name: cu + ids: + - cu-archive + repository: + owner: timimsms + name: homebrew-cu + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + directory: Casks + homepage: "https://github.com/timimsms/cu" + description: "A CLI for ClickUp — like gh is for GitHub" + +release: + github: + owner: timimsms + name: cu + draft: false + prerelease: auto + name_template: "cu v{{.Version}}" + header: | + ## ClickUp CLI v{{.Version}} + footer: | + ## Installation + + ### Homebrew (macOS/Linux) + ```bash + brew install timimsms/cu/cu + ``` + + ### Go + ```bash + go install github.com/tim/cu/cmd/cu@v{{.Version}} + ``` + + ### Direct Download + Download the appropriate archive from the assets below, extract, and add to your PATH.