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
name: Release
# Builds the binary for every target and attaches archives + checksums to the
# GitHub release. taiki-e's default asset name is `$bin-$target.<ext>` (e.g.
# basinski-aarch64-apple-darwin.tar.gz), which is exactly the convention that
# universal installers like `ubi` and `mise` match against.
#
# Primary trigger: the release published by release-plz (requires RELEASE_PLZ_TOKEN
# so the event fires). workflow_dispatch is a manual fallback to (re)build a tag.
on:
release:
types:
workflow_dispatch:
inputs:
tag:
description: "Existing tag to build and upload to (e.g. v0.1.0)"
required: true
permissions:
contents: read
jobs:
upload:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
permissions:
contents: write # upload assets to the release
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: basinski
target: ${{ matrix.target }}
checksum: sha256
# On release events this is empty and the action uses github.ref;
# on workflow_dispatch it targets the chosen tag.
ref: ${{ github.event.inputs.tag && format('refs/tags/{0}', github.event.inputs.tag) || '' }}
token: ${{ secrets.GITHUB_TOKEN }}