Files
beads/.goreleaser.yml
Bob Cotton c802f27fe5 feat: comprehensive NixOS support improvements (#1024)
* feat: comprehensive NixOS support improvements

This commit adds full NixOS support and automates Nix package maintenance:

## Static Linux Binaries for NixOS

Changes .goreleaser.yml to create static Linux binaries:
- Set CGO_ENABLED=0 for Linux amd64 and arm64 builds
- Remove cross-compiler dependencies (aarch64-linux-gnu-gcc)
- Simplifies build process while fixing NixOS compatibility

Static binaries work on all Linux distributions including NixOS, Alpine,
and musl-based distros without dynamic linker dependencies.

## Automated default.nix Version Management

Adds default.nix to the version bump workflow:
- Updates default.nix version field in bump-version.sh (new step 9)
- Adds default.nix to version verification checks
- Prevents version drift (was 5 releases behind: 0.42.0 vs 0.47.0)
- Updates README.md to remove glibc 2.32+ requirement

## Automated vendorHash Management

Creates scripts/update-nix-vendorhash.sh to automate vendorHash updates:
- Automatically detects correct hash by triggering Nix build error
- Extracts hash from error message and updates default.nix
- Verifies update with clean build
- Eliminates error-prone manual copy-paste workflow
- Works with local Nix OR Docker (uses nixos/nix image automatically)

Integrates vendorHash check into bump-version.sh:
- Detects when go.mod or go.sum have changed
- Prompts to run vendorHash update script interactively
- Catches synchronization issues at release time

## Documentation

Updates AGENTS.md with Nix package maintenance guide:
- Documents when and how to update vendorHash
- Recommends automated script as primary method
- Provides manual and alternative methods as fallback
- Notes Docker fallback for maintainers without Nix

## Impact

- NixOS users can now install via standard methods
- Nix package version stays synchronized automatically
- vendorHash updates work without Nix installed (via Docker)
- vendorHash updates are caught during release workflow
- All Linux users benefit from more portable binaries

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: address PR review feedback for NixOS support

Fixes three issues identified in PR review:

1. Replace undefined log_* functions in bump-version.sh with existing
   echo pattern (log_warning, log_info, log_success, log_error were
   called but not defined)

2. Update default.nix version from 0.42.0 to 0.47.0 to fix version
   drift with cmd/bd/version.go

3. Remove Nix Package Maintenance section from AGENTS.md per beads
   architecture (use bd prime for dynamic context, keep AGENTS.md
   minimal)

* fix: update versions to 0.47.1 after merge with main

- Update claude-plugin plugin.json to 0.47.1
- Update default.nix to 0.47.1
- Fixes version check failures after merging latest main branch

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 23:46:33 -08:00

243 lines
5.2 KiB
YAML

# GoReleaser configuration for beads
# See https://goreleaser.com for documentation
version: 2
before:
hooks:
# Ensure dependencies are up to date
- go mod tidy
builds:
- id: bd-linux-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- id: bd-linux-arm64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- arm64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- id: bd-android-arm64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=0
goos:
- android
goarch:
- arm64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- id: bd-darwin-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
goos:
- darwin
goarch:
- amd64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- id: bd-darwin-arm64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
goos:
- darwin
goarch:
- arm64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- id: bd-windows-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- -buildmode=exe
hooks:
post:
# Sign Windows executable with Authenticode certificate
# Requires WINDOWS_SIGNING_CERT_PFX_BASE64 and WINDOWS_SIGNING_CERT_PASSWORD secrets
- ./scripts/sign-windows.sh "{{ .Path }}"
- id: bd-windows-arm64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- arm64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
- -buildmode=exe
hooks:
post:
# Sign Windows executable with Authenticode certificate
# Requires WINDOWS_SIGNING_CERT_PFX_BASE64 and WINDOWS_SIGNING_CERT_PASSWORD secrets
- ./scripts/sign-windows.sh "{{ .Path }}"
- id: bd-freebsd-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=0
goos:
- freebsd
goarch:
- amd64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -X main.Commit={{.Commit}}
- -X main.Branch={{.Branch}}
archives:
- id: bd-archive
format: tar.gz
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
- CHANGELOG.md
checksum:
name_template: "checksums.txt"
algorithm: sha256
snapshot:
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
- "Merge pull request"
- "Merge branch"
groups:
- title: "Features"
regexp: '^.*feat(\(\w+\))?:.*$'
order: 0
- title: "Bug Fixes"
regexp: '^.*fix(\(\w+\))?:.*$'
order: 1
- title: "Others"
order: 999
release:
github:
owner: steveyegge
name: beads
draft: false
prerelease: auto
name_template: "v{{.Version}}"
header: |
## beads v{{.Version}}
Pre-compiled binaries for Linux, macOS (Intel & Apple Silicon), Windows (AMD64 & ARM64), Android/Termux (ARM64), and FreeBSD.
### Installation
**Homebrew (macOS/Linux):**
```bash
brew install steveyegge/beads/bd
```
**Quick Install (macOS/Linux/FreeBSD):**
```bash
curl -sSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
```
**Windows (PowerShell):**
```powershell
irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
```
**Manual Install:**
Download the appropriate binary for your platform below, extract it, and place it in your PATH.
# Homebrew tap - disabled, handled by separate workflow
# brews:
# - name: bd
# repository:
# owner: steveyegge
# name: homebrew-beads
# branch: main
# directory: Formula
# homepage: https://github.com/steveyegge/beads
# description: "AI-supervised issue tracker for coding workflows"
# license: MIT
# test: |
# system "#{bin}/bd", "version"
# install: |
# bin.install "bd"
# Announce the release
announce:
skip: false