forked from DataDog/pup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
168 lines (144 loc) · 4.69 KB
/
Copy path.goreleaser.yaml
File metadata and controls
168 lines (144 loc) · 4.69 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
160
161
162
163
164
165
166
167
168
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
project_name: pup
report_sizes: true
before:
hooks:
- rustup default stable
- cargo fetch --locked
# Verify Cargo.toml version matches git tag
- >-
sh -c 'CARGO_VER=$(grep "^version" Cargo.toml | head -1 | sed "s/.*\"\(.*\)\"/\1/"); TAG_VER=$(git describe --tags --exact-match 2>/dev/null | sed "s/^v//"); if [ "$CARGO_VER" != "$TAG_VER" ]; then echo "ERROR: Cargo.toml version ($CARGO_VER) does not match git tag ($TAG_VER)"; exit 1; fi'
# Build WASM targets (not supported by cargo-zigbuild)
- rustup target add wasm32-wasip2 wasm32-unknown-unknown
- cargo build --release --target wasm32-wasip2 --no-default-features --features wasi
- sh -c 'mkdir -p wasm-out && cp target/wasm32-wasip2/release/pup.wasm wasm-out/pup_wasi.wasm'
- wasm-pack build --target web --no-default-features --features browser
- sh -c 'tar czf wasm-out/pup_browser_wasm.tar.gz -C pkg .'
builds:
# Linux targets: use cargo-zigbuild (zig handles glibc cross-compilation)
- id: linux
builder: rust
binary: pup
targets:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
flags:
- --release
- --features=vendored-openssl
# macOS targets: use native cargo + Apple clang (avoids aws-lc-sys/cmake
# cross-compile failure when zig links x86_64-apple-darwin from arm64)
- id: macos
builder: rust
binary: pup
command: build
targets:
- x86_64-apple-darwin
- aarch64-apple-darwin
flags:
- --release
- --features=vendored-openssl
archives:
- formats: [tar.gz]
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
files:
- LICENSE
- LICENSE-3rdparty.csv
- README.md
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
algorithm: sha256
extra_files:
- glob: wasm-out/pup_wasi.wasm
- glob: wasm-out/pup_browser_wasm.tar.gz
source:
enabled: true
name_template: "{{ .ProjectName }}_{{ .Version }}_source"
format: tar.gz
sboms:
- artifacts: archive
cmd: syft
args:
- "${artifact}"
- "--output"
- "spdx-json=${document}"
documents:
- "{{ .ArtifactName }}.sbom.json"
signs:
- cmd: cosign
artifacts: checksum
signature: "${artifact}.sigstore.json"
args:
- "sign-blob"
- "--bundle=${signature}"
- "${artifact}"
- "--yes"
changelog:
use: github
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore:"
- typo
groups:
- title: "Features"
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: "Bug Fixes"
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: "Security"
regexp: '^.*?sec(\([[:word:]]+\))??!?:.+$'
order: 2
- title: "Other Changes"
order: 999
release:
github:
owner: datadog-labs
name: pup
draft: false
prerelease: auto
mode: append
extra_files:
- glob: wasm-out/pup_wasi.wasm
- glob: wasm-out/pup_browser_wasm.tar.gz
name_template: "Release {{ .Version }}"
header: |
## Pup {{ .Version }}
### Installation
```bash
# macOS (Apple Silicon)
curl -L https://github.com/datadog-labs/pup/releases/download/{{ .Tag }}/pup_{{ .Version }}_Darwin_arm64.tar.gz | tar xz
# macOS (Intel)
curl -L https://github.com/datadog-labs/pup/releases/download/{{ .Tag }}/pup_{{ .Version }}_Darwin_x86_64.tar.gz | tar xz
# Linux (x86_64)
curl -L https://github.com/datadog-labs/pup/releases/download/{{ .Tag }}/pup_{{ .Version }}_Linux_x86_64.tar.gz | tar xz
# Linux (arm64)
curl -L https://github.com/datadog-labs/pup/releases/download/{{ .Tag }}/pup_{{ .Version }}_Linux_arm64.tar.gz | tar xz
# Windows (x86_64)
curl -L https://github.com/datadog-labs/pup/releases/download/{{ .Tag }}/pup_{{ .Version }}_Windows_x86_64.zip -o pup.zip
tar -xf pup.zip
```
### WASM
- **WASI** (`pup_wasi.wasm`): Run in Wasmtime or any WASI Preview 2 runtime
- **Browser WASM** (`pup_browser_wasm.tar.gz`): npm-ready package with `PupClient` JS class and TypeScript definitions
### Verifying
```bash
# Verify checksums
sha256sum -c pup_{{ .Version }}_checksums.txt
# Verify signature (requires cosign)
cosign verify-blob \
--bundle pup_{{ .Version }}_checksums.txt.sigstore.json \
pup_{{ .Version }}_checksums.txt
```
footer: |
**Full Changelog**: https://github.com/datadog-labs/pup/compare/{{ .PreviousTag }}...{{ .Tag }}