name: Cargo Build & Test on: push: pull_request: env: CARGO_TERM_COLOR: always jobs: build_and_test: name: Build and test - ${{ matrix.toolchain }} runs-on: ubuntu-latest strategy: matrix: toolchain: - stable - beta - nightly steps: - uses: actions/checkout@v4 - name: Get Rust toolchain uses: https://github.com/dtolnay/rust-toolchain@stable with: toolchain: ${{ matrix.toolchain }} - run: cargo build publish: name: Upload runs-on: ubuntu-latest needs: build_and_test steps: - uses: actions/checkout@v4 - name: Get Rust toolchain uses: https://github.com/dtolnay/rust-toolchain@stable with: toolchain: stable - run: cargo publish --release env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}