Skip to content

Commit c1cd45b

Browse files
feat: add caching for cargo-release installation (#224)
- Cache cargo registry and tools directory - Check if cargo-release is already installed before installing - Significantly speeds up release workflow (no more 3+ minute installs) - Uses cache key based on Cargo.lock hash
1 parent 70ea6f1 commit c1cd45b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/manual-release.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,26 @@ jobs:
4242
git config --global init.defaultBranch main
4343
git config --global push.autoSetupRemote true
4444
45+
- name: Cache cargo registry and tools
46+
uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.cargo/bin/
50+
~/.cargo/registry/index/
51+
~/.cargo/registry/cache/
52+
~/.cargo/git/db/
53+
key: ${{ runner.os }}-cargo-tools-${{ hashFiles('**/Cargo.lock') }}
54+
restore-keys: |
55+
${{ runner.os }}-cargo-tools-
56+
4557
- name: Install cargo-release
46-
run: cargo install cargo-release
58+
run: |
59+
if ! command -v cargo-release &> /dev/null; then
60+
echo "Installing cargo-release..."
61+
cargo install cargo-release
62+
else
63+
echo "cargo-release already installed"
64+
fi
4765
4866
- name: Dry Run Release
4967
if: inputs.dry_run

0 commit comments

Comments
 (0)