mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: Setup Corepack
|
|
description: Sets up and caches the Corepack tools to speed up the build.
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Enable Corepack
|
|
shell: bash
|
|
run: corepack enable
|
|
|
|
- id: cache-key
|
|
name: Generate key for tools cache
|
|
shell: bash
|
|
working-directory: js
|
|
run: echo "key=corepack-tools-$(jq -r '.packageManager' package.json)" >> $GITHUB_OUTPUT
|
|
|
|
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
|
id: cache
|
|
name: Cache Corepack tools
|
|
with:
|
|
# See: https://github.com/nodejs/corepack?tab=readme-ov-file#offline-workflow
|
|
path: ./js/corepack.tgz
|
|
key: ${{ runner.os }}-${{ steps.cache-key.outputs.key }}
|
|
|
|
- name: Install Corepack tools from cache
|
|
if: steps.cache.outputs.cache-hit == 'true'
|
|
shell: bash
|
|
working-directory: js
|
|
run: corepack install -g --cache-only ./corepack.tgz
|
|
|
|
- name: Package Corepack tools
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
working-directory: js
|
|
run: corepack pack
|
|
|