From e0bc525b61d465af7f6ad25a244cefb07d1bbfc0 Mon Sep 17 00:00:00 2001 From: Yoo1tic <137816438+Yoo1tic@users.noreply.github.com> Date: Mon, 11 Aug 2025 01:14:07 +0800 Subject: [PATCH] refactor: simplify Rust toolchain installation and remove redundant steps in CI workflows --- .github/workflows/dev-build.yml | 69 ++++++++++++--------------------- 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index f19b526..a0250d3 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -27,26 +27,19 @@ jobs: artifact_name: gemini-keychecker release_name: gemini-keychecker-linux-aarch64 steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 with: + toolchain: stable + profile: minimal targets: ${{ matrix.target_triple }} + override: true - - name: Cache cargo dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + - uses: Swatinem/rust-cache@v2 - - name: Build project + - name: Build for ${{ matrix.target }} run: cargo build --release --target ${{ matrix.target_triple }} - name: Package artifact @@ -71,26 +64,19 @@ jobs: artifact_name: gemini-keychecker.exe release_name: gemini-keychecker-windows-x86_64 steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 with: + toolchain: stable + profile: minimal targets: ${{ matrix.target_triple }} + override: true - - name: Cache cargo dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + - uses: Swatinem/rust-cache@v2 - - name: Build project + - name: Build for ${{ matrix.target }} run: cargo build --release --target ${{ matrix.target_triple }} - name: Package artifact @@ -120,26 +106,19 @@ jobs: artifact_name: gemini-keychecker release_name: gemini-keychecker-macos-aarch64 steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@stable + - name: Install Rust stable toolchain + uses: actions-rs/toolchain@v1 with: + toolchain: stable + profile: minimal targets: ${{ matrix.target_triple }} + override: true - - name: Cache cargo dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + - uses: Swatinem/rust-cache@v2 - - name: Build project + - name: Build for ${{ matrix.target }} run: cargo build --release --target ${{ matrix.target_triple }} - name: Package artifact