mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
d7556011df
Update package manager configuration to pnpm 11.22.0 and Node.js requirement to Node 26 across Dockerfile, GitHub Actions workflows, root package.json, and workspace configurations. Upgrade dependencies, update GitHub Action versions, and remove deprecated scorecard workflow.
70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
name: Setup Node and pnpm
|
|
description: Set up Node.js, activate pnpm via Corepack, and optionally install dependencies.
|
|
|
|
inputs:
|
|
node-version:
|
|
description: Node.js version to install.
|
|
required: false
|
|
default: "26"
|
|
pnpm-version:
|
|
description: pnpm version to activate via Corepack.
|
|
required: false
|
|
default: "11"
|
|
install:
|
|
description: Whether to run pnpm install.
|
|
required: false
|
|
default: "true"
|
|
cache:
|
|
description: Whether to enable pnpm dependency caching.
|
|
required: false
|
|
default: "true"
|
|
cache-dependency-path:
|
|
description: Path(s) used to generate the cache key.
|
|
required: false
|
|
default: "pnpm-lock.yaml"
|
|
prefetch:
|
|
description: Whether to run pnpm fetch before installation.
|
|
required: false
|
|
default: "false"
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
|
|
- name: Enable Corepack and activate pnpm
|
|
shell: bash
|
|
run: |
|
|
corepack enable
|
|
corepack prepare "pnpm@${{ inputs.pnpm-version }}" --activate
|
|
|
|
# pnpm must be on PATH before its store path can be resolved for cache keying,
|
|
# so caching is configured in a separate step after Corepack activates pnpm.
|
|
- name: Get pnpm store directory
|
|
if: ${{ inputs.cache == 'true' }}
|
|
id: pnpm-store
|
|
shell: bash
|
|
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Cache pnpm store
|
|
if: ${{ inputs.cache == 'true' }}
|
|
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ steps.pnpm-store.outputs.path }}
|
|
key: ${{ runner.os }}-pnpm-${{ inputs.pnpm-version }}-store-${{ hashFiles(inputs.cache-dependency-path) }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-${{ inputs.pnpm-version }}-store-
|
|
|
|
- name: Prefetch dependencies
|
|
if: ${{ inputs.prefetch == 'true' }}
|
|
shell: bash
|
|
run: pnpm fetch --frozen-lockfile
|
|
|
|
- name: Install dependencies
|
|
if: ${{ inputs.install == 'true' }}
|
|
shell: bash
|
|
run: pnpm install --frozen-lockfile
|