-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
159 lines (150 loc) · 5.24 KB
/
Copy path.goreleaser.yaml
File metadata and controls
159 lines (150 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
version: 2
project_name: google-readonly
before:
hooks:
# a mutating tidy must fail the release, not build from a dirty tree
- sh -c "go mod tidy && git diff --exit-code go.mod go.sum"
- go test ./...
# INT-449: darwin builds with CGO so 99designs/keyring's Keychain backend
# (//go:build darwin && cgo) is compiled in; without it credstore fails
# closed on macOS. linux/windows stay CGO-off static (their keyring
# backends are pure Go; cgo there would regress glibc portability).
# Split is by GOOS only — both darwin amd64 and arm64 are still produced.
builds:
- id: gro-darwin
main: ./cmd/gro
binary: gro
# Standard keyring opt-out tags (cli-common working-with-secrets.md §1.10).
flags:
- -tags=keyring_no1password,keyring_nopassage
env:
- CGO_ENABLED=1
goos:
- darwin
goarch:
- amd64
- arm64
overrides:
- goos: darwin
goarch: amd64
goamd64: v1
env:
- CGO_ENABLED=1
- "CC=xcrun clang -arch x86_64"
- goos: darwin
goarch: arm64
goarm64: v8.0
env:
- CGO_ENABLED=1
- "CC=xcrun clang -arch arm64"
ldflags:
- -s -w
- -X github.com/open-cli-collective/google-readonly/internal/version.Version={{.Version}}
- -X github.com/open-cli-collective/google-readonly/internal/version.Commit={{.Commit}}
- -X github.com/open-cli-collective/google-readonly/internal/version.Date={{.Date}}
# macOS code-signing — stable DR so Keychain "Always Allow" survives brew upgrade
# (cli-common distribution.md §2A). Logic + identity live in open-cli-collective/.github
# (macos-codesign-setup), which exports CODESIGN_DARWIN_SCRIPT (absolute). Unset in
# local builds → signing skipped.
hooks:
post:
- cmd: bash -c 'f="${CODESIGN_DARWIN_SCRIPT:-}"; if [ -z "$f" ]; then echo "skip codesign (CODESIGN_DARWIN_SCRIPT unset, local build)"; exit 0; fi; [ -x "$f" ] || { echo "CODESIGN_DARWIN_SCRIPT not executable ($f)" >&2; exit 1; }; exec "$f" "$0" "$1"' "{{ .Path }}" "{{ .Os }}"
- id: gro-unix-win
main: ./cmd/gro
binary: gro
flags:
- -tags=keyring_no1password,keyring_nopassage
env:
- CGO_ENABLED=0
goos:
- linux
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X github.com/open-cli-collective/google-readonly/internal/version.Version={{.Version}}
- -X github.com/open-cli-collective/google-readonly/internal/version.Commit={{.Commit}}
- -X github.com/open-cli-collective/google-readonly/internal/version.Date={{.Date}}
archives:
- formats:
- tar.gz
format_overrides:
- goos: windows
formats:
- zip
# Use binary name with v prefix for archive filenames
name_template: "gro_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE
- README.md
# Linux packages (.deb and .rpm)
nfpms:
- id: google-readonly
# deb/rpm are linux-only: pull the static CGO-off build, never darwin.
# `ids` (the v2 build-id filter) — `builds` is deprecated and fails
# `goreleaser check`.
ids:
- gro-unix-win
package_name: google-readonly
vendor: Open CLI Collective
homepage: https://github.com/open-cli-collective/google-readonly
maintainer: Open CLI Collective <https://github.com/open-cli-collective>
description: Read-only command-line interface for Google services
license: MIT
formats:
- deb
- rpm
bindir: /usr/bin
contents:
- src: LICENSE
dst: /usr/share/licenses/google-readonly/LICENSE
# Canonical Homebrew cask with auto-quarantine removal for non-notarized binaries
# (the darwin binary is code-signed per cli-common distribution.md §2A, not notarized).
# skip_upload: true → goreleaser RENDERS the cask into dist/ but does NOT push
# it; the reusable release workflow's homebrew step is the single atomic tap
# writer. No `token:` here — the tap token belongs only to that writer, and
# skip_upload needs none. No url.template: this is a flat-v repo (no tag rename),
# so goreleaser's default download URL already pins the published tag.
homebrew_casks:
- name: google-readonly
skip_upload: true
repository:
owner: open-cli-collective
name: homebrew-tap
homepage: https://github.com/open-cli-collective/google-readonly
description: "Read-only command-line interface for Google services"
binaries: [gro]
hooks:
post:
install: |
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/gro"]
caveats: |
gro has been installed. Run 'gro init' to configure.
On macOS, your token is stored securely in the system Keychain.
checksum:
name_template: "checksums.txt"
changelog:
sort: asc
use: github
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
- "^chore:"
- "Merge pull request"
groups:
- title: Features
regexp: '^feat:'
order: 0
- title: Bug Fixes
regexp: '^fix:'
order: 1
- title: Other
order: 999
release:
# idempotent re-runs: a retried release overwrites the same assets instead of
# erroring on "asset already exists" (release-preflight hard-requires this).
replace_existing_artifacts: true