1# GoReleaser configuration for release-candidate (pre-release) builds.
2# Like .goreleaser.yml but skips Homebrew, WinGet and Nix tap publishing —
3# those taps should only ever point at a stable release. RC artifacts are
4# attached to a GitHub pre-release; Snapcraft is pushed to the `candidate`
5# channel by the workflow. Driven by a real `vX.Y.Z-rcN` tag (not --snapshot).
6version: 2
7
8before:
9 hooks:
10 - go mod tidy
11
12builds:
13 - id: matcha
14 main: .
15 goos:
16 - linux
17 - darwin
18 - windows
19 goarch:
20 - amd64
21 - arm64
22 flags:
23 - -trimpath
24 ldflags:
25 - -s -w -buildid= -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
26 env:
27 - CGO_ENABLED=1
28 - >-
29 {{- if eq .Os "darwin" }}SDKROOT={{ .Env.SDK_PATH }}{{- end }}
30 - >-
31 {{- if eq .Os "darwin" }}MACOSX_DEPLOYMENT_TARGET=11.0{{- end }}
32 - >-
33 {{- if eq .Os "darwin" }}CGO_CFLAGS=-isysroot {{ .Env.SDK_PATH }} -mmacosx-version-min=11.0{{- end }}
34 - >-
35 {{- if eq .Os "darwin" }}CGO_LDFLAGS=-isysroot {{ .Env.SDK_PATH }}
36 {{- else if eq .Os "linux" }}CGO_LDFLAGS=-L{{ .Env.PCSC_DIR }}/lib/{{ .Arch }}
37 {{- end }}
38 - >-
39 {{- if eq .Os "darwin" }}
40 {{- if eq .Arch "amd64"}}CC=clang -arch x86_64 -isysroot {{ .Env.SDK_PATH }}{{- end }}
41 {{- if eq .Arch "arm64"}}CC=clang -arch arm64 -isysroot {{ .Env.SDK_PATH }}{{- end }}
42 {{- else if eq .Os "linux" }}
43 {{- if eq .Arch "amd64" }}CC=zig cc -target x86_64-linux-musl -lc{{- end }}
44 {{- if eq .Arch "arm64"}}CC=zig cc -target aarch64-linux-musl -lc{{- end }}
45 {{- else if eq .Os "windows" }}
46 {{- if eq .Arch "amd64" }}CC=zig cc -target x86_64-windows-gnu -lc{{- end }}
47 {{- if eq .Arch "arm64"}}CC=zig cc -target aarch64-windows-gnu -lc{{- end }}
48 {{- end }}
49
50archives:
51 - formats: [tar.gz]
52 name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
53 format_overrides:
54 - goos: windows
55 formats: ["zip"]
56 files:
57 - LICENSE
58 - README.md
59
60checksum:
61 name_template: "checksums.txt"
62
63changelog:
64 use: github-native
65
66# Force pre-release regardless of tag parsing, and let GoReleaser create the
67# GitHub release with the rc artifacts attached.
68release:
69 draft: false
70 prerelease: true
71 name_template: "{{ .Tag }}"
72 footer: |
73 ---
74 > [!WARNING]
75 > This is a **release candidate** for v1 — not a final release. Expect bugs and report them.
76
77 - **Snapcraft:** `snap install matcha --candidate`