From 1c494da0d1d830bc002d5c12d2044f14c7d18bee Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 14 Sep 2026 12:32:23 +0800 Subject: [PATCH 1/2] fix(ci): update and migrate github actions --- .github/workflows/build.yml | 50 +++---------------- .github/workflows/covector-status.yml | 5 +- .../workflows/covector-version-or-publish.yml | 12 +++-- 3 files changed, 21 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c37e63..a08eb73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: test on: [pull_request] +permissions: + contents: read + jobs: test: strategy: @@ -14,11 +17,11 @@ jobs: runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 + - name: install stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable target: ${{ matrix.platform.target }} - name: install webkit2gtk (ubuntu only) @@ -27,47 +30,10 @@ jobs: sudo apt-get update sudo apt-get install -y webkit2gtk-4.1 - - name: Get current date - run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - - name: Cache cargo registry - uses: actions/cache@v2.1.4 - with: - path: ~/.cargo/registry - # Add date to the cache to keep it up to date - key: ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }} - # Restore from outdated cache for speed - restore-keys: | - ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }} - ${{ matrix.platform }}-stable-cargo-registry- - - - name: Cache cargo index - uses: actions/cache@v2.1.4 - with: - path: ~/.cargo/git - # Add date to the cache to keep it up to date - key: ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }} - # Restore from outdated cache for speed - restore-keys: | - ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }} - ${{ matrix.platform }}-stable-cargo-index- - - - name: Cache cargo target - uses: actions/cache@v2 - with: - path: target - # Add date to the cache to keep it up to date - key: ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }} - # Restore from outdated cache for speed - restore-keys: | - ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }} - ${{ matrix.platform }}-stable-cargo-core- + - uses: Swatinem/rust-cache@v2 - name: Cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check - name: build javascriptcore run: cargo build --target ${{ matrix.platform.target }} diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml index 72f9bee..10d5370 100644 --- a/.github/workflows/covector-status.yml +++ b/.github/workflows/covector-status.yml @@ -1,12 +1,15 @@ name: covector status on: [pull_request] +permissions: + contents: read + jobs: covector: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: covector status diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 2660ed3..3244bca 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -5,6 +5,12 @@ on: branches: - crate +permissions: + # required to create the GitHub Release + contents: write + # required for creating the Version Packages Release + pull-requests: write + jobs: version-or-publish: runs-on: ubuntu-latest @@ -15,7 +21,7 @@ jobs: successfulPublish: ${{ steps.covector.outputs.successfulPublish }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v7 with: fetch-depth: 0 - name: cargo login @@ -28,7 +34,6 @@ jobs: uses: jbolda/covector/packages/action@covector-v0 id: covector env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }} with: token: ${{ secrets.GITHUB_TOKEN }} @@ -36,7 +41,7 @@ jobs: createRelease: true - name: Create Pull Request With Versions Bumped id: cpr - uses: tauri-apps/create-pull-request@v3 + uses: peter-evans/create-pull-request@v8.1.1 if: steps.covector.outputs.commandRan == 'version' with: token: ${{ secrets.GITHUB_TOKEN }} @@ -45,3 +50,4 @@ jobs: labels: "version updates" branch: "release" body: ${{ steps.covector.outputs.change }} + sign-commits: true From ba5ea28ba9dd9f3d3b37cd104d8c6d827d98130a Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 14 Sep 2026 17:37:08 +0800 Subject: [PATCH 2/2] Run CI on push --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a08eb73..37b6dbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,10 @@ name: test -on: [pull_request] +on: + push: + branches: + - crate + pull_request: permissions: contents: read