From c3c0d786da5a2e49c55f742c7d78b46fafe692f9 Mon Sep 17 00:00:00 2001 From: broccolingual Date: Mon, 9 Mar 2026 12:57:25 +0000 Subject: [PATCH 1/3] fix: update release and rust workflows to use actions/checkout@v4 and improve version bumping process --- .github/workflows/release.yml | 29 +++++++++++++++++++++-------- .github/workflows/rust.yml | 4 +++- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e2718b..cb4f0f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ name: Cargo Release on: - workflow_dispatch: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: release: @@ -11,16 +13,27 @@ jobs: contents: write id-token: write steps: - - uses: actions/checkout@v5 - - run: | - git config --local user.name "GitHub Actions" - git config --local user.email "actions@github.com" + - uses: actions/checkout@v4 + with: + ref: main - - name: Install cargo release - run: cargo install cargo-release + - name: Extract version from tag + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV" + + - name: Update Cargo.toml version + run: sed -i "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml + + - name: Commit version bump + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add Cargo.toml + git commit -m "chore: bump version to $VERSION [skip ci]" + git push origin main - uses: rust-lang/crates-io-auth-action@v1 id: auth - - run: cargo release patch --execute --no-confirm + - name: Publish to crates.io + run: cargo publish env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c3dd78b..3584523 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v4 - name: Cache uses: actions/cache@v4 @@ -25,6 +25,8 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- - name: Build run: cargo build --verbose From 37be3a2a59e8c65042ba8393c03d15dd7a07b159 Mon Sep 17 00:00:00 2001 From: broccolingual Date: Mon, 9 Mar 2026 13:06:30 +0000 Subject: [PATCH 2/3] fix: clippy error --- examples/tetris/src/field.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/tetris/src/field.rs b/examples/tetris/src/field.rs index 19e60e2..1c81318 100644 --- a/examples/tetris/src/field.rs +++ b/examples/tetris/src/field.rs @@ -67,6 +67,7 @@ impl FieldExt for Field { false } + #[allow(clippy::needless_range_loop)] fn is_gameover(&self) -> bool { for x in 0..FIELD_WIDTH { if self[FIELD_MARGIN][x].is_some() { From 920e51d441a8a6606ed2210272031ec88a5b8883 Mon Sep 17 00:00:00 2001 From: broccolingual Date: Mon, 9 Mar 2026 13:13:23 +0000 Subject: [PATCH 3/3] fix: update tag pattern in release workflow and remove [skip ci] from commit message --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb4f0f0..78ee61a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Cargo Release on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v*.*.*' jobs: release: @@ -28,11 +28,12 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add Cargo.toml - git commit -m "chore: bump version to $VERSION [skip ci]" + git commit -m "chore: bump version to $VERSION" git push origin main - uses: rust-lang/crates-io-auth-action@v1 id: auth + - name: Publish to crates.io run: cargo publish env: