This repository was archived by the owner on Sep 7, 2025. It is now read-only.
build(deps): bump the cargo group with 8 updates #199
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: Rust CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*.*.*' # Trigger on version tags like v1.2.3 | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write # Needed for creating releases | |
| packages: write | |
| jobs: | |
| rust-macos-arm64: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v5 | |
| - name: Install Rust toolchain (Nightly for fmt) | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| components: rustfmt, clippy | |
| override: true | |
| - name: Set Stable as Default (MSRV 1.86.0) | |
| if: success() | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: 1.86.0 | |
| components: clippy | |
| - name: Cache cargo registry & build artifacts | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-stable-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-stable- | |
| ${{ runner.os }}-cargo- | |
| - name: Verify runner architecture | |
| run: 'echo "UNAME reports: $(uname -m)"' | |
| - name: Check formatting | |
| run: cargo +nightly fmt --all -- --check | |
| - name: Run linters | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| - name: Build release binary | |
| run: cargo build --release --workspace --verbose | |
| - name: Run tests | |
| run: cargo test --workspace --verbose | |
| - name: Find release binary path | |
| id: find-binary | |
| run: | | |
| binary_name=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].targets[] | select(.kind[] == "bin") | .name') | |
| echo "binary_path=target/release/${binary_name}" >> "$GITHUB_OUTPUT" | |
| - name: Upload compiled binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sps-macos-arm64 | |
| path: ${{ steps.find-binary.outputs.binary_path }} | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ${{ steps.find-binary.outputs.binary_path }} | |
| body: | | |
| Automated release for ${{ github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install cargo-workspaces | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: cargo install cargo-workspaces | |
| - name: Verify version tag matches crate version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| version=${GITHUB_REF#refs/tags/v} | |
| metadata=$(cargo metadata --no-deps --format-version 1) | |
| crate_version=$(echo "$metadata" | jq -r '.packages[0].version') | |
| if [[ "$version" != "$crate_version" ]]; then | |
| echo "Tag version $version does not match crate version $crate_version" | |
| exit 1 | |
| fi | |
| - name: Publish crates to crates.io | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: cargo workspaces publish --yes --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Create Conventional Commit Message | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| version=${GITHUB_REF#refs/tags/} | |
| echo "feat(release): Release ${version}" > conventional_commit_message.txt |