ci: setup pnpm from corepack config to avoid flaky lockfile (#1258)

This commit is contained in:
LongYinan 2023-03-02 18:21:55 +08:00 committed by GitHub
parent a4892e5992
commit 6138fefa9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 47 deletions

View File

@ -23,13 +23,11 @@ jobs:
environment: development environment: development
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 18.x
registry-url: https://npm.pkg.github.com registry-url: https://npm.pkg.github.com
@ -98,7 +96,7 @@ jobs:
steps: steps:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3

View File

@ -22,15 +22,14 @@ jobs:
environment: development environment: development
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 18.x
cache: 'pnpm'
- name: Restore cache - name: Restore cache
uses: actions/cache@v3 uses: actions/cache@v3
@ -73,8 +72,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with:
version: 'latest'
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 18.x
@ -131,13 +129,11 @@ jobs:
environment: production environment: production
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 18.x
registry-url: https://npm.pkg.github.com registry-url: https://npm.pkg.github.com
@ -199,7 +195,7 @@ jobs:
steps: steps:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3

View File

@ -20,13 +20,11 @@ jobs:
pull-requests: write pull-requests: write
contents: write contents: write
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 18.x
registry-url: https://npm.pkg.github.com registry-url: https://npm.pkg.github.com

View File

@ -34,7 +34,7 @@ jobs:
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }} RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Query version number - name: Query version number
id: get_version id: get_version
shell: bash shell: bash
@ -72,29 +72,16 @@ jobs:
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 18.x node-version: 18.x
cache: 'pnpm'
- name: install Rust stable - name: install Rust stable
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Get npm cache directory
uses: actions/cache@v3
id: cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Get rust cache - name: Get rust cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
id: rust-cache id: rust-cache

View File

@ -35,8 +35,6 @@ jobs:
- name: Use pnpm - name: Use pnpm
uses: pnpm/action-setup@v2 uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
# https://github.com/actions/setup-node # https://github.com/actions/setup-node

View File

@ -19,10 +19,8 @@ jobs:
environment: development environment: development
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v2
@ -82,7 +80,7 @@ jobs:
steps: steps:
- name: Check out the repo - name: Check out the repo
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3

View File

@ -24,8 +24,6 @@ jobs:
- name: Use pnpm - name: Use pnpm
uses: pnpm/action-setup@v2 uses: pnpm/action-setup@v2
with:
version: 7
- name: Use Node.js 18 - name: Use Node.js 18
# https://github.com/actions/setup-node # https://github.com/actions/setup-node

View File

@ -65,5 +65,6 @@
"patchedDependencies": { "patchedDependencies": {
"@tauri-apps/api@1.2.0": "patches/@tauri-apps__api@1.2.0.patch" "@tauri-apps/api@1.2.0": "patches/@tauri-apps__api@1.2.0.patch"
} }
} },
"packageManager": "pnpm@7.28.0"
} }