chore: switch to pnpm v8 and consolidate workflow setup (#353)

This commit is contained in:
Pascal Jufer 2023-09-24 17:14:43 +02:00 committed by GitHub
parent 59fcd073e3
commit 523a25b664
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 4480 additions and 1378 deletions

36
.github/actions/setup/action.yml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Setup
description: Setup the environment for the project
inputs:
node-registry:
description: Node.js package registry to set up for auth
required: false
runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: ${{ inputs.node-registry }}
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Get pnpm store directory
id: pnpm-cache-dir
shell: bash
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install

View file

@ -15,30 +15,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: pnpm run build

View file

@ -16,31 +16,10 @@ jobs:
# We have to checkout main or PNPM fails. Tag should be on main anyway.
ref: main
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
node-registry: https://registry.npmjs.org
- name: Generate changelog file
uses: rhysd/changelog-from-release/action@v3

View file

@ -20,30 +20,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Setup
uses: ./.github/actions/setup
- name: Build packages
run: pnpm run dist

View file

@ -51,5 +51,6 @@
"overrides": {
"@types/react": "^17.0.29"
}
}
}
},
"packageManager": "pnpm@8.7.6"
}

File diff suppressed because it is too large Load diff