mirror of
https://github.com/actions/setup-node.git
synced 2026-03-14 07:14:33 +00:00
Resolve merge conflicts
This commit is contained in:
commit
43959a440a
20
.github/workflows/e2e-cache.yml
vendored
20
.github/workflows/e2e-cache.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Clean global cache
|
- name: Clean global cache
|
||||||
run: npm cache clean --force
|
run: npm cache clean --force
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
@ -44,7 +44,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
@ -77,7 +77,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Yarn version
|
- name: Yarn version
|
||||||
run: yarn --version
|
run: yarn --version
|
||||||
- name: Generate yarn file
|
- name: Generate yarn file
|
||||||
@ -109,7 +109,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Update yarn
|
- name: Update yarn
|
||||||
run: yarn set version 3.6.4
|
run: yarn set version 3.6.4
|
||||||
- name: Yarn version
|
- name: Yarn version
|
||||||
@ -143,7 +143,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: prepare sub-projects
|
- name: prepare sub-projects
|
||||||
run: __tests__/prepare-yarn-subprojects.sh yarn1
|
run: __tests__/prepare-yarn-subprojects.sh yarn1
|
||||||
@ -170,7 +170,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: prepare sub-projects
|
- name: prepare sub-projects
|
||||||
run: __tests__/prepare-yarn-subprojects.sh keepcache keepcache
|
run: __tests__/prepare-yarn-subprojects.sh keepcache keepcache
|
||||||
@ -197,7 +197,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: prepare sub-projects
|
- name: prepare sub-projects
|
||||||
run: __tests__/prepare-yarn-subprojects.sh global
|
run: __tests__/prepare-yarn-subprojects.sh global
|
||||||
@ -224,7 +224,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: prepare sub-projects
|
- name: prepare sub-projects
|
||||||
run: /bin/bash __tests__/prepare-yarn-subprojects.sh keepcache
|
run: /bin/bash __tests__/prepare-yarn-subprojects.sh keepcache
|
||||||
@ -253,7 +253,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Create package.json with packageManager field
|
- name: Create package.json with packageManager field
|
||||||
run: |
|
run: |
|
||||||
echo '{ "name": "test-project", "version": "1.0.0", "packageManager": "npm@8.0.0" }' > package.json
|
echo '{ "name": "test-project", "version": "1.0.0", "packageManager": "npm@8.0.0" }' > package.json
|
||||||
@ -278,7 +278,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Create package.json with devEngines field
|
- name: Create package.json with devEngines field
|
||||||
run: |
|
run: |
|
||||||
echo '{
|
echo '{
|
||||||
|
|||||||
4
.github/workflows/proxy.yml
vendored
4
.github/workflows/proxy.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
https_proxy: http://squid-proxy:3128
|
https_proxy: http://squid-proxy:3128
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Clear tool cache
|
- name: Clear tool cache
|
||||||
run: rm -rf $RUNNER_TOOL_CACHE/*
|
run: rm -rf $RUNNER_TOOL_CACHE/*
|
||||||
- name: Setup node 24
|
- name: Setup node 24
|
||||||
@ -41,7 +41,7 @@ jobs:
|
|||||||
https_proxy: http://no-such-proxy:3128
|
https_proxy: http://no-such-proxy:3128
|
||||||
no_proxy: api.github.com,github.com,nodejs.org,registry.npmjs.org,*.s3.amazonaws.com,s3.amazonaws.com
|
no_proxy: api.github.com,github.com,nodejs.org,registry.npmjs.org,*.s3.amazonaws.com,s3.amazonaws.com
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Clear tool cache
|
- name: Clear tool cache
|
||||||
run: rm -rf $RUNNER_TOOL_CACHE/*
|
run: rm -rf $RUNNER_TOOL_CACHE/*
|
||||||
- name: Setup node 24
|
- name: Setup node 24
|
||||||
|
|||||||
@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checking out
|
- name: Checking out
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v6
|
||||||
- name: Publish
|
- name: Publish
|
||||||
id: publish
|
id: publish
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
|
|||||||
28
.github/workflows/versions.yml
vendored
28
.github/workflows/versions.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -37,7 +37,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest-large]
|
||||||
node-version: [lts/dubnium, lts/erbium, lts/fermium, lts/*, lts/-1]
|
node-version: [lts/dubnium, lts/erbium, lts/fermium, lts/*, lts/-1]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -64,7 +64,7 @@ jobs:
|
|||||||
'20.0.0-v8-canary20221101e50e45c9f8'
|
'20.0.0-v8-canary20221101e50e45c9f8'
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -84,7 +84,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20-nightly, 25-nightly, 24.0.0-nightly]
|
node-version: [20-nightly, 25-nightly, 24.0.0-nightly]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -104,7 +104,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20.0.0-rc.1, 22.14.0-rc.1, 24.0.0-rc.4]
|
node-version: [20.0.0-rc.1, 22.14.0-rc.1, 24.0.0-rc.4]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -124,7 +124,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20.10.0, 22.0.0, 24.9.0]
|
node-version: [20.10.0, 22.0.0, 24.9.0]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -141,7 +141,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [20, 22, 24]
|
node-version: [20, 22, 24]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node and check latest
|
- name: Setup Node and check latest
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -160,7 +160,7 @@ jobs:
|
|||||||
node-version-file:
|
node-version-file:
|
||||||
[.nvmrc, .tool-versions, .tool-versions-node, package.json]
|
[.nvmrc, .tool-versions, .tool-versions-node, package.json]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node from node version file
|
- name: Setup node from node version file
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -175,7 +175,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node from node version file
|
- name: Setup node from node version file
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -190,7 +190,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node from node version file
|
- name: Setup node from node version file
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -206,7 +206,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
|
||||||
node-version: [17, 19]
|
node-version: [17, 19]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node from dist
|
- name: Setup Node from dist
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -222,7 +222,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest-large]
|
os: [ubuntu-latest, windows-latest, macos-latest-large]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
# test old versions which didn't have npm and layout different
|
# test old versions which didn't have npm and layout different
|
||||||
- name: Setup node 0.12.18 from dist
|
- name: Setup node 0.12.18 from dist
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -235,7 +235,7 @@ jobs:
|
|||||||
arch:
|
arch:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node 20 x86 from dist
|
- name: Setup node 20 x86 from dist
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@ -259,7 +259,7 @@ jobs:
|
|||||||
echo "LATEST_NODE_VERSION=$latestNodeVersion" >> $GITHUB_OUTPUT
|
echo "LATEST_NODE_VERSION=$latestNodeVersion" >> $GITHUB_OUTPUT
|
||||||
id: version
|
id: version
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@actions/http-client-3.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/http-client-3.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/io-2.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/io-2.0.0.dep.yml
generated
Normal file
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@octokit/core.dep.yml
generated
BIN
.licenses/npm/@octokit/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node.dep.yml
generated
BIN
.licenses/npm/@types/node.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/asynckit.dep.yml
generated
BIN
.licenses/npm/asynckit.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/combined-stream.dep.yml
generated
BIN
.licenses/npm/combined-stream.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/debug.dep.yml
generated
Normal file
BIN
.licenses/npm/debug.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/delayed-stream.dep.yml
generated
BIN
.licenses/npm/delayed-stream.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/es-define-property.dep.yml
generated
BIN
.licenses/npm/es-define-property.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/es-errors.dep.yml
generated
BIN
.licenses/npm/es-errors.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/es-set-tostringtag.dep.yml
generated
BIN
.licenses/npm/es-set-tostringtag.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/form-data-2.5.5.dep.yml
generated
BIN
.licenses/npm/form-data-2.5.5.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/form-data-4.0.4.dep.yml
generated
BIN
.licenses/npm/form-data-4.0.4.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/function-bind.dep.yml
generated
BIN
.licenses/npm/function-bind.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/get-intrinsic.dep.yml
generated
BIN
.licenses/npm/get-intrinsic.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/get-proto.dep.yml
generated
BIN
.licenses/npm/get-proto.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/gopd.dep.yml
generated
BIN
.licenses/npm/gopd.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/has-symbols.dep.yml
generated
BIN
.licenses/npm/has-symbols.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/has-tostringtag.dep.yml
generated
BIN
.licenses/npm/has-tostringtag.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/math-intrinsics.dep.yml
generated
BIN
.licenses/npm/math-intrinsics.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tr46.dep.yml → .licenses/npm/ms.dep.yml
generated
BIN
.licenses/npm/tr46.dep.yml → .licenses/npm/ms.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
BIN
.licenses/npm/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/safe-buffer.dep.yml
generated
BIN
.licenses/npm/safe-buffer.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/sax.dep.yml
generated
BIN
.licenses/npm/sax.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/typescript.dep.yml
generated
BIN
.licenses/npm/typescript.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/whatwg-url.dep.yml
generated
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xml2js.dep.yml
generated
BIN
.licenses/npm/xml2js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
Binary file not shown.
23
README.md
23
README.md
@ -16,6 +16,8 @@ This action provides the following functionality for GitHub Actions users:
|
|||||||
|
|
||||||
- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input.
|
- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input.
|
||||||
|
|
||||||
|
- The `always-auth` input has been removed, as it is deprecated and will no longer be supported in future npm releases. To ensure your workflows continue to run without warnings or errors, please remove any references to `always-auth` from your configuration.
|
||||||
|
|
||||||
## Breaking changes in V5
|
## Breaking changes in V5
|
||||||
|
|
||||||
- Enabled caching by default with package manager detection if no cache input is provided.
|
- Enabled caching by default with package manager detection if no cache input is provided.
|
||||||
@ -92,14 +94,10 @@ See [action.yml](action.yml)
|
|||||||
# Default: ''
|
# Default: ''
|
||||||
scope: ''
|
scope: ''
|
||||||
|
|
||||||
# Set always-auth option in npmrc file.
|
|
||||||
# Default: ''
|
|
||||||
always-auth: ''
|
|
||||||
|
|
||||||
# Optional mirror to download binaries from.
|
# Optional mirror to download binaries from.
|
||||||
# Artifacts need to match the official Node.js
|
# Artifacts need to match the official Node.js
|
||||||
# Example:
|
# Example:
|
||||||
# V8 Canaray Build: <mirror_url>/download/v8-canary
|
# V8 Canary Build: <mirror_url>/download/v8-canary
|
||||||
# RC Build: <mirror_url>/download/rc
|
# RC Build: <mirror_url>/download/rc
|
||||||
# Official: Build <mirror_url>/dist
|
# Official: Build <mirror_url>/dist
|
||||||
# Nightly build: <mirror_url>/download/nightly
|
# Nightly build: <mirror_url>/download/nightly
|
||||||
@ -117,7 +115,7 @@ See [action.yml](action.yml)
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
@ -125,7 +123,7 @@ steps:
|
|||||||
- run: npm test
|
- run: npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and don't rely on the system one.
|
The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and not rely on the system one.
|
||||||
|
|
||||||
The action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/).
|
The action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/).
|
||||||
|
|
||||||
@ -150,7 +148,7 @@ Since it will not be cached always, there is possibility of hitting rate limit w
|
|||||||
|
|
||||||
### Checking in lockfiles
|
### Checking in lockfiles
|
||||||
|
|
||||||
It's **always** recommended to commit the lockfile of your package manager for security and performance reasons. For more information consult the "Working with lockfiles" section of the [Advanced usage](docs/advanced-usage.md#working-with-lockfiles) guide.
|
It's **strongly recommended** to commit the lockfile of your package manager for security and performance reasons. For more information consult the "Working with lockfiles" section of the [Advanced usage](docs/advanced-usage.md#working-with-lockfiles) guide.
|
||||||
|
|
||||||
## Caching global packages data
|
## Caching global packages data
|
||||||
|
|
||||||
@ -166,7 +164,7 @@ See the examples of using cache for `yarn`/`pnpm` and `cache-dependency-path` in
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
@ -179,7 +177,7 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
@ -195,7 +193,7 @@ This behavior is controlled by the `package-manager-cache` input, which defaults
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@ -214,7 +212,7 @@ jobs:
|
|||||||
node: [ 20, 22, 24 ]
|
node: [ 20, 22, 24 ]
|
||||||
name: Node ${{ matrix.node }} sample
|
name: Node ${{ matrix.node }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
@ -251,6 +249,7 @@ If the runner is not able to access github.com, any Nodejs versions requested du
|
|||||||
- [Publishing to npmjs and GPR with npm](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm)
|
- [Publishing to npmjs and GPR with npm](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm)
|
||||||
- [Publishing to npmjs and GPR with yarn](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn)
|
- [Publishing to npmjs and GPR with yarn](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn)
|
||||||
- [Using private packages](docs/advanced-usage.md#use-private-packages)
|
- [Using private packages](docs/advanced-usage.md#use-private-packages)
|
||||||
|
- [Using private mirror](docs/advanced-usage.md#use-private-mirror)
|
||||||
|
|
||||||
## Recommended permissions
|
## Recommended permissions
|
||||||
|
|
||||||
|
|||||||
@ -76,115 +76,102 @@ describe('authutil tests', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
it('Sets up npmrc for npmjs', async () => {
|
it('Sets up npmrc for npmjs', async () => {
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'false');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
|
|
||||||
expect(fs.statSync(rcFile)).toBeDefined();
|
expect(fs.statSync(rcFile)).toBeDefined();
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
const rc = readRcFile(rcFile);
|
const rc = readRcFile(rcFile);
|
||||||
expect(rc['registry']).toBe('https://registry.npmjs.org/');
|
expect(rc['registry']).toBe('https://registry.npmjs.org/');
|
||||||
expect(rc['always-auth']).toBe('false');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Appends trailing slash to registry', async () => {
|
it('Appends trailing slash to registry', async () => {
|
||||||
await auth.configAuthentication('https://registry.npmjs.org', 'false');
|
await auth.configAuthentication('https://registry.npmjs.org');
|
||||||
|
|
||||||
expect(fs.statSync(rcFile)).toBeDefined();
|
expect(fs.statSync(rcFile)).toBeDefined();
|
||||||
const rc = readRcFile(rcFile);
|
const rc = readRcFile(rcFile);
|
||||||
expect(rc['registry']).toBe('https://registry.npmjs.org/');
|
expect(rc['registry']).toBe('https://registry.npmjs.org/');
|
||||||
expect(rc['always-auth']).toBe('false');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Configures scoped npm registries', async () => {
|
it('Configures scoped npm registries', async () => {
|
||||||
process.env['INPUT_SCOPE'] = 'myScope';
|
process.env['INPUT_SCOPE'] = 'myScope';
|
||||||
await auth.configAuthentication('https://registry.npmjs.org', 'false');
|
await auth.configAuthentication('https://registry.npmjs.org');
|
||||||
|
|
||||||
expect(fs.statSync(rcFile)).toBeDefined();
|
expect(fs.statSync(rcFile)).toBeDefined();
|
||||||
const rc = readRcFile(rcFile);
|
const rc = readRcFile(rcFile);
|
||||||
expect(rc['@myscope:registry']).toBe('https://registry.npmjs.org/');
|
expect(rc['@myscope:registry']).toBe('https://registry.npmjs.org/');
|
||||||
expect(rc['always-auth']).toBe('false');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Automatically configures GPR scope', async () => {
|
it('Automatically configures GPR scope', async () => {
|
||||||
await auth.configAuthentication('npm.pkg.github.com', 'false');
|
await auth.configAuthentication('npm.pkg.github.com');
|
||||||
|
|
||||||
expect(fs.statSync(rcFile)).toBeDefined();
|
expect(fs.statSync(rcFile)).toBeDefined();
|
||||||
const rc = readRcFile(rcFile);
|
const rc = readRcFile(rcFile);
|
||||||
expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/');
|
expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/');
|
||||||
expect(rc['always-auth']).toBe('false');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Sets up npmrc for always-auth true', async () => {
|
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
|
||||||
expect(fs.statSync(rcFile)).toBeDefined();
|
|
||||||
const rc = readRcFile(rcFile);
|
|
||||||
expect(rc['registry']).toBe('https://registry.npmjs.org/');
|
|
||||||
expect(rc['always-auth']).toBe('true');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is already set the NODE_AUTH_TOKEN export it', async () => {
|
it('is already set the NODE_AUTH_TOKEN export it', async () => {
|
||||||
process.env.NODE_AUTH_TOKEN = 'foobar';
|
process.env.NODE_AUTH_TOKEN = 'foobar';
|
||||||
await auth.configAuthentication('npm.pkg.github.com', 'false');
|
await auth.configAuthentication('npm.pkg.github.com');
|
||||||
expect(fs.statSync(rcFile)).toBeDefined();
|
expect(fs.statSync(rcFile)).toBeDefined();
|
||||||
const rc = readRcFile(rcFile);
|
const rc = readRcFile(rcFile);
|
||||||
expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/');
|
expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/');
|
||||||
expect(rc['always-auth']).toBe('false');
|
|
||||||
expect(process.env.NODE_AUTH_TOKEN).toEqual('foobar');
|
expect(process.env.NODE_AUTH_TOKEN).toEqual('foobar');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should overwrite non-scoped with non-scoped', async () => {
|
it('configAuthentication should overwrite non-scoped with non-scoped', async () => {
|
||||||
fs.writeFileSync(rcFile, 'registry=NNN');
|
fs.writeFileSync(rcFile, 'registry=NNN');
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should overwrite only non-scoped', async () => {
|
it('configAuthentication should overwrite only non-scoped', async () => {
|
||||||
fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`);
|
fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`);
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`@myscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`@myscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should add non-scoped to scoped', async () => {
|
it('configAuthentication should add non-scoped to scoped', async () => {
|
||||||
fs.writeFileSync(rcFile, '@myscope:registry=NNN');
|
fs.writeFileSync(rcFile, '@myscope:registry=NNN');
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`@myscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`@myscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should overwrite scoped with scoped', async () => {
|
it('configAuthentication should overwrite scoped with scoped', async () => {
|
||||||
process.env['INPUT_SCOPE'] = 'myscope';
|
process.env['INPUT_SCOPE'] = 'myscope';
|
||||||
fs.writeFileSync(rcFile, `@myscope:registry=NNN`);
|
fs.writeFileSync(rcFile, `@myscope:registry=NNN`);
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should overwrite only scoped', async () => {
|
it('configAuthentication should overwrite only scoped', async () => {
|
||||||
process.env['INPUT_SCOPE'] = 'myscope';
|
process.env['INPUT_SCOPE'] = 'myscope';
|
||||||
fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`);
|
fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`);
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should add scoped to non-scoped', async () => {
|
it('configAuthentication should add scoped to non-scoped', async () => {
|
||||||
process.env['INPUT_SCOPE'] = 'myscope';
|
process.env['INPUT_SCOPE'] = 'myscope';
|
||||||
fs.writeFileSync(rcFile, `registry=MMM`);
|
fs.writeFileSync(rcFile, `registry=MMM`);
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -194,20 +181,20 @@ describe('authutil tests', () => {
|
|||||||
rcFile,
|
rcFile,
|
||||||
`@otherscope:registry=NNN${os.EOL}@myscope:registry=MMM`
|
`@otherscope:registry=NNN${os.EOL}@myscope:registry=MMM`
|
||||||
);
|
);
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`@otherscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`@otherscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('configAuthentication should add scoped to another scoped', async () => {
|
it('configAuthentication should add scoped to another scoped', async () => {
|
||||||
process.env['INPUT_SCOPE'] = 'myscope';
|
process.env['INPUT_SCOPE'] = 'myscope';
|
||||||
fs.writeFileSync(rcFile, `@otherscope:registry=MMM`);
|
fs.writeFileSync(rcFile, `@otherscope:registry=MMM`);
|
||||||
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
|
await auth.configAuthentication('https://registry.npmjs.org/');
|
||||||
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
|
||||||
expect(contents).toBe(
|
expect(contents).toBe(
|
||||||
`@otherscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
|
`@otherscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -227,7 +227,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '11.15.0';
|
const versionSpec = '11.15.0';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -283,7 +282,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '19.0.0-v8-canary';
|
const versionSpec = '19.0.0-v8-canary';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
findSpy.mockImplementation(() => '');
|
findSpy.mockImplementation(() => '');
|
||||||
@ -324,7 +322,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = version;
|
inputs['node-version'] = version;
|
||||||
inputs['architecture'] = arch;
|
inputs['architecture'] = arch;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
const expectedUrl = `https://nodejs.org/download/v8-canary/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
|
const expectedUrl = `https://nodejs.org/download/v8-canary/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
|
||||||
@ -569,7 +566,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = 'v20-v8-canary';
|
const versionSpec = 'v20-v8-canary';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
os.platform = 'linux';
|
os.platform = 'linux';
|
||||||
|
|||||||
@ -255,7 +255,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '13.13.1-nightly20200415947ddec091';
|
const versionSpec = '13.13.1-nightly20200415947ddec091';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -291,7 +290,6 @@ describe('setup-node', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -333,7 +331,6 @@ describe('setup-node', () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -389,7 +386,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '18.0.0-nightly202204180699150267';
|
const versionSpec = '18.0.0-nightly202204180699150267';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
findSpy.mockImplementation(() => '');
|
findSpy.mockImplementation(() => '');
|
||||||
@ -427,7 +423,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = version;
|
inputs['node-version'] = version;
|
||||||
inputs['architecture'] = arch;
|
inputs['architecture'] = arch;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
const expectedUrl = `https://nodejs.org/download/nightly/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
|
const expectedUrl = `https://nodejs.org/download/nightly/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
|
||||||
@ -473,7 +468,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = version;
|
inputs['node-version'] = version;
|
||||||
inputs['architecture'] = arch;
|
inputs['architecture'] = arch;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
inputs['mirror'] = 'https://my-mirror.org';
|
inputs['mirror'] = 'https://my-mirror.org';
|
||||||
inputs['mirror-token'] = 'my-mirror-token';
|
inputs['mirror-token'] = 'my-mirror-token';
|
||||||
|
|||||||
@ -235,7 +235,6 @@ describe('setup-node', () => {
|
|||||||
const resolvedVersion = versionSpec;
|
const resolvedVersion = versionSpec;
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
const expectedUrl =
|
const expectedUrl =
|
||||||
@ -290,7 +289,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '11.15.0';
|
const versionSpec = '11.15.0';
|
||||||
const mirror = 'https://my_mirror_url';
|
const mirror = 'https://my_mirror_url';
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
inputs['mirror'] = mirror;
|
inputs['mirror'] = mirror;
|
||||||
inputs['mirror-token'] = 'faketoken';
|
inputs['mirror-token'] = 'faketoken';
|
||||||
@ -327,7 +325,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '11.15.0';
|
const versionSpec = '11.15.0';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -385,7 +382,6 @@ describe('setup-node', () => {
|
|||||||
const resolvedVersion = versionSpec;
|
const resolvedVersion = versionSpec;
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
findSpy.mockImplementation(() => '');
|
findSpy.mockImplementation(() => '');
|
||||||
@ -405,7 +401,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '11.15.0';
|
const versionSpec = '11.15.0';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -448,7 +443,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = version;
|
inputs['node-version'] = version;
|
||||||
inputs['architecture'] = arch;
|
inputs['architecture'] = arch;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
const expectedUrl =
|
const expectedUrl =
|
||||||
@ -560,7 +554,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['check-latest'] = 'true';
|
inputs['check-latest'] = 'true';
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -602,7 +595,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['check-latest'] = 'true';
|
inputs['check-latest'] = 'true';
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -882,7 +874,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = version;
|
inputs['node-version'] = version;
|
||||||
inputs['architecture'] = arch;
|
inputs['architecture'] = arch;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
inputs['mirror'] = 'https://my_mirror_url';
|
inputs['mirror'] = 'https://my_mirror_url';
|
||||||
inputs['mirror-token'] = 'faketoken';
|
inputs['mirror-token'] = 'faketoken';
|
||||||
|
|||||||
@ -194,7 +194,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '13.0.0-rc.0';
|
const versionSpec = '13.0.0-rc.0';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
// ... but not in the local cache
|
// ... but not in the local cache
|
||||||
@ -239,7 +238,6 @@ describe('setup-node', () => {
|
|||||||
const versionSpec = '14.7.0-rc.1';
|
const versionSpec = '14.7.0-rc.1';
|
||||||
|
|
||||||
inputs['node-version'] = versionSpec;
|
inputs['node-version'] = versionSpec;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
findSpy.mockImplementation(() => '');
|
findSpy.mockImplementation(() => '');
|
||||||
@ -268,7 +266,6 @@ describe('setup-node', () => {
|
|||||||
|
|
||||||
inputs['node-version'] = version;
|
inputs['node-version'] = version;
|
||||||
inputs['architecture'] = arch;
|
inputs['architecture'] = arch;
|
||||||
inputs['always-auth'] = false;
|
|
||||||
inputs['token'] = 'faketoken';
|
inputs['token'] = 'faketoken';
|
||||||
|
|
||||||
const expectedUrl = `https://nodejs.org/download/rc/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
|
const expectedUrl = `https://nodejs.org/download/rc/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
|
||||||
|
|||||||
@ -2,9 +2,6 @@ name: 'Setup Node.js environment'
|
|||||||
description: 'Setup a Node.js environment by adding problem matchers and optionally downloading and adding it to the PATH.'
|
description: 'Setup a Node.js environment by adding problem matchers and optionally downloading and adding it to the PATH.'
|
||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
always-auth:
|
|
||||||
description: 'Set always-auth in npmrc.'
|
|
||||||
default: 'false'
|
|
||||||
node-version:
|
node-version:
|
||||||
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
|
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
|
||||||
node-version-file:
|
node-version-file:
|
||||||
@ -29,7 +26,7 @@ inputs:
|
|||||||
cache-dependency-path:
|
cache-dependency-path:
|
||||||
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
|
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
|
||||||
mirror:
|
mirror:
|
||||||
description: 'Used to specify an alternative mirror to downlooad Node.js binaries from'
|
description: 'Used to specify an alternative mirror to download Node.js binaries from'
|
||||||
mirror-token:
|
mirror-token:
|
||||||
description: 'The token used as Authorization header when fetching from the mirror'
|
description: 'The token used as Authorization header when fetching from the mirror'
|
||||||
# TODO: add input to control forcing to pull from cloud or dist.
|
# TODO: add input to control forcing to pull from cloud or dist.
|
||||||
|
|||||||
140
dist/cache-save/index.js
vendored
140
dist/cache-save/index.js
vendored
@ -88986,15 +88986,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.run = void 0;
|
exports.run = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(7484));
|
const core = __importStar(__nccwpck_require__(7484));
|
||||||
@ -89009,12 +89000,11 @@ process.on('uncaughtException', e => {
|
|||||||
core.info(`${warningPrefix}${e.message}`);
|
core.info(`${warningPrefix}${e.message}`);
|
||||||
});
|
});
|
||||||
// Added early exit to resolve issue with slow post action step:
|
// Added early exit to resolve issue with slow post action step:
|
||||||
function run(earlyExit) {
|
async function run(earlyExit) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
const cacheLock = core.getState(constants_1.State.CachePackageManager);
|
const cacheLock = core.getState(constants_1.State.CachePackageManager);
|
||||||
if (cacheLock) {
|
if (cacheLock) {
|
||||||
yield cachePackages(cacheLock);
|
await cachePackages(cacheLock);
|
||||||
if (earlyExit) {
|
if (earlyExit) {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
@ -89026,14 +89016,13 @@ function run(earlyExit) {
|
|||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.run = run;
|
exports.run = run;
|
||||||
const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
|
const cachePackages = async (packageManager) => {
|
||||||
const state = core.getState(constants_1.State.CacheMatchedKey);
|
const state = core.getState(constants_1.State.CacheMatchedKey);
|
||||||
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
|
||||||
const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
|
const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
|
||||||
const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager);
|
const packageManagerInfo = await (0, cache_utils_1.getPackageManagerInfo)(packageManager);
|
||||||
if (!packageManagerInfo) {
|
if (!packageManagerInfo) {
|
||||||
core.debug(`Caching for '${packageManager}' is not supported`);
|
core.debug(`Caching for '${packageManager}' is not supported`);
|
||||||
return;
|
return;
|
||||||
@ -89048,12 +89037,12 @@ const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, func
|
|||||||
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
|
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cacheId = yield cache.saveCache(cachePaths, primaryKey);
|
const cacheId = await cache.saveCache(cachePaths, primaryKey);
|
||||||
if (cacheId == -1) {
|
if (cacheId == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.info(`Cache saved with the key: ${primaryKey}`);
|
core.info(`Cache saved with the key: ${primaryKey}`);
|
||||||
});
|
};
|
||||||
run(true);
|
run(true);
|
||||||
|
|
||||||
|
|
||||||
@ -89087,15 +89076,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -89122,21 +89102,21 @@ exports.supportedPackageManagers = {
|
|||||||
yarn: {
|
yarn: {
|
||||||
name: 'yarn',
|
name: 'yarn',
|
||||||
lockFilePatterns: ['yarn.lock'],
|
lockFilePatterns: ['yarn.lock'],
|
||||||
getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () {
|
getCacheFolderPath: async (projectDir) => {
|
||||||
const yarnVersion = yield (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
|
const yarnVersion = await (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
|
||||||
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
|
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
|
||||||
const stdOut = yarnVersion.startsWith('1.')
|
const stdOut = yarnVersion.startsWith('1.')
|
||||||
? yield (0, exports.getCommandOutput)('yarn cache dir', projectDir)
|
? await (0, exports.getCommandOutput)('yarn cache dir', projectDir)
|
||||||
: yield (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir);
|
: await (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir);
|
||||||
if (!stdOut) {
|
if (!stdOut) {
|
||||||
throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
|
throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
|
||||||
}
|
}
|
||||||
return stdOut;
|
return stdOut;
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCommandOutput = async (toolCommand, cwd) => {
|
||||||
let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd })));
|
let { stdout, stderr, exitCode } = await exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true, ...(cwd && { cwd }) });
|
||||||
if (exitCode) {
|
if (exitCode) {
|
||||||
stderr = !stderr.trim()
|
stderr = !stderr.trim()
|
||||||
? `The '${toolCommand}' command failed with exit code: ${exitCode}`
|
? `The '${toolCommand}' command failed with exit code: ${exitCode}`
|
||||||
@ -89144,17 +89124,17 @@ const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0,
|
|||||||
throw new Error(stderr);
|
throw new Error(stderr);
|
||||||
}
|
}
|
||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
};
|
||||||
exports.getCommandOutput = getCommandOutput;
|
exports.getCommandOutput = getCommandOutput;
|
||||||
const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCommandOutputNotEmpty = async (toolCommand, error, cwd) => {
|
||||||
const stdOut = (0, exports.getCommandOutput)(toolCommand, cwd);
|
const stdOut = (0, exports.getCommandOutput)(toolCommand, cwd);
|
||||||
if (!stdOut) {
|
if (!stdOut) {
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
return stdOut;
|
return stdOut;
|
||||||
});
|
};
|
||||||
exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty;
|
exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty;
|
||||||
const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
|
const getPackageManagerInfo = async (packageManager) => {
|
||||||
if (packageManager === 'npm') {
|
if (packageManager === 'npm') {
|
||||||
return exports.supportedPackageManagers.npm;
|
return exports.supportedPackageManagers.npm;
|
||||||
}
|
}
|
||||||
@ -89167,7 +89147,7 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void
|
|||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
exports.getPackageManagerInfo = getPackageManagerInfo;
|
exports.getPackageManagerInfo = getPackageManagerInfo;
|
||||||
/**
|
/**
|
||||||
* getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
|
* getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
|
||||||
@ -89189,12 +89169,12 @@ exports.resetProjectDirectoriesMemoized = resetProjectDirectoriesMemoized;
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return list of directories and possible
|
* @return list of directories and possible
|
||||||
*/
|
*/
|
||||||
const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const getProjectDirectoriesFromCacheDependencyPath = async (cacheDependencyPath) => {
|
||||||
if (projectDirectoriesMemoized !== null) {
|
if (projectDirectoriesMemoized !== null) {
|
||||||
return projectDirectoriesMemoized;
|
return projectDirectoriesMemoized;
|
||||||
}
|
}
|
||||||
const globber = yield glob.create(cacheDependencyPath);
|
const globber = await glob.create(cacheDependencyPath);
|
||||||
const cacheDependenciesPaths = yield globber.glob();
|
const cacheDependenciesPaths = await globber.glob();
|
||||||
const existingDirectories = cacheDependenciesPaths
|
const existingDirectories = cacheDependenciesPaths
|
||||||
.map(path_1.default.dirname)
|
.map(path_1.default.dirname)
|
||||||
.filter((0, util_1.unique)())
|
.filter((0, util_1.unique)())
|
||||||
@ -89204,7 +89184,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|||||||
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
|
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
|
||||||
projectDirectoriesMemoized = existingDirectories;
|
projectDirectoriesMemoized = existingDirectories;
|
||||||
return existingDirectories;
|
return existingDirectories;
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* Finds the cache directories configured for the repo if cache-dependency-path is not empty
|
* Finds the cache directories configured for the repo if cache-dependency-path is not empty
|
||||||
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
||||||
@ -89212,26 +89192,26 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return list of files on which the cache depends
|
* @return list of files on which the cache depends
|
||||||
*/
|
*/
|
||||||
const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectoriesFromCacheDependencyPath = async (packageManagerInfo, cacheDependencyPath) => {
|
||||||
const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
|
const projectDirectories = await getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
|
||||||
const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () {
|
const cacheFoldersPaths = await Promise.all(projectDirectories.map(async (projectDirectory) => {
|
||||||
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(projectDirectory);
|
const cacheFolderPath = await packageManagerInfo.getCacheFolderPath(projectDirectory);
|
||||||
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
|
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
|
||||||
return cacheFolderPath;
|
return cacheFolderPath;
|
||||||
})));
|
}));
|
||||||
// uniq in order to do not cache the same directories twice
|
// uniq in order to do not cache the same directories twice
|
||||||
return cacheFoldersPaths.filter((0, util_1.unique)());
|
return cacheFoldersPaths.filter((0, util_1.unique)());
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* Finds the cache directories configured for the repo ignoring cache-dependency-path
|
* Finds the cache directories configured for the repo ignoring cache-dependency-path
|
||||||
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
||||||
* @return list of files on which the cache depends
|
* @return list of files on which the cache depends
|
||||||
*/
|
*/
|
||||||
const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectoriesForRootProject = async (packageManagerInfo) => {
|
||||||
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath();
|
const cacheFolderPath = await packageManagerInfo.getCacheFolderPath();
|
||||||
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`);
|
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`);
|
||||||
return [cacheFolderPath];
|
return [cacheFolderPath];
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* A function to find the cache directories configured for the repo
|
* A function to find the cache directories configured for the repo
|
||||||
* currently it handles only the case of PM=yarn && cacheDependencyPath is not empty
|
* currently it handles only the case of PM=yarn && cacheDependencyPath is not empty
|
||||||
@ -89240,14 +89220,14 @@ const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return list of files on which the cache depends
|
* @return list of files on which the cache depends
|
||||||
*/
|
*/
|
||||||
const getCacheDirectories = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectories = async (packageManagerInfo, cacheDependencyPath) => {
|
||||||
// For yarn, if cacheDependencyPath is set, ask information about cache folders in each project
|
// For yarn, if cacheDependencyPath is set, ask information about cache folders in each project
|
||||||
// folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488
|
// folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488
|
||||||
if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) {
|
if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) {
|
||||||
return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath);
|
return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath);
|
||||||
}
|
}
|
||||||
return getCacheDirectoriesForRootProject(packageManagerInfo);
|
return getCacheDirectoriesForRootProject(packageManagerInfo);
|
||||||
});
|
};
|
||||||
exports.getCacheDirectories = getCacheDirectories;
|
exports.getCacheDirectories = getCacheDirectories;
|
||||||
/**
|
/**
|
||||||
* A function to check if the directory is a yarn project configured to manage
|
* A function to check if the directory is a yarn project configured to manage
|
||||||
@ -89259,7 +89239,7 @@ exports.getCacheDirectories = getCacheDirectories;
|
|||||||
* - if local cache is not explicitly enabled (not yarn3), return false
|
* - if local cache is not explicitly enabled (not yarn3), return false
|
||||||
* - return true otherwise
|
* - return true otherwise
|
||||||
*/
|
*/
|
||||||
const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0, void 0, void 0, function* () {
|
const projectHasYarnBerryManagedDependencies = async (directory) => {
|
||||||
const workDir = directory || process.env.GITHUB_WORKSPACE || '.';
|
const workDir = directory || process.env.GITHUB_WORKSPACE || '.';
|
||||||
core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`);
|
core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`);
|
||||||
// if .yarn/cache directory exists the cache is managed by version control system
|
// if .yarn/cache directory exists the cache is managed by version control system
|
||||||
@ -89270,7 +89250,7 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
// NOTE: yarn1 returns 'undefined' with return code = 0
|
// NOTE: yarn1 returns 'undefined' with return code = 0
|
||||||
const enableGlobalCache = yield (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir);
|
const enableGlobalCache = await (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir);
|
||||||
// only local cache is not managed by yarn
|
// only local cache is not managed by yarn
|
||||||
const managed = enableGlobalCache.includes('false');
|
const managed = enableGlobalCache.includes('false');
|
||||||
if (managed) {
|
if (managed) {
|
||||||
@ -89281,7 +89261,7 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|||||||
core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`);
|
core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* A function to report the repo contains Yarn managed projects
|
* A function to report the repo contains Yarn managed projects
|
||||||
* @param packageManagerInfo - used to make sure current package manager is yarn
|
* @param packageManagerInfo - used to make sure current package manager is yarn
|
||||||
@ -89289,15 +89269,15 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return - true if all project directories configured to be Yarn managed
|
* @return - true if all project directories configured to be Yarn managed
|
||||||
*/
|
*/
|
||||||
const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const repoHasYarnBerryManagedDependencies = async (packageManagerInfo, cacheDependencyPath) => {
|
||||||
if (packageManagerInfo.name !== 'yarn')
|
if (packageManagerInfo.name !== 'yarn')
|
||||||
return false;
|
return false;
|
||||||
const yarnDirs = cacheDependencyPath
|
const yarnDirs = cacheDependencyPath
|
||||||
? yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath)
|
? await getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath)
|
||||||
: [''];
|
: [''];
|
||||||
const isManagedList = yield Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies));
|
const isManagedList = await Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies));
|
||||||
return isManagedList.every(Boolean);
|
return isManagedList.every(Boolean);
|
||||||
});
|
};
|
||||||
exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies;
|
exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies;
|
||||||
function isGhes() {
|
function isGhes() {
|
||||||
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||||
@ -89379,15 +89359,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -89399,7 +89370,6 @@ const io = __importStar(__nccwpck_require__(4994));
|
|||||||
const fs_1 = __importDefault(__nccwpck_require__(9896));
|
const fs_1 = __importDefault(__nccwpck_require__(9896));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(6928));
|
const path_1 = __importDefault(__nccwpck_require__(6928));
|
||||||
function getNodeVersionFromFile(versionFilePath) {
|
function getNodeVersionFromFile(versionFilePath) {
|
||||||
var _a, _b, _c, _d, _e;
|
|
||||||
if (!fs_1.default.existsSync(versionFilePath)) {
|
if (!fs_1.default.existsSync(versionFilePath)) {
|
||||||
throw new Error(`The specified node version file at: ${versionFilePath} does not exist`);
|
throw new Error(`The specified node version file at: ${versionFilePath} does not exist`);
|
||||||
}
|
}
|
||||||
@ -89411,15 +89381,15 @@ function getNodeVersionFromFile(versionFilePath) {
|
|||||||
if (typeof manifest === 'object' && !!manifest) {
|
if (typeof manifest === 'object' && !!manifest) {
|
||||||
// Support Volta.
|
// Support Volta.
|
||||||
// See https://docs.volta.sh/guide/understanding#managing-your-project
|
// See https://docs.volta.sh/guide/understanding#managing-your-project
|
||||||
if ((_a = manifest.volta) === null || _a === void 0 ? void 0 : _a.node) {
|
if (manifest.volta?.node) {
|
||||||
return manifest.volta.node;
|
return manifest.volta.node;
|
||||||
}
|
}
|
||||||
if ((_b = manifest.engines) === null || _b === void 0 ? void 0 : _b.node) {
|
if (manifest.engines?.node) {
|
||||||
return manifest.engines.node;
|
return manifest.engines.node;
|
||||||
}
|
}
|
||||||
// Support Volta workspaces.
|
// Support Volta workspaces.
|
||||||
// See https://docs.volta.sh/advanced/workspaces
|
// See https://docs.volta.sh/advanced/workspaces
|
||||||
if ((_c = manifest.volta) === null || _c === void 0 ? void 0 : _c.extends) {
|
if (manifest.volta?.extends) {
|
||||||
const extendedFilePath = path_1.default.resolve(path_1.default.dirname(versionFilePath), manifest.volta.extends);
|
const extendedFilePath = path_1.default.resolve(path_1.default.dirname(versionFilePath), manifest.volta.extends);
|
||||||
core.info('Resolving node version from ' + extendedFilePath);
|
core.info('Resolving node version from ' + extendedFilePath);
|
||||||
return getNodeVersionFromFile(extendedFilePath);
|
return getNodeVersionFromFile(extendedFilePath);
|
||||||
@ -89436,22 +89406,21 @@ function getNodeVersionFromFile(versionFilePath) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (_f) {
|
catch {
|
||||||
core.info('Node version file is not JSON file');
|
core.info('Node version file is not JSON file');
|
||||||
}
|
}
|
||||||
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
|
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
|
||||||
return (_e = (_d = found === null || found === void 0 ? void 0 : found.groups) === null || _d === void 0 ? void 0 : _d.version) !== null && _e !== void 0 ? _e : contents.trim();
|
return found?.groups?.version ?? contents.trim();
|
||||||
}
|
}
|
||||||
exports.getNodeVersionFromFile = getNodeVersionFromFile;
|
exports.getNodeVersionFromFile = getNodeVersionFromFile;
|
||||||
function printEnvDetailsAndSetOutput() {
|
async function printEnvDetailsAndSetOutput() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
core.startGroup('Environment details');
|
core.startGroup('Environment details');
|
||||||
const promises = ['node', 'npm', 'yarn', 'pnpm'].map((tool) => __awaiter(this, void 0, void 0, function* () {
|
const promises = ['node', 'npm', 'yarn', 'pnpm'].map(async (tool) => {
|
||||||
const pathTool = yield io.which(tool, false);
|
const pathTool = await io.which(tool, false);
|
||||||
const output = pathTool ? yield getToolVersion(tool, ['--version']) : '';
|
const output = pathTool ? await getToolVersion(tool, ['--version']) : '';
|
||||||
return { tool, output };
|
return { tool, output };
|
||||||
}));
|
});
|
||||||
const tools = yield Promise.all(promises);
|
const tools = await Promise.all(promises);
|
||||||
tools.forEach(({ tool, output }) => {
|
tools.forEach(({ tool, output }) => {
|
||||||
if (tool === 'node') {
|
if (tool === 'node') {
|
||||||
core.setOutput(`${tool}-version`, output);
|
core.setOutput(`${tool}-version`, output);
|
||||||
@ -89459,13 +89428,11 @@ function printEnvDetailsAndSetOutput() {
|
|||||||
core.info(`${tool}: ${output}`);
|
core.info(`${tool}: ${output}`);
|
||||||
});
|
});
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
|
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
|
||||||
function getToolVersion(tool, options) {
|
async function getToolVersion(tool, options) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, {
|
const { stdout, stderr, exitCode } = await exec.getExecOutput(tool, options, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true
|
silent: true
|
||||||
});
|
});
|
||||||
@ -89478,7 +89445,6 @@ function getToolVersion(tool, options) {
|
|||||||
catch (err) {
|
catch (err) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const unique = () => {
|
const unique = () => {
|
||||||
const encountered = new Set();
|
const encountered = new Set();
|
||||||
|
|||||||
329
dist/setup/index.js
vendored
329
dist/setup/index.js
vendored
@ -98514,15 +98514,15 @@ const os = __importStar(__nccwpck_require__(70857));
|
|||||||
const path = __importStar(__nccwpck_require__(16928));
|
const path = __importStar(__nccwpck_require__(16928));
|
||||||
const core = __importStar(__nccwpck_require__(37484));
|
const core = __importStar(__nccwpck_require__(37484));
|
||||||
const github = __importStar(__nccwpck_require__(93228));
|
const github = __importStar(__nccwpck_require__(93228));
|
||||||
function configAuthentication(registryUrl, alwaysAuth) {
|
function configAuthentication(registryUrl) {
|
||||||
const npmrc = path.resolve(process.env['RUNNER_TEMP'] || process.cwd(), '.npmrc');
|
const npmrc = path.resolve(process.env['RUNNER_TEMP'] || process.cwd(), '.npmrc');
|
||||||
if (!registryUrl.endsWith('/')) {
|
if (!registryUrl.endsWith('/')) {
|
||||||
registryUrl += '/';
|
registryUrl += '/';
|
||||||
}
|
}
|
||||||
writeRegistryToFile(registryUrl, npmrc, alwaysAuth);
|
writeRegistryToFile(registryUrl, npmrc);
|
||||||
}
|
}
|
||||||
exports.configAuthentication = configAuthentication;
|
exports.configAuthentication = configAuthentication;
|
||||||
function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
function writeRegistryToFile(registryUrl, fileLocation) {
|
||||||
let scope = core.getInput('scope');
|
let scope = core.getInput('scope');
|
||||||
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
|
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
|
||||||
scope = github.context.repo.owner;
|
scope = github.context.repo.owner;
|
||||||
@ -98547,8 +98547,7 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
|||||||
// Remove http: or https: from front of registry.
|
// Remove http: or https: from front of registry.
|
||||||
const authString = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
const authString = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
||||||
const registryString = `${scope}registry=${registryUrl}`;
|
const registryString = `${scope}registry=${registryUrl}`;
|
||||||
const alwaysAuthString = `always-auth=${alwaysAuth}`;
|
newContents += `${authString}${os.EOL}${registryString}`;
|
||||||
newContents += `${authString}${os.EOL}${registryString}${os.EOL}${alwaysAuthString}`;
|
|
||||||
fs.writeFileSync(fileLocation, newContents);
|
fs.writeFileSync(fileLocation, newContents);
|
||||||
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
||||||
// Export empty node_auth_token if didn't exist so npm doesn't complain about not being able to find it
|
// Export empty node_auth_token if didn't exist so npm doesn't complain about not being able to find it
|
||||||
@ -98586,15 +98585,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -98608,19 +98598,19 @@ const fs_1 = __importDefault(__nccwpck_require__(79896));
|
|||||||
const os_1 = __importDefault(__nccwpck_require__(70857));
|
const os_1 = __importDefault(__nccwpck_require__(70857));
|
||||||
const constants_1 = __nccwpck_require__(27242);
|
const constants_1 = __nccwpck_require__(27242);
|
||||||
const cache_utils_1 = __nccwpck_require__(4673);
|
const cache_utils_1 = __nccwpck_require__(4673);
|
||||||
const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const restoreCache = async (packageManager, cacheDependencyPath) => {
|
||||||
const packageManagerInfo = yield (0, cache_utils_1.getPackageManagerInfo)(packageManager);
|
const packageManagerInfo = await (0, cache_utils_1.getPackageManagerInfo)(packageManager);
|
||||||
if (!packageManagerInfo) {
|
if (!packageManagerInfo) {
|
||||||
throw new Error(`Caching for '${packageManager}' is not supported`);
|
throw new Error(`Caching for '${packageManager}' is not supported`);
|
||||||
}
|
}
|
||||||
const platform = process.env.RUNNER_OS;
|
const platform = process.env.RUNNER_OS;
|
||||||
const arch = os_1.default.arch();
|
const arch = os_1.default.arch();
|
||||||
const cachePaths = yield (0, cache_utils_1.getCacheDirectories)(packageManagerInfo, cacheDependencyPath);
|
const cachePaths = await (0, cache_utils_1.getCacheDirectories)(packageManagerInfo, cacheDependencyPath);
|
||||||
core.saveState(constants_1.State.CachePaths, cachePaths);
|
core.saveState(constants_1.State.CachePaths, cachePaths);
|
||||||
const lockFilePath = cacheDependencyPath
|
const lockFilePath = cacheDependencyPath
|
||||||
? cacheDependencyPath
|
? cacheDependencyPath
|
||||||
: findLockFile(packageManagerInfo);
|
: findLockFile(packageManagerInfo);
|
||||||
const fileHash = yield glob.hashFiles(lockFilePath);
|
const fileHash = await glob.hashFiles(lockFilePath);
|
||||||
if (!fileHash) {
|
if (!fileHash) {
|
||||||
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
|
throw new Error('Some specified paths were not resolved, unable to cache dependencies.');
|
||||||
}
|
}
|
||||||
@ -98628,14 +98618,14 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
|
|||||||
const primaryKey = `${keyPrefix}-${fileHash}`;
|
const primaryKey = `${keyPrefix}-${fileHash}`;
|
||||||
core.debug(`primary key is ${primaryKey}`);
|
core.debug(`primary key is ${primaryKey}`);
|
||||||
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
|
core.saveState(constants_1.State.CachePrimaryKey, primaryKey);
|
||||||
const isManagedByYarnBerry = yield (0, cache_utils_1.repoHasYarnBerryManagedDependencies)(packageManagerInfo, cacheDependencyPath);
|
const isManagedByYarnBerry = await (0, cache_utils_1.repoHasYarnBerryManagedDependencies)(packageManagerInfo, cacheDependencyPath);
|
||||||
let cacheKey;
|
let cacheKey;
|
||||||
if (isManagedByYarnBerry) {
|
if (isManagedByYarnBerry) {
|
||||||
core.info('All dependencies are managed locally by yarn3, the previous cache can be used');
|
core.info('All dependencies are managed locally by yarn3, the previous cache can be used');
|
||||||
cacheKey = yield cache.restoreCache(cachePaths, primaryKey, [keyPrefix]);
|
cacheKey = await cache.restoreCache(cachePaths, primaryKey, [keyPrefix]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cacheKey = yield cache.restoreCache(cachePaths, primaryKey);
|
cacheKey = await cache.restoreCache(cachePaths, primaryKey);
|
||||||
}
|
}
|
||||||
core.setOutput('cache-hit', Boolean(cacheKey));
|
core.setOutput('cache-hit', Boolean(cacheKey));
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
@ -98644,7 +98634,7 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
|
|||||||
}
|
}
|
||||||
core.saveState(constants_1.State.CacheMatchedKey, cacheKey);
|
core.saveState(constants_1.State.CacheMatchedKey, cacheKey);
|
||||||
core.info(`Cache restored from key: ${cacheKey}`);
|
core.info(`Cache restored from key: ${cacheKey}`);
|
||||||
});
|
};
|
||||||
exports.restoreCache = restoreCache;
|
exports.restoreCache = restoreCache;
|
||||||
const findLockFile = (packageManager) => {
|
const findLockFile = (packageManager) => {
|
||||||
const lockFiles = packageManager.lockFilePatterns;
|
const lockFiles = packageManager.lockFilePatterns;
|
||||||
@ -98688,15 +98678,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -98723,21 +98704,21 @@ exports.supportedPackageManagers = {
|
|||||||
yarn: {
|
yarn: {
|
||||||
name: 'yarn',
|
name: 'yarn',
|
||||||
lockFilePatterns: ['yarn.lock'],
|
lockFilePatterns: ['yarn.lock'],
|
||||||
getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () {
|
getCacheFolderPath: async (projectDir) => {
|
||||||
const yarnVersion = yield (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
|
const yarnVersion = await (0, exports.getCommandOutputNotEmpty)(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
|
||||||
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
|
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
|
||||||
const stdOut = yarnVersion.startsWith('1.')
|
const stdOut = yarnVersion.startsWith('1.')
|
||||||
? yield (0, exports.getCommandOutput)('yarn cache dir', projectDir)
|
? await (0, exports.getCommandOutput)('yarn cache dir', projectDir)
|
||||||
: yield (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir);
|
: await (0, exports.getCommandOutput)('yarn config get cacheFolder', projectDir);
|
||||||
if (!stdOut) {
|
if (!stdOut) {
|
||||||
throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
|
throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
|
||||||
}
|
}
|
||||||
return stdOut;
|
return stdOut;
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCommandOutput = async (toolCommand, cwd) => {
|
||||||
let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd })));
|
let { stdout, stderr, exitCode } = await exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true, ...(cwd && { cwd }) });
|
||||||
if (exitCode) {
|
if (exitCode) {
|
||||||
stderr = !stderr.trim()
|
stderr = !stderr.trim()
|
||||||
? `The '${toolCommand}' command failed with exit code: ${exitCode}`
|
? `The '${toolCommand}' command failed with exit code: ${exitCode}`
|
||||||
@ -98745,17 +98726,17 @@ const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0,
|
|||||||
throw new Error(stderr);
|
throw new Error(stderr);
|
||||||
}
|
}
|
||||||
return stdout.trim();
|
return stdout.trim();
|
||||||
});
|
};
|
||||||
exports.getCommandOutput = getCommandOutput;
|
exports.getCommandOutput = getCommandOutput;
|
||||||
const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCommandOutputNotEmpty = async (toolCommand, error, cwd) => {
|
||||||
const stdOut = (0, exports.getCommandOutput)(toolCommand, cwd);
|
const stdOut = (0, exports.getCommandOutput)(toolCommand, cwd);
|
||||||
if (!stdOut) {
|
if (!stdOut) {
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
return stdOut;
|
return stdOut;
|
||||||
});
|
};
|
||||||
exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty;
|
exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty;
|
||||||
const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
|
const getPackageManagerInfo = async (packageManager) => {
|
||||||
if (packageManager === 'npm') {
|
if (packageManager === 'npm') {
|
||||||
return exports.supportedPackageManagers.npm;
|
return exports.supportedPackageManagers.npm;
|
||||||
}
|
}
|
||||||
@ -98768,7 +98749,7 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void
|
|||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
exports.getPackageManagerInfo = getPackageManagerInfo;
|
exports.getPackageManagerInfo = getPackageManagerInfo;
|
||||||
/**
|
/**
|
||||||
* getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
|
* getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
|
||||||
@ -98790,12 +98771,12 @@ exports.resetProjectDirectoriesMemoized = resetProjectDirectoriesMemoized;
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return list of directories and possible
|
* @return list of directories and possible
|
||||||
*/
|
*/
|
||||||
const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const getProjectDirectoriesFromCacheDependencyPath = async (cacheDependencyPath) => {
|
||||||
if (projectDirectoriesMemoized !== null) {
|
if (projectDirectoriesMemoized !== null) {
|
||||||
return projectDirectoriesMemoized;
|
return projectDirectoriesMemoized;
|
||||||
}
|
}
|
||||||
const globber = yield glob.create(cacheDependencyPath);
|
const globber = await glob.create(cacheDependencyPath);
|
||||||
const cacheDependenciesPaths = yield globber.glob();
|
const cacheDependenciesPaths = await globber.glob();
|
||||||
const existingDirectories = cacheDependenciesPaths
|
const existingDirectories = cacheDependenciesPaths
|
||||||
.map(path_1.default.dirname)
|
.map(path_1.default.dirname)
|
||||||
.filter((0, util_1.unique)())
|
.filter((0, util_1.unique)())
|
||||||
@ -98805,7 +98786,7 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|||||||
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
|
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
|
||||||
projectDirectoriesMemoized = existingDirectories;
|
projectDirectoriesMemoized = existingDirectories;
|
||||||
return existingDirectories;
|
return existingDirectories;
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* Finds the cache directories configured for the repo if cache-dependency-path is not empty
|
* Finds the cache directories configured for the repo if cache-dependency-path is not empty
|
||||||
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
||||||
@ -98813,26 +98794,26 @@ const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return list of files on which the cache depends
|
* @return list of files on which the cache depends
|
||||||
*/
|
*/
|
||||||
const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectoriesFromCacheDependencyPath = async (packageManagerInfo, cacheDependencyPath) => {
|
||||||
const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
|
const projectDirectories = await getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
|
||||||
const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () {
|
const cacheFoldersPaths = await Promise.all(projectDirectories.map(async (projectDirectory) => {
|
||||||
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(projectDirectory);
|
const cacheFolderPath = await packageManagerInfo.getCacheFolderPath(projectDirectory);
|
||||||
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
|
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
|
||||||
return cacheFolderPath;
|
return cacheFolderPath;
|
||||||
})));
|
}));
|
||||||
// uniq in order to do not cache the same directories twice
|
// uniq in order to do not cache the same directories twice
|
||||||
return cacheFoldersPaths.filter((0, util_1.unique)());
|
return cacheFoldersPaths.filter((0, util_1.unique)());
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* Finds the cache directories configured for the repo ignoring cache-dependency-path
|
* Finds the cache directories configured for the repo ignoring cache-dependency-path
|
||||||
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
|
||||||
* @return list of files on which the cache depends
|
* @return list of files on which the cache depends
|
||||||
*/
|
*/
|
||||||
const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectoriesForRootProject = async (packageManagerInfo) => {
|
||||||
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath();
|
const cacheFolderPath = await packageManagerInfo.getCacheFolderPath();
|
||||||
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`);
|
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`);
|
||||||
return [cacheFolderPath];
|
return [cacheFolderPath];
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* A function to find the cache directories configured for the repo
|
* A function to find the cache directories configured for the repo
|
||||||
* currently it handles only the case of PM=yarn && cacheDependencyPath is not empty
|
* currently it handles only the case of PM=yarn && cacheDependencyPath is not empty
|
||||||
@ -98841,14 +98822,14 @@ const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return list of files on which the cache depends
|
* @return list of files on which the cache depends
|
||||||
*/
|
*/
|
||||||
const getCacheDirectories = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const getCacheDirectories = async (packageManagerInfo, cacheDependencyPath) => {
|
||||||
// For yarn, if cacheDependencyPath is set, ask information about cache folders in each project
|
// For yarn, if cacheDependencyPath is set, ask information about cache folders in each project
|
||||||
// folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488
|
// folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488
|
||||||
if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) {
|
if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) {
|
||||||
return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath);
|
return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath);
|
||||||
}
|
}
|
||||||
return getCacheDirectoriesForRootProject(packageManagerInfo);
|
return getCacheDirectoriesForRootProject(packageManagerInfo);
|
||||||
});
|
};
|
||||||
exports.getCacheDirectories = getCacheDirectories;
|
exports.getCacheDirectories = getCacheDirectories;
|
||||||
/**
|
/**
|
||||||
* A function to check if the directory is a yarn project configured to manage
|
* A function to check if the directory is a yarn project configured to manage
|
||||||
@ -98860,7 +98841,7 @@ exports.getCacheDirectories = getCacheDirectories;
|
|||||||
* - if local cache is not explicitly enabled (not yarn3), return false
|
* - if local cache is not explicitly enabled (not yarn3), return false
|
||||||
* - return true otherwise
|
* - return true otherwise
|
||||||
*/
|
*/
|
||||||
const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0, void 0, void 0, function* () {
|
const projectHasYarnBerryManagedDependencies = async (directory) => {
|
||||||
const workDir = directory || process.env.GITHUB_WORKSPACE || '.';
|
const workDir = directory || process.env.GITHUB_WORKSPACE || '.';
|
||||||
core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`);
|
core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`);
|
||||||
// if .yarn/cache directory exists the cache is managed by version control system
|
// if .yarn/cache directory exists the cache is managed by version control system
|
||||||
@ -98871,7 +98852,7 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
// NOTE: yarn1 returns 'undefined' with return code = 0
|
// NOTE: yarn1 returns 'undefined' with return code = 0
|
||||||
const enableGlobalCache = yield (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir);
|
const enableGlobalCache = await (0, exports.getCommandOutput)('yarn config get enableGlobalCache', workDir);
|
||||||
// only local cache is not managed by yarn
|
// only local cache is not managed by yarn
|
||||||
const managed = enableGlobalCache.includes('false');
|
const managed = enableGlobalCache.includes('false');
|
||||||
if (managed) {
|
if (managed) {
|
||||||
@ -98882,7 +98863,7 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|||||||
core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`);
|
core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
/**
|
/**
|
||||||
* A function to report the repo contains Yarn managed projects
|
* A function to report the repo contains Yarn managed projects
|
||||||
* @param packageManagerInfo - used to make sure current package manager is yarn
|
* @param packageManagerInfo - used to make sure current package manager is yarn
|
||||||
@ -98890,15 +98871,15 @@ const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0,
|
|||||||
* expected to be the result of `core.getInput('cache-dependency-path')`
|
* expected to be the result of `core.getInput('cache-dependency-path')`
|
||||||
* @return - true if all project directories configured to be Yarn managed
|
* @return - true if all project directories configured to be Yarn managed
|
||||||
*/
|
*/
|
||||||
const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
|
const repoHasYarnBerryManagedDependencies = async (packageManagerInfo, cacheDependencyPath) => {
|
||||||
if (packageManagerInfo.name !== 'yarn')
|
if (packageManagerInfo.name !== 'yarn')
|
||||||
return false;
|
return false;
|
||||||
const yarnDirs = cacheDependencyPath
|
const yarnDirs = cacheDependencyPath
|
||||||
? yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath)
|
? await getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath)
|
||||||
: [''];
|
: [''];
|
||||||
const isManagedList = yield Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies));
|
const isManagedList = await Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies));
|
||||||
return isManagedList.every(Boolean);
|
return isManagedList.every(Boolean);
|
||||||
});
|
};
|
||||||
exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies;
|
exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies;
|
||||||
function isGhes() {
|
function isGhes() {
|
||||||
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
|
||||||
@ -99059,15 +99040,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -99083,19 +99055,20 @@ const path = __importStar(__nccwpck_require__(16928));
|
|||||||
const os_1 = __importDefault(__nccwpck_require__(70857));
|
const os_1 = __importDefault(__nccwpck_require__(70857));
|
||||||
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
||||||
class BaseDistribution {
|
class BaseDistribution {
|
||||||
|
nodeInfo;
|
||||||
|
httpClient;
|
||||||
|
osPlat = os_1.default.platform();
|
||||||
constructor(nodeInfo) {
|
constructor(nodeInfo) {
|
||||||
this.nodeInfo = nodeInfo;
|
this.nodeInfo = nodeInfo;
|
||||||
this.osPlat = os_1.default.platform();
|
|
||||||
this.httpClient = new hc.HttpClient('setup-node', [], {
|
this.httpClient = new hc.HttpClient('setup-node', [], {
|
||||||
allowRetries: true,
|
allowRetries: true,
|
||||||
maxRetries: 3
|
maxRetries: 3
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setupNodeJs() {
|
async setupNodeJs() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let nodeJsVersions;
|
let nodeJsVersions;
|
||||||
if (this.nodeInfo.checkLatest) {
|
if (this.nodeInfo.checkLatest) {
|
||||||
const evaluatedVersion = yield this.findVersionInDist(nodeJsVersions);
|
const evaluatedVersion = await this.findVersionInDist(nodeJsVersions);
|
||||||
this.nodeInfo.versionSpec = evaluatedVersion;
|
this.nodeInfo.versionSpec = evaluatedVersion;
|
||||||
}
|
}
|
||||||
let toolPath = this.findVersionInHostedToolCacheDirectory();
|
let toolPath = this.findVersionInHostedToolCacheDirectory();
|
||||||
@ -99103,20 +99076,18 @@ class BaseDistribution {
|
|||||||
core.info(`Found in cache @ ${toolPath}`);
|
core.info(`Found in cache @ ${toolPath}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const evaluatedVersion = yield this.findVersionInDist(nodeJsVersions);
|
const evaluatedVersion = await this.findVersionInDist(nodeJsVersions);
|
||||||
const toolName = this.getNodejsDistInfo(evaluatedVersion);
|
const toolName = this.getNodejsDistInfo(evaluatedVersion);
|
||||||
toolPath = yield this.downloadNodejs(toolName);
|
toolPath = await this.downloadNodejs(toolName);
|
||||||
}
|
}
|
||||||
if (this.osPlat != 'win32') {
|
if (this.osPlat != 'win32') {
|
||||||
toolPath = path.join(toolPath, 'bin');
|
toolPath = path.join(toolPath, 'bin');
|
||||||
}
|
}
|
||||||
core.addPath(toolPath);
|
core.addPath(toolPath);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
findVersionInDist(nodeJsVersions) {
|
async findVersionInDist(nodeJsVersions) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (!nodeJsVersions) {
|
if (!nodeJsVersions) {
|
||||||
nodeJsVersions = yield this.getNodeJsVersions();
|
nodeJsVersions = await this.getNodeJsVersions();
|
||||||
}
|
}
|
||||||
const versions = this.filterVersions(nodeJsVersions);
|
const versions = this.filterVersions(nodeJsVersions);
|
||||||
const evaluatedVersion = this.evaluateVersions(versions);
|
const evaluatedVersion = this.evaluateVersions(versions);
|
||||||
@ -99124,7 +99095,6 @@ class BaseDistribution {
|
|||||||
throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
|
throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`);
|
||||||
}
|
}
|
||||||
return evaluatedVersion;
|
return evaluatedVersion;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
evaluateVersions(versions) {
|
evaluateVersions(versions) {
|
||||||
let version = '';
|
let version = '';
|
||||||
@ -99148,17 +99118,15 @@ class BaseDistribution {
|
|||||||
findVersionInHostedToolCacheDirectory() {
|
findVersionInHostedToolCacheDirectory() {
|
||||||
return tc.find('node', this.nodeInfo.versionSpec, this.translateArchToDistUrl(this.nodeInfo.arch));
|
return tc.find('node', this.nodeInfo.versionSpec, this.translateArchToDistUrl(this.nodeInfo.arch));
|
||||||
}
|
}
|
||||||
getNodeJsVersions() {
|
async getNodeJsVersions() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror);
|
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror);
|
||||||
const dataUrl = `${initialUrl}/index.json`;
|
const dataUrl = `${initialUrl}/index.json`;
|
||||||
const headers = {};
|
const headers = {};
|
||||||
if (this.nodeInfo.mirrorToken) {
|
if (this.nodeInfo.mirrorToken) {
|
||||||
headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;
|
headers['Authorization'] = `Bearer ${this.nodeInfo.mirrorToken}`;
|
||||||
}
|
}
|
||||||
const response = yield this.httpClient.getJson(dataUrl, headers);
|
const response = await this.httpClient.getJson(dataUrl, headers);
|
||||||
return response.result || [];
|
return response.result || [];
|
||||||
});
|
|
||||||
}
|
}
|
||||||
getNodejsDistInfo(version) {
|
getNodejsDistInfo(version) {
|
||||||
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
||||||
@ -99180,35 +99148,31 @@ class BaseDistribution {
|
|||||||
fileName: fileName
|
fileName: fileName
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
downloadNodejs(info) {
|
async downloadNodejs(info) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let downloadPath = '';
|
let downloadPath = '';
|
||||||
core.info(`Acquiring ${info.resolvedVersion} - ${info.arch} from ${info.downloadUrl}`);
|
core.info(`Acquiring ${info.resolvedVersion} - ${info.arch} from ${info.downloadUrl}`);
|
||||||
try {
|
try {
|
||||||
downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, this.nodeInfo.mirrorToken);
|
downloadPath = await tc.downloadTool(info.downloadUrl, undefined, this.nodeInfo.mirrorToken);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (err instanceof tc.HTTPError &&
|
if (err instanceof tc.HTTPError &&
|
||||||
err.httpStatusCode == 404 &&
|
err.httpStatusCode == 404 &&
|
||||||
this.osPlat == 'win32') {
|
this.osPlat == 'win32') {
|
||||||
return yield this.acquireWindowsNodeFromFallbackLocation(info.resolvedVersion, info.arch);
|
return await this.acquireWindowsNodeFromFallbackLocation(info.resolvedVersion, info.arch);
|
||||||
}
|
}
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
const toolPath = yield this.extractArchive(downloadPath, info, true);
|
const toolPath = await this.extractArchive(downloadPath, info, true);
|
||||||
core.info('Done');
|
core.info('Done');
|
||||||
return toolPath;
|
return toolPath;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
validRange(versionSpec) {
|
validRange(versionSpec) {
|
||||||
var _a;
|
|
||||||
let options;
|
let options;
|
||||||
const c = semver_1.default.clean(versionSpec) || '';
|
const c = semver_1.default.clean(versionSpec) || '';
|
||||||
const valid = (_a = semver_1.default.valid(c)) !== null && _a !== void 0 ? _a : versionSpec;
|
const valid = semver_1.default.valid(c) ?? versionSpec;
|
||||||
return { range: valid, options };
|
return { range: valid, options };
|
||||||
}
|
}
|
||||||
acquireWindowsNodeFromFallbackLocation(version_1) {
|
async acquireWindowsNodeFromFallbackLocation(version, arch = os_1.default.arch()) {
|
||||||
return __awaiter(this, arguments, void 0, function* (version, arch = os_1.default.arch()) {
|
|
||||||
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror);
|
const initialUrl = this.getDistributionUrl(this.nodeInfo.mirror);
|
||||||
const osArch = this.translateArchToDistUrl(arch);
|
const osArch = this.translateArchToDistUrl(arch);
|
||||||
// Create temporary folder to download to
|
// Create temporary folder to download to
|
||||||
@ -99216,37 +99180,35 @@ class BaseDistribution {
|
|||||||
const tempDirectory = process.env['RUNNER_TEMP'] || '';
|
const tempDirectory = process.env['RUNNER_TEMP'] || '';
|
||||||
assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
|
assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
|
||||||
const tempDir = path.join(tempDirectory, tempDownloadFolder);
|
const tempDir = path.join(tempDirectory, tempDownloadFolder);
|
||||||
yield io.mkdirP(tempDir);
|
await io.mkdirP(tempDir);
|
||||||
let exeUrl;
|
let exeUrl;
|
||||||
let libUrl;
|
let libUrl;
|
||||||
try {
|
try {
|
||||||
exeUrl = `${initialUrl}/v${version}/win-${osArch}/node.exe`;
|
exeUrl = `${initialUrl}/v${version}/win-${osArch}/node.exe`;
|
||||||
libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`;
|
libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`;
|
||||||
core.info(`Downloading only node binary from ${exeUrl}`);
|
core.info(`Downloading only node binary from ${exeUrl}`);
|
||||||
const exePath = yield tc.downloadTool(exeUrl, undefined, this.nodeInfo.mirrorToken);
|
const exePath = await tc.downloadTool(exeUrl, undefined, this.nodeInfo.mirrorToken);
|
||||||
yield io.cp(exePath, path.join(tempDir, 'node.exe'));
|
await io.cp(exePath, path.join(tempDir, 'node.exe'));
|
||||||
const libPath = yield tc.downloadTool(libUrl, undefined, this.nodeInfo.mirrorToken);
|
const libPath = await tc.downloadTool(libUrl, undefined, this.nodeInfo.mirrorToken);
|
||||||
yield io.cp(libPath, path.join(tempDir, 'node.lib'));
|
await io.cp(libPath, path.join(tempDir, 'node.lib'));
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
|
if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
|
||||||
exeUrl = `${initialUrl}/v${version}/node.exe`;
|
exeUrl = `${initialUrl}/v${version}/node.exe`;
|
||||||
libUrl = `${initialUrl}/v${version}/node.lib`;
|
libUrl = `${initialUrl}/v${version}/node.lib`;
|
||||||
const exePath = yield tc.downloadTool(exeUrl, undefined, this.nodeInfo.mirrorToken);
|
const exePath = await tc.downloadTool(exeUrl, undefined, this.nodeInfo.mirrorToken);
|
||||||
yield io.cp(exePath, path.join(tempDir, 'node.exe'));
|
await io.cp(exePath, path.join(tempDir, 'node.exe'));
|
||||||
const libPath = yield tc.downloadTool(libUrl, undefined, this.nodeInfo.mirrorToken);
|
const libPath = await tc.downloadTool(libUrl, undefined, this.nodeInfo.mirrorToken);
|
||||||
yield io.cp(libPath, path.join(tempDir, 'node.lib'));
|
await io.cp(libPath, path.join(tempDir, 'node.lib'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const toolPath = yield tc.cacheDir(tempDir, 'node', version, arch);
|
const toolPath = await tc.cacheDir(tempDir, 'node', version, arch);
|
||||||
return toolPath;
|
return toolPath;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
extractArchive(downloadPath, info, isOfficialArchive) {
|
async extractArchive(downloadPath, info, isOfficialArchive) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
//
|
//
|
||||||
// Extract
|
// Extract
|
||||||
//
|
//
|
||||||
@ -99263,11 +99225,11 @@ class BaseDistribution {
|
|||||||
if (extension === '.zip' && isOfficialArchive) {
|
if (extension === '.zip' && isOfficialArchive) {
|
||||||
const renamedArchive = `${downloadPath}.zip`;
|
const renamedArchive = `${downloadPath}.zip`;
|
||||||
fs_1.default.renameSync(downloadPath, renamedArchive);
|
fs_1.default.renameSync(downloadPath, renamedArchive);
|
||||||
extPath = yield tc.extractZip(renamedArchive);
|
extPath = await tc.extractZip(renamedArchive);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const _7zPath = path.join(__dirname, '../..', 'externals', '7zr.exe');
|
const _7zPath = path.join(__dirname, '../..', 'externals', '7zr.exe');
|
||||||
extPath = yield tc.extract7z(downloadPath, undefined, _7zPath);
|
extPath = await tc.extract7z(downloadPath, undefined, _7zPath);
|
||||||
}
|
}
|
||||||
// 7z extracts to folder matching file name
|
// 7z extracts to folder matching file name
|
||||||
const nestedPath = path.join(extPath, path.basename(info.fileName, extension));
|
const nestedPath = path.join(extPath, path.basename(info.fileName, extension));
|
||||||
@ -99276,7 +99238,7 @@ class BaseDistribution {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
extPath = yield tc.extractTar(downloadPath, undefined, [
|
extPath = await tc.extractTar(downloadPath, undefined, [
|
||||||
'xz',
|
'xz',
|
||||||
'--strip',
|
'--strip',
|
||||||
'1'
|
'1'
|
||||||
@ -99286,9 +99248,8 @@ class BaseDistribution {
|
|||||||
// Install into the local tool cache - node extracts with a root folder that matches the fileName downloaded
|
// Install into the local tool cache - node extracts with a root folder that matches the fileName downloaded
|
||||||
//
|
//
|
||||||
core.info('Adding to the cache ...');
|
core.info('Adding to the cache ...');
|
||||||
const toolPath = yield tc.cacheDir(extPath, 'node', info.resolvedVersion, info.arch);
|
const toolPath = await tc.cacheDir(extPath, 'node', info.resolvedVersion, info.arch);
|
||||||
return toolPath;
|
return toolPath;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
getDistFileName() {
|
getDistFileName() {
|
||||||
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
||||||
@ -99393,9 +99354,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const base_distribution_prerelease_1 = __importDefault(__nccwpck_require__(74864));
|
const base_distribution_prerelease_1 = __importDefault(__nccwpck_require__(74864));
|
||||||
class NightlyNodejs extends base_distribution_prerelease_1.default {
|
class NightlyNodejs extends base_distribution_prerelease_1.default {
|
||||||
|
distribution = 'nightly';
|
||||||
constructor(nodeInfo) {
|
constructor(nodeInfo) {
|
||||||
super(nodeInfo);
|
super(nodeInfo);
|
||||||
this.distribution = 'nightly';
|
|
||||||
}
|
}
|
||||||
getDistributionUrl(mirror) {
|
getDistributionUrl(mirror) {
|
||||||
const url = mirror || 'https://nodejs.org';
|
const url = mirror || 'https://nodejs.org';
|
||||||
@ -99435,15 +99396,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -99456,27 +99408,25 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
constructor(nodeInfo) {
|
constructor(nodeInfo) {
|
||||||
super(nodeInfo);
|
super(nodeInfo);
|
||||||
}
|
}
|
||||||
setupNodeJs() {
|
async setupNodeJs() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
var _a;
|
|
||||||
let manifest;
|
let manifest;
|
||||||
let nodeJsVersions;
|
let nodeJsVersions;
|
||||||
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
const osArch = this.translateArchToDistUrl(this.nodeInfo.arch);
|
||||||
if (this.isLtsAlias(this.nodeInfo.versionSpec)) {
|
if (this.isLtsAlias(this.nodeInfo.versionSpec)) {
|
||||||
core.info('Attempt to resolve LTS alias from manifest...');
|
core.info('Attempt to resolve LTS alias from manifest...');
|
||||||
// No try-catch since it's not possible to resolve LTS alias without manifest
|
// No try-catch since it's not possible to resolve LTS alias without manifest
|
||||||
manifest = yield this.getManifest();
|
manifest = await this.getManifest();
|
||||||
this.nodeInfo.versionSpec = this.resolveLtsAliasFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, manifest);
|
this.nodeInfo.versionSpec = this.resolveLtsAliasFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, manifest);
|
||||||
}
|
}
|
||||||
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
if (this.isLatestSyntax(this.nodeInfo.versionSpec)) {
|
||||||
nodeJsVersions = yield this.getNodeJsVersions();
|
nodeJsVersions = await this.getNodeJsVersions();
|
||||||
const versions = this.filterVersions(nodeJsVersions);
|
const versions = this.filterVersions(nodeJsVersions);
|
||||||
this.nodeInfo.versionSpec = this.evaluateVersions(versions);
|
this.nodeInfo.versionSpec = this.evaluateVersions(versions);
|
||||||
core.info('getting latest node version...');
|
core.info('getting latest node version...');
|
||||||
}
|
}
|
||||||
if (this.nodeInfo.checkLatest) {
|
if (this.nodeInfo.checkLatest) {
|
||||||
core.info('Attempt to resolve the latest version from manifest...');
|
core.info('Attempt to resolve the latest version from manifest...');
|
||||||
const resolvedVersion = yield this.resolveVersionFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
|
const resolvedVersion = await this.resolveVersionFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
|
||||||
if (resolvedVersion) {
|
if (resolvedVersion) {
|
||||||
this.nodeInfo.versionSpec = resolvedVersion;
|
this.nodeInfo.versionSpec = resolvedVersion;
|
||||||
core.info(`Resolved as '${resolvedVersion}'`);
|
core.info(`Resolved as '${resolvedVersion}'`);
|
||||||
@ -99494,12 +99444,12 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
let downloadPath = '';
|
let downloadPath = '';
|
||||||
try {
|
try {
|
||||||
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
|
core.info(`Attempting to download ${this.nodeInfo.versionSpec}...`);
|
||||||
const versionInfo = yield this.getInfoFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
|
const versionInfo = await this.getInfoFromManifest(this.nodeInfo.versionSpec, this.nodeInfo.stable, osArch, manifest);
|
||||||
if (versionInfo) {
|
if (versionInfo) {
|
||||||
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
|
core.info(`Acquiring ${versionInfo.resolvedVersion} - ${versionInfo.arch} from ${versionInfo.downloadUrl}`);
|
||||||
downloadPath = yield tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth);
|
downloadPath = await tc.downloadTool(versionInfo.downloadUrl, undefined, this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth);
|
||||||
if (downloadPath) {
|
if (downloadPath) {
|
||||||
toolPath = yield this.extractArchive(downloadPath, versionInfo, false);
|
toolPath = await this.extractArchive(downloadPath, versionInfo, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -99515,17 +99465,16 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
else {
|
else {
|
||||||
core.info(err.message);
|
core.info(err.message);
|
||||||
}
|
}
|
||||||
core.debug((_a = err.stack) !== null && _a !== void 0 ? _a : 'empty stack');
|
core.debug(err.stack ?? 'empty stack');
|
||||||
core.info('Falling back to download directly from Node');
|
core.info('Falling back to download directly from Node');
|
||||||
}
|
}
|
||||||
if (!toolPath) {
|
if (!toolPath) {
|
||||||
toolPath = yield this.downloadDirectlyFromNode();
|
toolPath = await this.downloadDirectlyFromNode();
|
||||||
}
|
}
|
||||||
if (this.osPlat != 'win32') {
|
if (this.osPlat != 'win32') {
|
||||||
toolPath = path_1.default.join(toolPath, 'bin');
|
toolPath = path_1.default.join(toolPath, 'bin');
|
||||||
}
|
}
|
||||||
core.addPath(toolPath);
|
core.addPath(toolPath);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
addToolPath(toolPath) {
|
addToolPath(toolPath) {
|
||||||
if (this.osPlat != 'win32') {
|
if (this.osPlat != 'win32') {
|
||||||
@ -99533,9 +99482,8 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
}
|
}
|
||||||
core.addPath(toolPath);
|
core.addPath(toolPath);
|
||||||
}
|
}
|
||||||
downloadDirectlyFromNode() {
|
async downloadDirectlyFromNode() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
const nodeJsVersions = await this.getNodeJsVersions();
|
||||||
const nodeJsVersions = yield this.getNodeJsVersions();
|
|
||||||
const versions = this.filterVersions(nodeJsVersions);
|
const versions = this.filterVersions(nodeJsVersions);
|
||||||
const evaluatedVersion = this.evaluateVersions(versions);
|
const evaluatedVersion = this.evaluateVersions(versions);
|
||||||
if (!evaluatedVersion) {
|
if (!evaluatedVersion) {
|
||||||
@ -99543,7 +99491,7 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
}
|
}
|
||||||
const toolName = this.getNodejsDistInfo(evaluatedVersion);
|
const toolName = this.getNodejsDistInfo(evaluatedVersion);
|
||||||
try {
|
try {
|
||||||
const toolPath = yield this.downloadNodejs(toolName);
|
const toolPath = await this.downloadNodejs(toolName);
|
||||||
return toolPath;
|
return toolPath;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
@ -99554,7 +99502,6 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
evaluateVersions(versions) {
|
evaluateVersions(versions) {
|
||||||
let version = '';
|
let version = '';
|
||||||
@ -99574,8 +99521,7 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
return tc.getManifestFromRepo('actions', 'node-versions', this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth, 'main');
|
return tc.getManifestFromRepo('actions', 'node-versions', this.nodeInfo.mirror ? this.nodeInfo.mirrorToken : this.nodeInfo.auth, 'main');
|
||||||
}
|
}
|
||||||
resolveLtsAliasFromManifest(versionSpec, stable, manifest) {
|
resolveLtsAliasFromManifest(versionSpec, stable, manifest) {
|
||||||
var _a;
|
const alias = versionSpec.split('lts/')[1]?.toLowerCase();
|
||||||
const alias = (_a = versionSpec.split('lts/')[1]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
|
|
||||||
if (!alias) {
|
if (!alias) {
|
||||||
throw new Error(`Unable to parse LTS alias for Node version '${versionSpec}'`);
|
throw new Error(`Unable to parse LTS alias for Node version '${versionSpec}'`);
|
||||||
}
|
}
|
||||||
@ -99598,26 +99544,23 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
core.debug(`Found LTS release '${release.version}' for Node version '${versionSpec}'`);
|
core.debug(`Found LTS release '${release.version}' for Node version '${versionSpec}'`);
|
||||||
return release.version.split('.')[0];
|
return release.version.split('.')[0];
|
||||||
}
|
}
|
||||||
resolveVersionFromManifest(versionSpec, stable, osArch, manifest) {
|
async resolveVersionFromManifest(versionSpec, stable, osArch, manifest) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
const info = yield this.getInfoFromManifest(versionSpec, stable, osArch, manifest);
|
const info = await this.getInfoFromManifest(versionSpec, stable, osArch, manifest);
|
||||||
return info === null || info === void 0 ? void 0 : info.resolvedVersion;
|
return info?.resolvedVersion;
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
core.info('Unable to resolve version from manifest...');
|
core.info('Unable to resolve version from manifest...');
|
||||||
core.debug(err.message);
|
core.debug(err.message);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
getInfoFromManifest(versionSpec, stable, osArch, manifest) {
|
async getInfoFromManifest(versionSpec, stable, osArch, manifest) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let info = null;
|
let info = null;
|
||||||
if (!manifest) {
|
if (!manifest) {
|
||||||
core.debug('No manifest cached');
|
core.debug('No manifest cached');
|
||||||
manifest = yield this.getManifest();
|
manifest = await this.getManifest();
|
||||||
}
|
}
|
||||||
const rel = yield tc.findFromManifest(versionSpec, stable, manifest, osArch);
|
const rel = await tc.findFromManifest(versionSpec, stable, manifest, osArch);
|
||||||
if (rel && rel.files.length > 0) {
|
if (rel && rel.files.length > 0) {
|
||||||
info = {};
|
info = {};
|
||||||
info.resolvedVersion = rel.version;
|
info.resolvedVersion = rel.version;
|
||||||
@ -99626,7 +99569,6 @@ class OfficialBuilds extends base_distribution_1.default {
|
|||||||
info.fileName = rel.files[0].filename;
|
info.fileName = rel.files[0].filename;
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
isLtsAlias(versionSpec) {
|
isLtsAlias(versionSpec) {
|
||||||
return versionSpec.startsWith('lts/');
|
return versionSpec.startsWith('lts/');
|
||||||
@ -99675,9 +99617,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const base_distribution_prerelease_1 = __importDefault(__nccwpck_require__(74864));
|
const base_distribution_prerelease_1 = __importDefault(__nccwpck_require__(74864));
|
||||||
class CanaryBuild extends base_distribution_prerelease_1.default {
|
class CanaryBuild extends base_distribution_prerelease_1.default {
|
||||||
|
distribution = 'v8-canary';
|
||||||
constructor(nodeInfo) {
|
constructor(nodeInfo) {
|
||||||
super(nodeInfo);
|
super(nodeInfo);
|
||||||
this.distribution = 'v8-canary';
|
|
||||||
}
|
}
|
||||||
getDistributionUrl(mirror) {
|
getDistributionUrl(mirror) {
|
||||||
const url = mirror || 'https://nodejs.org';
|
const url = mirror || 'https://nodejs.org';
|
||||||
@ -99717,15 +99659,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -99741,8 +99674,7 @@ const cache_utils_1 = __nccwpck_require__(4673);
|
|||||||
const installer_factory_1 = __nccwpck_require__(41180);
|
const installer_factory_1 = __nccwpck_require__(41180);
|
||||||
const util_1 = __nccwpck_require__(54527);
|
const util_1 = __nccwpck_require__(54527);
|
||||||
const constants_1 = __nccwpck_require__(27242);
|
const constants_1 = __nccwpck_require__(27242);
|
||||||
function run() {
|
async function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
//
|
//
|
||||||
// Version is optional. If supplied, install / use from the tool cache
|
// Version is optional. If supplied, install / use from the tool cache
|
||||||
@ -99778,20 +99710,19 @@ function run() {
|
|||||||
mirrorToken
|
mirrorToken
|
||||||
};
|
};
|
||||||
const nodeDistribution = (0, installer_factory_1.getNodejsDistribution)(nodejsInfo);
|
const nodeDistribution = (0, installer_factory_1.getNodejsDistribution)(nodejsInfo);
|
||||||
yield nodeDistribution.setupNodeJs();
|
await nodeDistribution.setupNodeJs();
|
||||||
}
|
}
|
||||||
yield (0, util_1.printEnvDetailsAndSetOutput)();
|
await (0, util_1.printEnvDetailsAndSetOutput)();
|
||||||
const registryUrl = core.getInput('registry-url');
|
const registryUrl = core.getInput('registry-url');
|
||||||
const alwaysAuth = core.getInput('always-auth');
|
|
||||||
if (registryUrl) {
|
if (registryUrl) {
|
||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl);
|
||||||
}
|
}
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
if ((0, cache_utils_1.isCacheFeatureAvailable)()) {
|
if ((0, cache_utils_1.isCacheFeatureAvailable)()) {
|
||||||
// if the cache input is provided, use it for caching.
|
// if the cache input is provided, use it for caching.
|
||||||
if (cache) {
|
if (cache) {
|
||||||
core.saveState(constants_1.State.CachePackageManager, cache);
|
core.saveState(constants_1.State.CachePackageManager, cache);
|
||||||
yield (0, cache_restore_1.restoreCache)(cache, cacheDependencyPath);
|
await (0, cache_restore_1.restoreCache)(cache, cacheDependencyPath);
|
||||||
// package manager npm is detected from package.json, enable auto-caching for npm.
|
// package manager npm is detected from package.json, enable auto-caching for npm.
|
||||||
}
|
}
|
||||||
else if (packagemanagercache) {
|
else if (packagemanagercache) {
|
||||||
@ -99800,7 +99731,7 @@ function run() {
|
|||||||
core.info("Detected npm as the package manager from package.json's packageManager field. " +
|
core.info("Detected npm as the package manager from package.json's packageManager field. " +
|
||||||
'Auto caching has been enabled for npm. If you want to disable it, set package-manager-cache input to false');
|
'Auto caching has been enabled for npm. If you want to disable it, set package-manager-cache input to false');
|
||||||
core.saveState(constants_1.State.CachePackageManager, resolvedPackageManager);
|
core.saveState(constants_1.State.CachePackageManager, resolvedPackageManager);
|
||||||
yield (0, cache_restore_1.restoreCache)(resolvedPackageManager, cacheDependencyPath);
|
await (0, cache_restore_1.restoreCache)(resolvedPackageManager, cacheDependencyPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99812,7 +99743,6 @@ function run() {
|
|||||||
catch (err) {
|
catch (err) {
|
||||||
core.setFailed(err.message);
|
core.setFailed(err.message);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.run = run;
|
exports.run = run;
|
||||||
function resolveVersionInput() {
|
function resolveVersionInput() {
|
||||||
@ -99838,26 +99768,25 @@ function resolveVersionInput() {
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
function getNameFromPackageManagerField() {
|
function getNameFromPackageManagerField() {
|
||||||
var _a;
|
|
||||||
const npmRegex = /^(\^)?npm(@.*)?$/; // matches "npm", "npm@...", "^npm@..."
|
const npmRegex = /^(\^)?npm(@.*)?$/; // matches "npm", "npm@...", "^npm@..."
|
||||||
try {
|
try {
|
||||||
const packageJson = JSON.parse(fs_1.default.readFileSync(path.join(process.env.GITHUB_WORKSPACE, 'package.json'), 'utf-8'));
|
const packageJson = JSON.parse(fs_1.default.readFileSync(path.join(process.env.GITHUB_WORKSPACE, 'package.json'), 'utf-8'));
|
||||||
// Check devEngines.packageManager first (object or array)
|
// Check devEngines.packageManager first (object or array)
|
||||||
const devPM = (_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.devEngines) === null || _a === void 0 ? void 0 : _a.packageManager;
|
const devPM = packageJson?.devEngines?.packageManager;
|
||||||
const devPMArray = devPM ? (Array.isArray(devPM) ? devPM : [devPM]) : [];
|
const devPMArray = devPM ? (Array.isArray(devPM) ? devPM : [devPM]) : [];
|
||||||
for (const obj of devPMArray) {
|
for (const obj of devPMArray) {
|
||||||
if (typeof (obj === null || obj === void 0 ? void 0 : obj.name) === 'string' && npmRegex.test(obj.name)) {
|
if (typeof obj?.name === 'string' && npmRegex.test(obj.name)) {
|
||||||
return 'npm';
|
return 'npm';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check top-level packageManager
|
// Check top-level packageManager
|
||||||
const topLevelPM = packageJson === null || packageJson === void 0 ? void 0 : packageJson.packageManager;
|
const topLevelPM = packageJson?.packageManager;
|
||||||
if (typeof topLevelPM === 'string' && npmRegex.test(topLevelPM)) {
|
if (typeof topLevelPM === 'string' && npmRegex.test(topLevelPM)) {
|
||||||
return 'npm';
|
return 'npm';
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
catch (_b) {
|
catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99894,15 +99823,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
__setModuleDefault(result, mod);
|
__setModuleDefault(result, mod);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
@ -99914,7 +99834,6 @@ const io = __importStar(__nccwpck_require__(94994));
|
|||||||
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
const fs_1 = __importDefault(__nccwpck_require__(79896));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(16928));
|
const path_1 = __importDefault(__nccwpck_require__(16928));
|
||||||
function getNodeVersionFromFile(versionFilePath) {
|
function getNodeVersionFromFile(versionFilePath) {
|
||||||
var _a, _b, _c, _d, _e;
|
|
||||||
if (!fs_1.default.existsSync(versionFilePath)) {
|
if (!fs_1.default.existsSync(versionFilePath)) {
|
||||||
throw new Error(`The specified node version file at: ${versionFilePath} does not exist`);
|
throw new Error(`The specified node version file at: ${versionFilePath} does not exist`);
|
||||||
}
|
}
|
||||||
@ -99926,15 +99845,15 @@ function getNodeVersionFromFile(versionFilePath) {
|
|||||||
if (typeof manifest === 'object' && !!manifest) {
|
if (typeof manifest === 'object' && !!manifest) {
|
||||||
// Support Volta.
|
// Support Volta.
|
||||||
// See https://docs.volta.sh/guide/understanding#managing-your-project
|
// See https://docs.volta.sh/guide/understanding#managing-your-project
|
||||||
if ((_a = manifest.volta) === null || _a === void 0 ? void 0 : _a.node) {
|
if (manifest.volta?.node) {
|
||||||
return manifest.volta.node;
|
return manifest.volta.node;
|
||||||
}
|
}
|
||||||
if ((_b = manifest.engines) === null || _b === void 0 ? void 0 : _b.node) {
|
if (manifest.engines?.node) {
|
||||||
return manifest.engines.node;
|
return manifest.engines.node;
|
||||||
}
|
}
|
||||||
// Support Volta workspaces.
|
// Support Volta workspaces.
|
||||||
// See https://docs.volta.sh/advanced/workspaces
|
// See https://docs.volta.sh/advanced/workspaces
|
||||||
if ((_c = manifest.volta) === null || _c === void 0 ? void 0 : _c.extends) {
|
if (manifest.volta?.extends) {
|
||||||
const extendedFilePath = path_1.default.resolve(path_1.default.dirname(versionFilePath), manifest.volta.extends);
|
const extendedFilePath = path_1.default.resolve(path_1.default.dirname(versionFilePath), manifest.volta.extends);
|
||||||
core.info('Resolving node version from ' + extendedFilePath);
|
core.info('Resolving node version from ' + extendedFilePath);
|
||||||
return getNodeVersionFromFile(extendedFilePath);
|
return getNodeVersionFromFile(extendedFilePath);
|
||||||
@ -99951,22 +99870,21 @@ function getNodeVersionFromFile(versionFilePath) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (_f) {
|
catch {
|
||||||
core.info('Node version file is not JSON file');
|
core.info('Node version file is not JSON file');
|
||||||
}
|
}
|
||||||
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
|
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
|
||||||
return (_e = (_d = found === null || found === void 0 ? void 0 : found.groups) === null || _d === void 0 ? void 0 : _d.version) !== null && _e !== void 0 ? _e : contents.trim();
|
return found?.groups?.version ?? contents.trim();
|
||||||
}
|
}
|
||||||
exports.getNodeVersionFromFile = getNodeVersionFromFile;
|
exports.getNodeVersionFromFile = getNodeVersionFromFile;
|
||||||
function printEnvDetailsAndSetOutput() {
|
async function printEnvDetailsAndSetOutput() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
core.startGroup('Environment details');
|
core.startGroup('Environment details');
|
||||||
const promises = ['node', 'npm', 'yarn', 'pnpm'].map((tool) => __awaiter(this, void 0, void 0, function* () {
|
const promises = ['node', 'npm', 'yarn', 'pnpm'].map(async (tool) => {
|
||||||
const pathTool = yield io.which(tool, false);
|
const pathTool = await io.which(tool, false);
|
||||||
const output = pathTool ? yield getToolVersion(tool, ['--version']) : '';
|
const output = pathTool ? await getToolVersion(tool, ['--version']) : '';
|
||||||
return { tool, output };
|
return { tool, output };
|
||||||
}));
|
});
|
||||||
const tools = yield Promise.all(promises);
|
const tools = await Promise.all(promises);
|
||||||
tools.forEach(({ tool, output }) => {
|
tools.forEach(({ tool, output }) => {
|
||||||
if (tool === 'node') {
|
if (tool === 'node') {
|
||||||
core.setOutput(`${tool}-version`, output);
|
core.setOutput(`${tool}-version`, output);
|
||||||
@ -99974,13 +99892,11 @@ function printEnvDetailsAndSetOutput() {
|
|||||||
core.info(`${tool}: ${output}`);
|
core.info(`${tool}: ${output}`);
|
||||||
});
|
});
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
|
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
|
||||||
function getToolVersion(tool, options) {
|
async function getToolVersion(tool, options) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
try {
|
||||||
const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, {
|
const { stdout, stderr, exitCode } = await exec.getExecOutput(tool, options, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true
|
silent: true
|
||||||
});
|
});
|
||||||
@ -99993,7 +99909,6 @@ function getToolVersion(tool, options) {
|
|||||||
catch (err) {
|
catch (err) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const unique = () => {
|
const unique = () => {
|
||||||
const encountered = new Set();
|
const encountered = new Set();
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Currently, `actions/setup-node` supports caching dependencies for Npm and Yarn p
|
|||||||
For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root.
|
For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root.
|
||||||
Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities)
|
Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities)
|
||||||
|
|
||||||
Obviously, it made build-in caching unusable for mono-repos and repos with complex structure.
|
Obviously, it made built-in caching unusable for mono-repos and repos with complex structure.
|
||||||
We would like to revisit this decision and add customization for dependencies lock file location.
|
We would like to revisit this decision and add customization for dependencies lock file location.
|
||||||
|
|
||||||
## Proposal
|
## Proposal
|
||||||
@ -24,7 +24,7 @@ The second option looks more generic because it allows to:
|
|||||||
## Decision
|
## Decision
|
||||||
|
|
||||||
Add `cache-dependency-path` input that will accept path (relative to repository root) to dependencies lock file.
|
Add `cache-dependency-path` input that will accept path (relative to repository root) to dependencies lock file.
|
||||||
If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/package-lock.json') }}` YAML construction does.
|
If provided path contains wildcards, the action will search all matching files and calculate common hash like `${{ hashFiles('**/package-lock.json') }}` YAML construction does.
|
||||||
The hash of provided matched files will be used as a part of cache key.
|
The hash of provided matched files will be used as a part of cache key.
|
||||||
|
|
||||||
Yaml examples:
|
Yaml examples:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
## Working with lockfiles
|
## Working with lockfiles
|
||||||
|
|
||||||
All supported package managers recommend that you **always** commit the lockfile, although implementations vary doing so generally provides the following benefits:
|
Most supported package managers recommend that you **always** commit the lockfile, although implementations vary doing so generally provides the following benefits:
|
||||||
|
|
||||||
- Enables faster installation for CI and production environments, due to being able to skip package resolution.
|
- Enables faster installation for CI and production environments, due to being able to skip package resolution.
|
||||||
- Describes a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.
|
- Describes a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies.
|
||||||
@ -35,6 +35,25 @@ Ensure that `pnpm-lock.yaml` is always committed, when on CI pass `--frozen-lock
|
|||||||
- [Working with Git - Lockfiles](https://pnpm.io/git#lockfiles)
|
- [Working with Git - Lockfiles](https://pnpm.io/git#lockfiles)
|
||||||
- [Documentation of `--frozen-lockfile` option](https://pnpm.io/cli/install#--frozen-lockfile)
|
- [Documentation of `--frozen-lockfile` option](https://pnpm.io/cli/install#--frozen-lockfile)
|
||||||
|
|
||||||
|
### Running without a lockfile
|
||||||
|
|
||||||
|
If you choose not to use a lockfile, you must ensure that **caching is disabled**. The `cache` feature relies on the lockfile to generate a unique key for the cache entry.
|
||||||
|
|
||||||
|
To run without a lockfile:
|
||||||
|
1. Do not set the `cache` input.
|
||||||
|
2. If your `package.json` contains a `packageManager` field set to npm (or devEngines.packageManager), automatic caching is enabled by default. Override this by setting `package-manager-cache: false`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: '24'
|
||||||
|
package-manager-cache: false # Explicitly disable caching if you don't have a lockfile
|
||||||
|
- run: npm install
|
||||||
|
- run: npm test
|
||||||
|
```
|
||||||
|
|
||||||
## Check latest version
|
## Check latest version
|
||||||
|
|
||||||
The `check-latest` flag defaults to `false`. When set to `false`, the action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/). Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific version of Node.js is always used.
|
The `check-latest` flag defaults to `false`. When set to `false`, the action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/). Use the default or set `check-latest` to `false` if you prefer stability and if you want to ensure a specific version of Node.js is always used.
|
||||||
@ -45,7 +64,7 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
@ -63,7 +82,7 @@ See [supported version syntax](https://github.com/actions/setup-node#supported-v
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
@ -97,7 +116,7 @@ jobs:
|
|||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
@ -118,7 +137,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.0.0-v8-canary' # it will install the latest v8 canary release for node 24.0.0
|
node-version: '24.0.0-v8-canary' # it will install the latest v8 canary release for node 24.0.0
|
||||||
@ -133,7 +152,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24-v8-canary' # it will install the latest v8 canary release for node 24
|
node-version: '24-v8-canary' # it will install the latest v8 canary release for node 24
|
||||||
@ -149,7 +168,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 'v24.0.0-v8-canary2025030537242e55ac'
|
node-version: 'v24.0.0-v8-canary2025030537242e55ac'
|
||||||
@ -169,7 +188,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24-nightly' # it will install the latest nightly release for node 24
|
node-version: '24-nightly' # it will install the latest nightly release for node 24
|
||||||
@ -185,7 +204,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.0.0-nightly' # it will install the latest nightly release for node 24.0.0
|
node-version: '24.0.0-nightly' # it will install the latest nightly release for node 24.0.0
|
||||||
@ -201,7 +220,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.0.0-nightly202505066102159fa1'
|
node-version: '24.0.0-nightly202505066102159fa1'
|
||||||
@ -219,7 +238,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Node sample
|
name: Node sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.0.0-rc.4'
|
node-version: '24.0.0-rc.4'
|
||||||
@ -237,7 +256,7 @@ Yarn caching handles both Yarn Classic (v1) and Yarn Berry (v2, v3, v4+).
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
@ -256,7 +275,7 @@ steps:
|
|||||||
# NOTE: pnpm caching support requires pnpm version >= 6.10.0
|
# NOTE: pnpm caching support requires pnpm version >= 6.10.0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: pnpm/action-setup@v4
|
- uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
version: 10
|
version: 10
|
||||||
@ -275,7 +294,7 @@ steps:
|
|||||||
**Using wildcard patterns to cache dependencies**
|
**Using wildcard patterns to cache dependencies**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
@ -288,7 +307,7 @@ steps:
|
|||||||
**Using a list of file paths to cache dependencies**
|
**Using a list of file paths to cache dependencies**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
@ -308,10 +327,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
# Restore Node.js modules cache (restore-only)
|
# Restore Node.js modules cache (restore-only)
|
||||||
- name: Restore Node modules cache
|
- name: Restore Node modules cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
id: cache-node-modules
|
id: cache-node-modules
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
@ -354,7 +373,7 @@ jobs:
|
|||||||
architecture: x86
|
architecture: x86
|
||||||
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
|
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
@ -367,7 +386,7 @@ jobs:
|
|||||||
## Publish to npmjs and GPR with npm
|
## Publish to npmjs and GPR with npm
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.x'
|
node-version: '24.x'
|
||||||
@ -387,7 +406,7 @@ steps:
|
|||||||
## Publish to npmjs and GPR with yarn
|
## Publish to npmjs and GPR with yarn
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.x'
|
node-version: '24.x'
|
||||||
@ -407,7 +426,7 @@ steps:
|
|||||||
## Use private packages
|
## Use private packages
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.x'
|
node-version: '24.x'
|
||||||
@ -427,7 +446,7 @@ Below you can find a sample "Setup .yarnrc.yml" step, that is going to allow you
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: '24.x'
|
node-version: '24.x'
|
||||||
@ -446,9 +465,6 @@ To access private GitHub Packages within the same organization, go to "Manage Ac
|
|||||||
|
|
||||||
Please refer to the [Ensuring workflow access to your package - Configuring a package's access control and visibility](https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#ensuring-workflow-access-to-your-package) for more details.
|
Please refer to the [Ensuring workflow access to your package - Configuring a package's access control and visibility](https://docs.github.com/en/packages/learn-github-packages/configuring-a-packages-access-control-and-visibility#ensuring-workflow-access-to-your-package) for more details.
|
||||||
|
|
||||||
### always-auth input
|
|
||||||
The always-auth input sets `always-auth=true` in .npmrc file. With this option set [npm](https://docs.npmjs.com/cli/v6/using-npm/config#always-auth)/yarn sends the authentication credentials when making a request to the registries.
|
|
||||||
|
|
||||||
## Use private mirror
|
## Use private mirror
|
||||||
|
|
||||||
It is possible to use a private mirror hosting Node.js binaries. This mirror must be a full mirror of the official Node.js distribution.
|
It is possible to use a private mirror hosting Node.js binaries. This mirror must be a full mirror of the official Node.js distribution.
|
||||||
|
|||||||
2304
package-lock.json
generated
2304
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-node",
|
"name": "setup-node",
|
||||||
"version": "6.0.0",
|
"version": "6.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup node action",
|
"description": "setup node action",
|
||||||
"main": "lib/setup-node.js",
|
"main": "lib/setup-node.js",
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.3",
|
"@actions/cache": "^5.0.1",
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^6.0.1",
|
"@actions/github": "^6.0.1",
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import * as path from 'path';
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as github from '@actions/github';
|
import * as github from '@actions/github';
|
||||||
|
|
||||||
export function configAuthentication(registryUrl: string, alwaysAuth: string) {
|
export function configAuthentication(registryUrl: string) {
|
||||||
const npmrc: string = path.resolve(
|
const npmrc: string = path.resolve(
|
||||||
process.env['RUNNER_TEMP'] || process.cwd(),
|
process.env['RUNNER_TEMP'] || process.cwd(),
|
||||||
'.npmrc'
|
'.npmrc'
|
||||||
@ -13,14 +13,10 @@ export function configAuthentication(registryUrl: string, alwaysAuth: string) {
|
|||||||
registryUrl += '/';
|
registryUrl += '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
writeRegistryToFile(registryUrl, npmrc, alwaysAuth);
|
writeRegistryToFile(registryUrl, npmrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeRegistryToFile(
|
function writeRegistryToFile(registryUrl: string, fileLocation: string) {
|
||||||
registryUrl: string,
|
|
||||||
fileLocation: string,
|
|
||||||
alwaysAuth: string
|
|
||||||
) {
|
|
||||||
let scope: string = core.getInput('scope');
|
let scope: string = core.getInput('scope');
|
||||||
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
|
if (!scope && registryUrl.indexOf('npm.pkg.github.com') > -1) {
|
||||||
scope = github.context.repo.owner;
|
scope = github.context.repo.owner;
|
||||||
@ -47,8 +43,7 @@ function writeRegistryToFile(
|
|||||||
const authString: string =
|
const authString: string =
|
||||||
registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
||||||
const registryString = `${scope}registry=${registryUrl}`;
|
const registryString = `${scope}registry=${registryUrl}`;
|
||||||
const alwaysAuthString = `always-auth=${alwaysAuth}`;
|
newContents += `${authString}${os.EOL}${registryString}`;
|
||||||
newContents += `${authString}${os.EOL}${registryString}${os.EOL}${alwaysAuthString}`;
|
|
||||||
fs.writeFileSync(fileLocation, newContents);
|
fs.writeFileSync(fileLocation, newContents);
|
||||||
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
||||||
// Export empty node_auth_token if didn't exist so npm doesn't complain about not being able to find it
|
// Export empty node_auth_token if didn't exist so npm doesn't complain about not being able to find it
|
||||||
|
|||||||
@ -62,9 +62,8 @@ export async function run() {
|
|||||||
await printEnvDetailsAndSetOutput();
|
await printEnvDetailsAndSetOutput();
|
||||||
|
|
||||||
const registryUrl: string = core.getInput('registry-url');
|
const registryUrl: string = core.getInput('registry-url');
|
||||||
const alwaysAuth: string = core.getInput('always-auth');
|
|
||||||
if (registryUrl) {
|
if (registryUrl) {
|
||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user