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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
# release-plz creates the GitHub Release and its changelog body when it pushes
# the tag. This workflow only attaches build artifacts to that existing
# release — it never recreates or rewrites the release notes.
jobs:
upload-assets:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux targets cross-compile C dependencies (aws-lc-rs) with
# cargo-zigbuild, which bundles its own cross toolchain — no system
# OpenSSL or aarch64 GCC is needed on the runner.
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
build-tool: cargo-zigbuild
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
build-tool: cargo-zigbuild
- target: x86_64-apple-darwin
os: macos-latest
build-tool: cargo
- target: aarch64-apple-darwin
os: macos-latest
build-tool: cargo
- target: x86_64-pc-windows-msvc
os: windows-latest
build-tool: cargo
steps:
- uses: actions/checkout@v7 # checkout repository
# taiki-e/upload-rust-binary-action builds with --release, strips the
# binary, archives (.tar.gz on unix / .zip on windows), generates the
# checksum and uploads everything to the existing release for this tag.
# build-tool is chosen per target: cargo-zigbuild for Linux cross builds,
# cargo for native macOS/Windows targets.
- name: Build and upload binary
uses: taiki-e/upload-rust-binary-action@f0d45ae91ee7b8ee928de7a9d04d893a08bcbec6 # v1
with:
bin: twc-rs
features: tui
target: ${{ matrix.target }}
build-tool: ${{ matrix.build-tool }}
archive: $bin-$tag-$target
checksum: sha256
token: ${{ secrets.GITHUB_TOKEN }}
deb:
name: Build .deb package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7 # checkout repository
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable # stable toolchain
- name: Install cargo-deb
uses: taiki-e/install-action@v2 # pinned to major tag
with:
tool: cargo-deb
- name: Build .deb
run: cargo deb -- --features tui
# Attach the .deb to the existing release without touching its notes.
- name: Upload .deb to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${GITHUB_REF_NAME}" target/debian/*.deb --clobber