forked from Dicklesworthstone/coding_agent_session_search
-
Notifications
You must be signed in to change notification settings - Fork 0
315 lines (276 loc) · 10.6 KB
/
Copy pathrelease.yml
File metadata and controls
315 lines (276 loc) · 10.6 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# .github/workflows/release.yml
# Release workflow: build cross-platform binaries with SHA256 checksums
# and notify package managers (Homebrew, Scoop)
name: Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
# Linux x86_64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: cass
asset_name: cass-linux-amd64
# Linux ARM64
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
artifact_name: cass
asset_name: cass-linux-arm64
# macOS Intel - DISABLED: ort-sys doesn't provide prebuilt ONNX Runtime binaries
# for x86_64-apple-darwin. Intel Mac users can build from source.
# - os: macos-15
# target: x86_64-apple-darwin
# artifact_name: cass
# asset_name: cass-darwin-amd64
# macOS Apple Silicon
- os: macos-14
target: aarch64-apple-darwin
artifact_name: cass
asset_name: cass-darwin-arm64
# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: cass.exe
asset_name: cass-windows-amd64
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@881ba7bf39a41cda34ac9e123fb41b44ed08232f # nightly
with:
targets: ${{ matrix.target }}
- name: Cache cargo
uses: Swatinem/rust-cache@ad397744b0d591a723ab90405b7247fac0e6b8db # v2
- name: Install OpenSSL (macOS)
if: runner.os == 'macOS'
run: |
brew install openssl@3
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
- name: Build release
run: cargo build --release --target ${{ matrix.target }}
- name: Create tarball with checksum (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p dist
TARBALL="${{ matrix.asset_name }}.tar.gz"
cd target/${{ matrix.target }}/release
tar -czf "../../../dist/$TARBALL" ${{ matrix.artifact_name }}
cd ../../../dist
shasum -a 256 "$TARBALL" > "$TARBALL.sha256"
echo "### ${{ matrix.target }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat "$TARBALL.sha256" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Create zip with checksum (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist | Out-Null
$zipName = "${{ matrix.asset_name }}.zip"
Compress-Archive -Path "target/${{ matrix.target }}/release/${{ matrix.artifact_name }}" -DestinationPath "dist/$zipName"
cd dist
$hash = (Get-FileHash -Algorithm SHA256 $zipName).Hash.ToLower()
"$hash $zipName" | Out-File -Encoding ASCII "$zipName.sha256"
Write-Output "### ${{ matrix.target }}" | Out-File -Append -Encoding UTF8 $env:GITHUB_STEP_SUMMARY
Write-Output '```' | Out-File -Append -Encoding UTF8 $env:GITHUB_STEP_SUMMARY
Get-Content "$zipName.sha256" | Out-File -Append -Encoding UTF8 $env:GITHUB_STEP_SUMMARY
Write-Output '```' | Out-File -Append -Encoding UTF8 $env:GITHUB_STEP_SUMMARY
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ matrix.asset_name }}
path: dist/*
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
attestations: write
timeout-minutes: 20
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Download all artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: artifacts
merge-multiple: true
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: List artifacts
run: |
echo "## Release Artifacts" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
ls -la artifacts/ >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## SHA256 Checksums" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat artifacts/*.sha256 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Create combined checksums file
run: |
cd artifacts
cat *.sha256 > SHA256SUMS.txt
- name: Copy install scripts
run: |
cp install.sh artifacts/
cp install.ps1 artifacts/
- name: Generate SBOM (SPDX)
uses: anchore/sbom-action@62ad5284b8ced813296287a0b63906cb364b73ee # v0
with:
path: artifacts
format: spdx-json
output-file: artifacts/sbom.spdx.json
- name: Attest build provenance
uses: actions/attest-build-provenance@96b4a1ef7235a096b17240c259729fdd70c83d45 # v2
with:
subject-path: artifacts/*
- name: Install Cosign
uses: sigstore/cosign-installer@f713795cb21599bc4e5c4b58cbad1da852d7eeb9 # v3
- name: Sign release artifacts (keyless)
env:
COSIGN_EXPERIMENTAL: "1"
run: |
for asset in artifacts/*.tar.gz artifacts/*.zip; do
[ -f "$asset" ] || continue
cosign sign-blob --yes \
--output-signature "${asset}.sig" \
--output-certificate "${asset}.crt" \
"$asset"
done
- name: Create GitHub Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
with:
name: v${{ steps.version.outputs.version }}
files: artifacts/*
generate_release_notes: true
body: |
## Installation
### Quick Install (recommended)
```bash
# Linux/macOS
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/coding_agent_session_search/main/install.sh" | bash -s -- --easy-mode --verify
# Windows (PowerShell)
irm https://raw.githubusercontent.com/Dicklesworthstone/coding_agent_session_search/main/install.ps1 | iex
```
### Package Managers
```bash
# Homebrew
brew install dicklesworthstone/tap/cass
# Scoop
scoop bucket add dicklesworthstone https://github.com/Dicklesworthstone/scoop-bucket
scoop install dicklesworthstone/cass
```
### Verify Downloads
All binaries include SHA256 checksums. Download `SHA256SUMS.txt` and verify:
```bash
sha256sum -c SHA256SUMS.txt
```
outputs:
version: ${{ steps.version.outputs.version }}
publish-crates:
name: Publish to crates.io
needs: release
runs-on: ubuntu-latest
timeout-minutes: 15
if: ${{ !contains(github.ref, '-') }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@881ba7bf39a41cda34ac9e123fb41b44ed08232f # nightly
- name: Publish to crates.io
if: ${{ env.CARGO_REGISTRY_TOKEN != '' }}
run: cargo publish --all-features --locked
# ==========================================================================
# Notify Package Managers to Update
# ==========================================================================
notify-homebrew-tap:
name: Notify Homebrew Tap
runs-on: ubuntu-latest
needs: release
timeout-minutes: 5
# Don't fail the release if notification fails (token may not be configured)
continue-on-error: true
env:
HAS_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}
steps:
- name: Check for token
id: check
run: |
if [[ "${{ env.HAS_TOKEN }}" != "true" ]]; then
echo "::warning::HOMEBREW_TAP_TOKEN not configured, skipping notification"
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Trigger formula update
if: steps.check.outputs.skip != 'true'
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
with:
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
repository: Dicklesworthstone/homebrew-tap
event-type: formula-update
client-payload: |
{
"tool": "cass",
"version": "${{ needs.release.outputs.version }}"
}
- name: Log dispatch
if: steps.check.outputs.skip != 'true'
run: |
echo "Dispatched formula-update event to homebrew-tap"
echo " Tool: cass"
echo " Version: ${{ needs.release.outputs.version }}"
notify-scoop-bucket:
name: Notify Scoop Bucket
runs-on: ubuntu-latest
needs: release
timeout-minutes: 5
# Don't fail the release if notification fails (token may not be configured)
continue-on-error: true
env:
HAS_TOKEN: ${{ secrets.SCOOP_BUCKET_TOKEN != '' }}
steps:
- name: Check for token
id: check
run: |
if [[ "${{ env.HAS_TOKEN }}" != "true" ]]; then
echo "::warning::SCOOP_BUCKET_TOKEN not configured, skipping notification"
echo "skip=true" >> $GITHUB_OUTPUT
fi
- name: Trigger manifest update
if: steps.check.outputs.skip != 'true'
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
with:
token: ${{ secrets.SCOOP_BUCKET_TOKEN }}
repository: Dicklesworthstone/scoop-bucket
event-type: manifest-update
client-payload: |
{
"tool": "cass",
"version": "${{ needs.release.outputs.version }}"
}
- name: Log dispatch
if: steps.check.outputs.skip != 'true'
run: |
echo "Dispatched manifest-update event to scoop-bucket"
echo " Tool: cass"
echo " Version: ${{ needs.release.outputs.version }}"