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
name: Release artifacts
# Triggered by release-plz-release.yml after release-plz creates a
# *draft* release for a new tag. We build the binaries into the draft,
# upload install.sh, then promote `--draft=false` so the release goes
# live atomically — /releases/latest never points at a tag whose
# binaries are still building.
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to build (e.g. v0.0.3). The tag must already exist."
required: true
permissions:
contents: write
jobs:
build:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-apple-darwin
os: macos-15-intel
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: release-${{ matrix.target }}
- name: Build and upload
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: wk
target: ${{ matrix.target }}
archive: $bin-$tag-$target
tar: unix
checksum: sha256
# Turn on the crash-reporting SDK in shipped binaries. Source
# builds via `cargo build` continue to compile without it and
# are network-silent by default. See
# docs/01-crash-and-error-reporting.md.
features: telemetry
ref: refs/tags/${{ inputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
env:
# Read at compile time by `option_env!("WK_SENTRY_DSN")` in
# src/telemetry.rs. If unset (e.g. forks), the SDK initializes
# but stays inert. The DSN is not secret per Sentry's docs,
# but we keep it out of source so spam events from random
# `cargo build`s don't burn the project's quota.
WK_SENTRY_DSN: ${{ secrets.WK_SENTRY_DSN }}
installer:
name: Upload install.sh
# Intentionally not `needs: build` — install.sh has no build artefacts
# to wait on, so it uploads in parallel with the matrix.
runs-on:
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
- name: Upload install.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${{ inputs.tag }}"
gh release upload "$tag" install.sh --clobber
publish:
name: Promote draft → published
needs:
runs-on:
steps:
- name: Promote release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
tag="${{ inputs.tag }}"
# --latest pins this as the "latest" release explicitly so
# GitHub's auto-detection doesn't pick a different non-draft
# release in the rare case where releases land out of order.
gh release edit "$tag" --draft=false --latest --repo "$REPO"