cargo format #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish Rust Crate | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
env: | ||
RUST_TOOLCHAIN: stable | ||
TOOLCHAIN_PROFILE: minimal | ||
jobs: | ||
build: | ||
name: Build the crate | ||
runs-on: ubuntu-latest | ||
uses: build.yml | ||
publish: | ||
name: Publish to crates.io | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Publish to crates.io | ||
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} |