Summary
Add cross-compiled release binaries for three new platform/arch targets:
| OS |
Arch |
Notes |
| Linux |
arm64 |
Servers, Raspberry Pi, Graviton |
| macOS |
amd64 (x86_64) |
Intel Macs |
| macOS |
arm64 |
Apple Silicon (M1+) |
Currently only Linux amd64 is built.
Prerequisite
With CGO eliminated, GOOS/GOARCH cross-compilation works out of the box — no C cross-compilers or osxcross toolchains needed.
Implementation plan
1. Update .goreleaser.yaml — add build targets
Replace the single linux-amd64 build with multiple builds:
builds:
- id: linux-amd64
env:
- CGO_ENABLED=0
goos: [linux]
goarch: [amd64]
flags: [-trimpath]
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }}
main: ./cmd/virtwork/
- id: linux-arm64
env:
- CGO_ENABLED=0
goos: [linux]
goarch: [arm64]
flags: [-trimpath]
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }}
main: ./cmd/virtwork/
- id: darwin-amd64
env:
- CGO_ENABLED=0
goos: [darwin]
goarch: [amd64]
flags: [-trimpath]
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }}
main: ./cmd/virtwork/
- id: darwin-arm64
env:
- CGO_ENABLED=0
goos: [darwin]
goarch: [arm64]
flags: [-trimpath]
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }}
main: ./cmd/virtwork/
Alternatively, this can be consolidated into a single build entry with multiple GOOS/GOARCH values:
builds:
- env:
- CGO_ENABLED=0
goos: [linux, darwin]
goarch: [amd64, arm64]
flags: [-trimpath]
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }}
main: ./cmd/virtwork/
GoReleaser generates all valid combinations automatically.
2. Update .goreleaser.yaml — Docker image build IDs
The dockers section currently references ids: [linux-amd64]. If builds are consolidated into a single entry, remove the ids filter or update it to reference the new build ID. The Docker image only needs the linux/amd64 binary.
3. Update archive naming
The existing name_template already handles OS and Arch mapping correctly (Darwin, Linux, x86_64, arm64). No changes needed.
4. Verify release artifacts
After the next tag push, the GitHub release page should include:
virtwork_Linux_x86_64.tar.gz
virtwork_Linux_arm64.tar.gz
virtwork_Darwin_x86_64.tar.gz
virtwork_Darwin_arm64.tar.gz
- checksums file
Acceptance criteria
Notes
- No changes to CI workflow (
release.yml) are needed — GoReleaser handles the matrix
- macOS binaries are unsigned; users will need to
xattr -d com.apple.quarantine or allow in System Settings on first run — this is standard for unsigned CLI tools distributed outside the App Store
- Consider adding a multi-arch Docker image (linux/amd64 + linux/arm64) as a follow-up if there's demand
Summary
Add cross-compiled release binaries for three new platform/arch targets:
Currently only Linux amd64 is built.
Prerequisite
mattn/go-sqlite3withmodernc.org/sqliteto remove CGO dependencyWith CGO eliminated,
GOOS/GOARCHcross-compilation works out of the box — no C cross-compilers or osxcross toolchains needed.Implementation plan
1. Update
.goreleaser.yaml— add build targetsReplace the single
linux-amd64build with multiple builds:Alternatively, this can be consolidated into a single build entry with multiple GOOS/GOARCH values:
GoReleaser generates all valid combinations automatically.
2. Update
.goreleaser.yaml— Docker image build IDsThe
dockerssection currently referencesids: [linux-amd64]. If builds are consolidated into a single entry, remove theidsfilter or update it to reference the new build ID. The Docker image only needs the linux/amd64 binary.3. Update archive naming
The existing
name_templatealready handles OS and Arch mapping correctly (Darwin,Linux,x86_64,arm64). No changes needed.4. Verify release artifacts
After the next tag push, the GitHub release page should include:
virtwork_Linux_x86_64.tar.gzvirtwork_Linux_arm64.tar.gzvirtwork_Darwin_x86_64.tar.gzvirtwork_Darwin_arm64.tar.gzAcceptance criteria
goreleaser checkpasses (config validation)goreleaser build --snapshot --cleanproduces all 4 binaries locallyNotes
release.yml) are needed — GoReleaser handles the matrixxattr -d com.apple.quarantineor allow in System Settings on first run — this is standard for unsigned CLI tools distributed outside the App Store