Skip to content

Commit 1c494da

Browse files
fix(ci): update and migrate github actions
1 parent 99e6915 commit 1c494da

3 files changed

Lines changed: 21 additions & 46 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: test
22

33
on: [pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
test:
710
strategy:
@@ -14,11 +17,11 @@ jobs:
1417
runs-on: ${{ matrix.platform.os }}
1518

1619
steps:
17-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v7
21+
1822
- name: install stable
19-
uses: actions-rs/toolchain@v1
23+
uses: dtolnay/rust-toolchain@stable
2024
with:
21-
toolchain: stable
2225
target: ${{ matrix.platform.target }}
2326

2427
- name: install webkit2gtk (ubuntu only)
@@ -27,47 +30,10 @@ jobs:
2730
sudo apt-get update
2831
sudo apt-get install -y webkit2gtk-4.1
2932
30-
- name: Get current date
31-
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
32-
33-
- name: Cache cargo registry
34-
uses: actions/cache@v2.1.4
35-
with:
36-
path: ~/.cargo/registry
37-
# Add date to the cache to keep it up to date
38-
key: ${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
39-
# Restore from outdated cache for speed
40-
restore-keys: |
41-
${{ matrix.platform }}-stable-cargo-registry-${{ hashFiles('Cargo.toml') }}
42-
${{ matrix.platform }}-stable-cargo-registry-
43-
44-
- name: Cache cargo index
45-
uses: actions/cache@v2.1.4
46-
with:
47-
path: ~/.cargo/git
48-
# Add date to the cache to keep it up to date
49-
key: ${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
50-
# Restore from outdated cache for speed
51-
restore-keys: |
52-
${{ matrix.platform }}-stable-cargo-index-${{ hashFiles('Cargo.toml') }}
53-
${{ matrix.platform }}-stable-cargo-index-
54-
55-
- name: Cache cargo target
56-
uses: actions/cache@v2
57-
with:
58-
path: target
59-
# Add date to the cache to keep it up to date
60-
key: ${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}-${{ env.CURRENT_DATE }}
61-
# Restore from outdated cache for speed
62-
restore-keys: |
63-
${{ matrix.platform }}-stable-cargo-core-${{ hashFiles('Cargo.toml') }}
64-
${{ matrix.platform }}-stable-cargo-core-
33+
- uses: Swatinem/rust-cache@v2
6534

6635
- name: Cargo fmt
67-
uses: actions-rs/cargo@v1
68-
with:
69-
command: fmt
70-
args: --all -- --check
36+
run: cargo fmt --all -- --check
7137

7238
- name: build javascriptcore
7339
run: cargo build --target ${{ matrix.platform.target }}

‎.github/workflows/covector-status.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: covector status
22
on: [pull_request]
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
covector:
69
runs-on: ubuntu-latest
710

811
steps:
9-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v7
1013
with:
1114
fetch-depth: 0
1215
- name: covector status

‎.github/workflows/covector-version-or-publish.yml‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
branches:
66
- crate
77

8+
permissions:
9+
# required to create the GitHub Release
10+
contents: write
11+
# required for creating the Version Packages Release
12+
pull-requests: write
13+
814
jobs:
915
version-or-publish:
1016
runs-on: ubuntu-latest
@@ -15,7 +21,7 @@ jobs:
1521
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
1622

1723
steps:
18-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v7
1925
with:
2026
fetch-depth: 0
2127
- name: cargo login
@@ -28,15 +34,14 @@ jobs:
2834
uses: jbolda/covector/packages/action@covector-v0
2935
id: covector
3036
env:
31-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3237
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
3338
with:
3439
token: ${{ secrets.GITHUB_TOKEN }}
3540
command: 'version-or-publish'
3641
createRelease: true
3742
- name: Create Pull Request With Versions Bumped
3843
id: cpr
39-
uses: tauri-apps/create-pull-request@v3
44+
uses: peter-evans/create-pull-request@v8.1.1
4045
if: steps.covector.outputs.commandRan == 'version'
4146
with:
4247
token: ${{ secrets.GITHUB_TOKEN }}
@@ -45,3 +50,4 @@ jobs:
4550
labels: "version updates"
4651
branch: "release"
4752
body: ${{ steps.covector.outputs.change }}
53+
sign-commits: true

0 commit comments

Comments
 (0)