basinski 0.1.0

Rescues media files from their own disintegration. Named for William Basinski's Disintegration Loops.
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: [published]
  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 }}