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
name: Release
# Release workflow is tag-driven: pushing an annotated tag of the form
# `vX.Y.Z` (matching the `Cargo.toml` version bump) fires all three legs
# in parallel — crates.io publish, GitHub Release binaries, and a fresh
# VHS demo. A missing `CARGO_REGISTRY_TOKEN` secret fails `cargo-publish`
# loudly so a partial release is obvious; `GITHUB_TOKEN` is provided
# automatically and is enough for the binary + asset uploads.
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
# -----------------------------------------------------------------
# Publish to crates.io. `--locked` pins the lockfile so the
# published crate matches the binary releases bit-for-bit.
# Fails fast on version collisions or missing token — preferred
# over silently skipping so the maintainer notices.
# -----------------------------------------------------------------
cargo-publish:
name: cargo publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry & target
uses: Swatinem/rust-cache@v2
- name: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --locked
# -----------------------------------------------------------------
# Create the GitHub Release once, from a single job, before the
# binary matrix fans out. `taiki-e/upload-rust-binary-action` does
# not reliably handle three matrix jobs racing to create the same
# release — they each saw "release not found" on v0.3.1. Doing it
# here first removes the race and gives us a place to hang release
# notes off in the future.
# -----------------------------------------------------------------
create-release:
name: create github release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# -----------------------------------------------------------------
# Build release binaries for the supported targets and upload
# each as an archive to the GitHub Release created above. Windows
# is intentionally omitted: kizu is a Unix TUI (crossterm + notify +
# raw tmux workflow).
# -----------------------------------------------------------------
release-binaries:
name: binary / ${{ matrix.target }}
needs: create-release
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo registry & target
uses: Swatinem/rust-cache@v2
- name: Build + upload kizu binary
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: kizu
target: ${{ matrix.target }}
archive: $bin-$tag-$target
token: ${{ secrets.GITHUB_TOKEN }}
checksum: sha256
# -----------------------------------------------------------------
# Re-record the VHS demo against the freshly built release
# binary and attach the resulting GIF to the GitHub Release so
# the release notes have a current demo without waiting for the
# maintainer to run `just demo` locally. The in-repo
# `docs/media/demo.gif` referenced from README is refreshed
# separately via `demo-refresh.yml` to keep the release path
# free of PR-opening side effects.
# -----------------------------------------------------------------
release-vhs:
name: vhs / re-record demo
runs-on: ubuntu-latest
needs: release-binaries
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry & target
uses: Swatinem/rust-cache@v2
- name: Install tmux (vhs tape dependency)
run: sudo apt-get update && sudo apt-get install -y tmux
- name: Install kizu on PATH
run: cargo install --path . --locked
- name: Record demo with vhs
uses: charmbracelet/vhs-action@v2
with:
path: docs/media/demo.tape
- name: Attach demo.gif to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: docs/media/demo.gif