name: Release binary
on:
release:
types: [ "published" ]
env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
jobs:
upload-binary:
name: ${{ matrix.target }}
if: github.repository_owner == 'bearbearean'
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: startsWith(matrix.os, 'ubuntu') && !contains(matrix.target, '-musl')
- uses: taiki-e/install-action@v2
with:
tool: cross
if: contains(matrix.target, '-musl')
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: nbsp
target: ${{ matrix.target }}
token: ${{ secrets.GITHUB_TOKEN }}