v0.3.0 #2
Workflow file for this run
This file contains hidden or 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: Publish Crate | |
| # on: | |
| # push: | |
| # tags: | |
| # - 'v[0-9]+.[0-9]+.[0-9]+*' # Trigger on tags like v0.1.0, v1.0.0-alpha | |
| on: | |
| release: | |
| types: [published] # Trigger on release publication | |
| jobs: | |
| build: | |
| name: Test, Lint, and Build Rust Project | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: lint | |
| run: cargo clippy --fix | |
| - name: format | |
| run: cargo fmt --all | |
| - name: Build | |
| run: cargo build | |
| - name: Run tests | |
| run: cargo test | |
| publish: | |
| name: Build and publish crate | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Build in release mode | |
| run: cargo build --release --all-features | |
| - name: Publish to crates.io | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }} | |
| run: cargo publish |