name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
upload-assets:
name: ${{ matrix.target }}
if: startsWith(github.ref_name, 'v')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
use-cross: true
- target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
use-cross: true
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
use-cross: true
- target: x86_64-apple-darwin
os: macos-13
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-msvc
os: windows-2022
- target: aarch64-pc-windows-msvc
os: windows-2022
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use-cross == true
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Setup cross-toolchain
if: startsWith(matrix.os, 'ubuntu') && !matrix.use-cross
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: Set Windows RUSTFLAGS
if: contains(matrix.target, 'windows-msvc')
shell: bash
run: echo "RUSTFLAGS=-C target-feature=+crt-static" >> "${GITHUB_ENV}"
- name: Upload release binary
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: py2pyd
target: ${{ matrix.target }}
tar: all
zip: windows
token: ${{ secrets.GITHUB_TOKEN }}
checksum: sha256