Skip to content

Commit 069f606

Browse files
committed
ci: release workflow — builds + uploads binary asset on v* tags
Triggers on tag push or manual workflow_dispatch. Builds webview-cli via make, runs smoke tests, verifies binary size budget, extracts release notes from CHANGELOG.md, creates/updates the GitHub Release with the arm64 binary as an asset.
1 parent cc8c8c0 commit 069f606

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to release (e.g. v0.1.1)'
11+
required: true
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
release:
18+
runs-on: macos-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.inputs.tag || github.ref }}
23+
fetch-depth: 0
24+
25+
- name: Resolve tag
26+
id: tag
27+
run: |
28+
if [ -n "${{ github.event.inputs.tag }}" ]; then
29+
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
30+
else
31+
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
32+
fi
33+
34+
- name: Build
35+
run: make build
36+
37+
- name: Verify binary size under 250KB
38+
run: |
39+
SIZE=$(stat -f%z webview-cli)
40+
echo "Binary size: $SIZE bytes"
41+
[ "$SIZE" -le 262144 ] || { echo "Binary exceeds 250KB budget"; exit 1; }
42+
43+
- name: Smoke tests
44+
run: make test
45+
46+
- name: Rename binary
47+
run: cp webview-cli webview-cli-${{ steps.tag.outputs.tag }}-darwin-arm64
48+
49+
- name: Extract release notes
50+
id: notes
51+
run: |
52+
TAG=${{ steps.tag.outputs.tag }}
53+
VERSION=${TAG#v}
54+
awk "/^## \[${VERSION}\]/,/^## \[/" CHANGELOG.md | sed '$d' > /tmp/notes.md
55+
[ -s /tmp/notes.md ] || echo "Release ${TAG}" > /tmp/notes.md
56+
57+
- name: Create/update release with binary asset
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: ${{ steps.tag.outputs.tag }}
61+
name: ${{ steps.tag.outputs.tag }}
62+
body_path: /tmp/notes.md
63+
files: webview-cli-${{ steps.tag.outputs.tag }}-darwin-arm64
64+
fail_on_unmatched_files: true
65+
make_latest: "true"

0 commit comments

Comments
 (0)