name: rust-wheel-publish
on:
push:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
name: 'publish'
steps:
- uses: actions/checkout@v4
- name: Install musl tools
run: |
sudo apt-get update
sudo apt-get install -y musl-tools musl-dev
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
targets: x86_64-unknown-linux-musl
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Login to crates.io
run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish to crates.io
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}