Repository navigation
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
120 lines (107 loc) · 3.55 KB
/
Copy path.goreleaser.yaml
File metadata and controls
120 lines (107 loc) · 3.55 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
# goreleaser config for cs-ledger: a CGO_ENABLED=0 static
# multi-arch binary, checksummed + SBOM'd + cosign-signed releases (supply chain).
#
# goreleaser check # validate this file
# goreleaser build --single-target --snapshot --clean --output bin/cs-ledger
# goreleaser release --snapshot --clean # full local dry-run (dist/)
# goreleaser release --clean # tagged release (needs a git tag)
version: 2
project_name: cs-ledger
# The viewer's JavaScript is embedded in the binary, so its suite gates a
# release exactly as the Go suite does. Both are what `make check` runs, and
# node is already required to work on this repo (CONTRIBUTING.md).
before:
hooks:
- go mod tidy
- go vet ./...
- go test ./...
builds:
- id: cs-ledger
main: ./cmd/cs-ledger
binary: cs-ledger
env:
- CGO_ENABLED=0 # static, no cgo
flags:
- -trimpath
ldflags:
- -s -w
# Linux and macOS, both architectures: darwin/amd64 costs nothing to add and
# is what an Intel Mac still needs.
goos:
- linux
- darwin
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}" # reproducible builds
archives:
- id: cs-ledger
ids:
- cs-ledger
formats:
- tar.gz
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
# What someone holding the binary needs: the setup steps, the manual, the
# schema, and the file an agent harness reads. The rest of the docs are for
# working on the tool, and stay in the repository.
files:
- README.md
- INSTALL.md
- MANUAL.md
- GUIDE.md
- SPEC.md
- AGENTS.md
- LICENSE
# Apache 2.0 section 4(d) obliges every redistributor to carry NOTICE, and
# a release archive is a redistribution.
- NOTICE
checksum:
name_template: checksums.txt
algorithm: sha256
# Software bill of materials per archive (supply chain). Requires cyclonedx-gomod:
# go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
sboms:
- id: archive
artifacts: archive
documents:
- "{{ .ArtifactName }}.sbom.json"
cmd: cyclonedx-gomod
args: ["app", "-json", "-output", "$document", "-main", "cmd/cs-ledger", "../../.."]
# Keyless cosign signing of the checksums (supply chain). Requires cosign; runs
# in release mode. Uses ambient OIDC (CI) — set COSIGN_EXPERIMENTAL=1 locally.
signs:
- id: cosign
cmd: cosign
signature: "${artifact}.sig"
certificate: "${artifact}.pem"
args:
- sign-blob
- "--output-signature=${signature}"
- "--output-certificate=${certificate}"
- "${artifact}"
- "--yes"
artifacts: checksum
output: true
snapshot:
version_template: '{{ with index .Env "VERSION" }}{{ . }}{{ else }}{{ .ShortCommit }}{{ end }}'
changelog:
sort: asc
use: git
filters:
exclude:
- "^docs:"
- "^chore:"
- "^test:"
- "merge conflict"
release:
draft: true
name_template: "cs-ledger {{ .Tag }}"
header: |
## cs-ledger {{ .Tag }}
Structured issue tracking for agent-managed repositories: agents write small
JSON records, humans read a generated, interactive, self-contained
`ledger.html`. There is no service to run, and the binary is the whole tool.
A release binary also stamps the `toolVersion` pin that `cs-ledger check`
enforces, so renders made with it are committable where a dev build's are not.
Static `CGO_ENABLED=0` binaries; verify with `checksums.txt` (+ cosign `.sig`).