Skip to content

Commit d317ec1

Browse files
committed
ci: build release binaries with goreleaser
Six targets, matching the cross-compile job: linux, darwin and windows on amd64 and arm64. CGO_ENABLED=0 costs nothing — go-keyring shells out to `security` on macOS and talks D-Bus on Linux, neither of which needs cgo. The tag drives everything: release-please creates it and the release, then `mode: append` uploads the archives into that release without touching the notes it wrote. beep boop
1 parent 7255b9d commit d317ec1

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
goreleaser:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write # upload release artifacts
15+
steps:
16+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
fetch-depth: 0
19+
persist-credentials: false
20+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
21+
with:
22+
go-version-file: go.mod
23+
- uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
24+
with:
25+
version: "~> v2"
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
3+
builds:
4+
- binary: flagsmith
5+
env:
6+
- CGO_ENABLED=0
7+
flags:
8+
- -trimpath
9+
# .Tag, not .Version: `flagsmith --version` should print the tag verbatim,
10+
# and internal/version.IsRelease expects the leading v.
11+
ldflags:
12+
- -s -w -X github.com/Flagsmith/flagsmith-cli/internal/version.Version={{ .Tag }}
13+
mod_timestamp: "{{ .CommitTimestamp }}"
14+
goos:
15+
- linux
16+
- darwin
17+
- windows
18+
goarch:
19+
- amd64
20+
- arm64
21+
22+
archives:
23+
- name_template: "flagsmith_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
24+
formats:
25+
- tar.gz
26+
format_overrides:
27+
- goos: windows
28+
formats:
29+
- zip
30+
files:
31+
- LICENSE
32+
- README.md
33+
34+
checksum:
35+
name_template: checksums.txt
36+
37+
# changelog handled by release-please.
38+
changelog:
39+
disable: true
40+
41+
release:
42+
mode: append
43+
prerelease: auto

0 commit comments

Comments
 (0)