Compare commits

...
117 Commits
Author SHA1 Message Date
KhảiandTakashi Sato d882d12c64 feat: standalone binary (#92)
* feat: add an option to install the self-contained binary version of pnpm

* test: add a test about nodejs_bundled

* style: remove an empty line

* chore: use newer pnpm

* chore: update dependencies

* feat: rename `nodejs_bundled` to `standalone`

as @zkochan suggested

* docs: add

---------

Co-authored-by: Takashi Sato <[email protected]>
2023-07-26 14:50:04 +03:00
Khải 0b715c7ebb Merge pull request #75 from ojeytonwilliams/fix/caching-example
docs: update the caching example
2023-07-25 17:00:41 +07:00
Khải 2ed49cbb02 Merge pull request #88 from KengoTODA/make-path-configurable
support projects that have package.json in non-root directory
2023-07-25 16:59:00 +07:00
Khải 218cb35941 Merge pull request #69 from zakuro9715/zakuro9715-patch-2
Remove corepack url in error message
2023-07-25 14:16:42 +07:00
Khải 3723f63bb4 Merge pull request #90 from pnpm/optional-version
feat: make version actually optional
2023-07-25 14:05:04 +07:00
khai96_ 849d884800 feat: make version actually optional
closes https://github.com/pnpm/action-setup/issues/85
2023-07-25 14:01:28 +07:00
khai96_ f92eb0edb6 docs: update pnpm version in readme
fixes https://github.com/pnpm/action-setup/issues/89
2023-07-25 13:50:35 +07:00
Kengo TODA b27f801bf9 feat: add package_json_file option
Signed-off-by: Kengo TODA <[email protected]>
2023-07-08 07:02:46 +08:00
Khải 11dd14d0c0 Change sponsor to pnpm's opencollective 2023-04-22 17:39:01 +07:00
Oliver Eyton-Williams 61eb8c655a docs: update the caching example 2023-03-08 00:13:47 +01:00
zakuro 65db188e28 Remove corepack url in error message 2022-11-09 06:54:12 +09:00
Khải 0609f0983b Merge pull request #66 from mrienstra/patch-1
docs: drop minor & patch version from examples
2022-11-02 12:09:43 +07:00
Michael Rienstra 7208fa2733 docs: drop minor & patch version from examples 2022-11-01 21:55:20 -07:00
Khải 1bd00a2972 Merge pull request #64 from mrienstra/patch-1
typo: not latest version
2022-10-26 10:32:07 +07:00
Michael Rienstra d5601fb603 bump first occurrence of actions/checkout to v3 2022-10-25 10:52:54 -07:00
Michael Rienstra bc06aa6030 typo: not latest version 2022-10-25 10:42:24 -07:00
Khải cd2af74528 Merge pull request #62 from melMass/mel/fix-readme
fix: ⚡️ cross-platform example
2022-10-18 17:29:18 +07:00
Mel Massadian c8a150e137 fix: ⚡️ just use shell:bash
set-output is deprecated see #58
2022-10-18 12:23:15 +02:00
Mel Massadian ed0172a253 fix: ⚡️ cross-platform example 2022-10-18 12:02:38 +02:00
Zoltan Kochan c3b53f6a16 chore(release): 2.2.4 2022-10-15 21:12:50 +03:00
Zoltan Kochan 21e88da200 fix(deps): update 2022-10-15 21:12:13 +03:00
Zoltan Kochan fc3334fa11 build 2022-10-15 21:09:00 +03:00
Sébastien Vanvelthem d01953a678 Update action/core to 1.10.0 to fix deprecation warnings (#59)
* chore: update action/core to 1.10.0

* chore(lock): freshen
2022-10-15 20:57:21 +03:00
Khải 3360b50db7 Merge pull request #58 from belgattitude/doc-adapt-to-new-github-env
Doc update to account for deprecated `set-output`.
2022-10-13 22:23:23 +07:00
Sébastien Vanvelthem 6f9e9a867a docs: update to new github env 2022-10-13 16:58:06 +02:00
Khải 537643d491 Merge pull request #56 from i7eo/master
chore: bump node version
2022-10-11 11:58:06 +07:00
George Tan f4129fb46e fix
Update node version, see https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/
2022-10-11 10:56:24 +08:00
Lew Blood 6e1964dde3 Fix spacing issue in README.md example (#48) 2022-06-17 23:17:05 +03:00
Zoltan Kochan 10693b3829 Update action.yml 2022-05-28 17:23:43 +03:00
Zoltan Kochan 99ecd24520 v2.2.2 2022-05-28 17:22:28 +03:00
Zoltan Kochan 958500fcab fix: do not download pnpm from get.pnpm.io (#46)
* fix: do not download pnpm from get.pnpm.io

* fix: remove redundant files
2022-05-28 16:54:43 +03:00
Khải 57b9359b4c Merge pull request #41 from nelson6e65/patch-1
docs(readme): improve Cache example
2022-05-07 10:00:37 +07:00
Khải ec1a8b444c Change runs-on back to ubuntu-latest 2022-05-07 09:59:56 +07:00
Nelson Martell 73e15250cb docs(readme): improve and fix cache example
Dynamically detect the Store directory and use the latest GitHub actions.
2022-05-06 21:57:00 -05:00
Khải 10b4b0b462 Merge pull request #36 from pnpm/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-08 10:33:01 +07:00
Khải 5fa8980bf4 Update dependabot.yml 2022-03-08 10:32:48 +07:00
dependabot[bot] ae78e9abbe Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-03-07 23:02:26 +00:00
Jack Works 35ab4267a1 fix: packageManager reader (#35)
* fix: packageManager reader

* chore: resolve review

* chore: run build
2022-02-25 12:43:26 +08:00
khai96_ 11ba3424e0 fmt 2022-02-23 10:07:15 +07:00
Khải 847a737d63 Merge pull request #33 from pnpm/packageManager
feat: try support packageManager
2022-02-22 16:39:23 +07:00
Zoltan Kochan 225f3bb4b0 build 2022-02-22 11:34:20 +02:00
Zoltan Kochan 777a50d72e Update src/install-pnpm/run.ts 2022-02-22 11:32:59 +02:00
khai96_ e7c10c6fc5 Update dist/index.js 2022-02-22 13:04:41 +07:00
Jack Works a576a70bc6 chore: resolve review 2022-02-22 13:37:35 +08:00
Jack Works 1d51e20937 feat: try support packageManager 2022-02-22 12:26:05 +08:00
Khải ad2b35ae0c Merge pull request #32 from pnpm/retry-fetch
fix: retry fetch of pnpm script
2022-02-21 10:28:16 +07:00
Zoltan Kochan d8ea532ac4 fix: retry fetch of pnpm script
close #22
2022-02-20 21:49:26 +02:00
khai96_ 2270f39ef6 v2.1.0 2022-02-08 19:53:18 +07:00
khai96_ 394c848db6 Update the bundle 2022-02-08 19:50:57 +07:00
Khải e13928ccc5 Merge pull request #27 from metonym/fix-jobs-syntax
Specify job name to fix syntax error
2022-02-08 19:48:36 +07:00
Khải 93bd5a123d Merge pull request #29 from pnpm/pnpm-v7
The pnpm home directory should be added to PATH and PNPM_HOME
2022-02-08 19:47:28 +07:00
Zoltan Kochan 9eb14dd77c decrease bundle size 2022-02-08 14:44:50 +02:00
Zoltan Kochan eafb777c56 download script from pnpm.io 2022-02-08 00:39:20 +02:00
Zoltan Kochan e6378df420 PNPM_HOME_PATH=>PNPM_HOME 2022-02-08 00:21:53 +02:00
Zoltan Kochan 6ff6e97bc6 The pnpm home directory should be added to PATH and PNPM_HOME
This change is needed to make the action compatible with pnpm v7.

Related breaking change in pnpm: pnpm/pnpm#4280
2022-02-07 23:15:44 +02:00
Eric Liu 45d9c91ff6 Specify job name to fix syntax error 2022-01-29 08:17:29 -08:00
Khải 15569a497d Merge pull request #26 from ai/patch-1
Improve `version` docs
2021-12-16 21:20:06 +07:00
Andrey SitnikandKhải d70eebd14a Update README.md
Co-authored-by: Khải <[email protected]>
2021-12-16 17:18:46 +03:00
Andrey Sitnik 3bf8acf16f Improve version docs 2021-12-16 17:12:07 +03:00
Khải 3c2fe8c592 Merge pull request #21 from gaggle/patch-1
Spelling
2021-10-12 19:45:45 +07:00
Jon Lauridsen 76cc04cd5e Spelling 2021-10-12 13:34:10 +02:00
Khải bcad811784 Remove unused env from examples 2021-07-24 08:25:23 +07:00
Khải 602b36f177 Remove uses of undefined variables from examples 2021-07-24 08:22:22 +07:00
Khải 74a0fdc1a4 Merge pull request #14 from Jack-Works-forks/master
Update README: use lockfile hash instead of package.json hash
2021-06-01 09:44:13 +07:00
Jack Works 493e98ec5e Update README.md 2021-06-01 10:42:26 +08:00
khai96_ 646cdf4821 Update versions in README examples to the latest 2021-04-24 21:13:36 +07:00
Khải a1ba6cf5ae Merge pull request #11 from pnpm/zkochan-patch-1
docs(readme): PNPM=>pnpm
2021-03-27 18:50:58 +07:00
Zoltan Kochan 41b381a08b docs(readme): PNPM=>pnpm 2021-03-27 13:45:01 +02:00
khai96_ 3236b209b5 Merge branch 'v2' 2021-03-27 16:56:27 +07:00
khai96_ 2124926520 Update README.md 2021-03-23 12:53:37 +07:00
khai96_ ba9826e81c Update test workflow 2021-03-23 12:53:25 +07:00
khai96_ 7c4472dbcf Forgot to specify working directory 2021-03-23 12:48:54 +07:00
khai96_ 0db7fb9961 Add .pnpm-store to .gitignore 2021-03-23 12:48:07 +07:00
khai96_ aefcd1e623 Use pnpm.js to install pnpm 2021-03-23 12:42:43 +07:00
khai96_ b7b9d6344b Instruct renovate to ignore ajv updates 2021-03-23 11:47:55 +07:00
khai96_ 7e61ea5847 Add "$schema" to renovate.json 2021-03-23 11:46:56 +07:00
khai96_ 3a2c7247e1 Fix js-yaml usage 2021-03-23 11:43:49 +07:00
khai96_ 2a105263a5 Update dependencies 2021-03-23 11:43:36 +07:00
Khải 9facd4db8e Merge pull request #9 from hildjj/cache-docs
Adds documentation hints for caching
2021-02-18 08:31:04 +07:00
Khải 6c1466d327 Make some tweaks to example code snippets 2021-02-18 08:30:07 +07:00
Joe Hildebrand b26427e53e Adds documentation hints for caching. Fixes #8. 2021-02-17 09:45:25 -07:00
Khải 086f5bd3b6 Update README.md
close https://github.com/pnpm/action-setup/issues/6
2020-10-19 14:10:51 +07:00
khai96_ bdb2a5ee76 Enable Dependabot 2020-10-05 22:16:14 +07:00
khai96_ 8e1abe543f Update dist/index.js 2020-10-05 21:51:43 +07:00
khai96_ af6247d08a Fix https://github.com/pnpm/action-setup/issues/5 2020-10-05 21:45:45 +07:00
khai96_ f87c8a916e Fix TypeScript error 2020-10-05 21:45:20 +07:00
khai96_ d6790970e0 Update dependencies 2020-10-05 21:44:44 +07:00
khai96_ fa62771e12 Add workflow_dispatch event 2020-08-27 08:25:30 +07:00
khai96_ 935101478d v1.2.0 2020-05-10 12:17:17 +07:00
Khải 4abca36d2a Merge pull request #2 from pnpm/install-command
Support install command
2020-05-10 12:16:23 +07:00
khai96_ 56013f801f Add more examples 2020-05-10 12:14:27 +07:00
khai96_ fb99aeb8e3 Describe run_install in more details 2020-05-10 12:08:45 +07:00
khai96_ b78eaea668 Describe default values 2020-05-10 12:00:23 +07:00
khai96_ 83681c63a7 Make logs foldable 2020-05-09 21:50:47 +07:00
khai96_ 6eb237a86d Only warn on failure of post action 2020-05-09 21:43:19 +07:00
khai96_ b1febf84ed Fix pruneStore 2020-05-09 21:41:25 +07:00
khai96_ 2546768411 Add matrix.os to name 2020-05-09 21:35:09 +07:00
khai96_ 8cdddb18c5 Try fixing 2020-05-09 21:33:18 +07:00
khai96_ 4457a83971 Test with run_install 2020-05-09 21:26:17 +07:00
khai96_ c8fc1974e1 Run pnpm store prune post action 2020-05-09 21:15:50 +07:00
khai96_ 291e58ad85 Enable post action 2020-05-09 21:02:32 +07:00
khai96_ 1790ca7f76 Add pnpm install 2020-05-09 20:24:52 +07:00
khai96_ 9a1617cf46 Rename install to install-pnpm 2020-05-09 20:03:45 +07:00
khai96_ 6fe65dc1af Move run-install to its own module 2020-05-09 20:01:25 +07:00
khai96_ 91d3d73121 Correct validation error message 2020-05-09 19:52:48 +07:00
khai96_ 7a5d08caa7 Update run.sh 2020-05-09 19:46:36 +07:00
khai96_ e373fffa0a Use ajv to validate schema 2020-05-09 19:45:31 +07:00
khai96_ bb24f595c2 Add schema generator 2020-05-09 19:24:07 +07:00
khai96_ d44b8c5e53 Add run_install input 2020-05-09 19:13:46 +07:00
khai96_ 4b13327683 Re-add dist/index.js 2020-05-09 18:27:15 +07:00
khai96_ 49ba4cbc60 Delete dist/index.js 2020-05-09 18:26:16 +07:00
Khải 9649109f2e Fix .gitattributes 2020-05-09 08:13:09 +07:00
khai96_ 087311f996 refactor: Remove then 2020-05-08 21:55:03 +07:00
khai96_ 9979c3d928 Use node-fetch 2020-05-08 21:34:25 +07:00
khai96_ 738fb9213f Fix README.md 2020-05-08 21:23:23 +07:00
khai96_ 8925cc44da v1.1.0 2020-05-08 21:18:35 +07:00
khai96_ 7574328996 Forgot to update dist/index.js 2020-05-08 21:17:30 +07:00
29 changed files with 269410 additions and 879 deletions

No files matched your search

+1 -1
View File
@@ -1,2 +1,2 @@
* text=auto
dist/index.js -text
/dist/index.js binary
+2 -12
View File
@@ -1,12 +1,2 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: khai96_
open_collective: # Collective unavailable
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # disabled
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom:
- https://opencollective.com/pnpm
+7
View File
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
+116 -6
View File
@@ -3,6 +3,7 @@ name: Test Action
on:
- push
- pull_request
- workflow_dispatch
jobs:
test_default_inputs:
@@ -21,7 +22,7 @@ jobs:
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run the action
uses: ./
@@ -34,8 +35,8 @@ jobs:
- name: 'Test: install'
run: pnpm install
test_explicit_inputs:
name: Test with explicit inputs
test_dest:
name: Test with dest
runs-on: ${{ matrix.os }}
@@ -50,18 +51,127 @@ jobs:
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run the action
uses: ./
with:
version: 4.11.1
dest: ~/test/pnpm
bin_dest: ~/test/pnpm/.bin
registry: http://registry.yarnpkg.com/
- name: 'Test: which'
run: which pnpm && which pnpx
- name: 'Test: install'
run: pnpm install
test_standalone:
name: Test with standalone
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
standalone:
- true
- false
steps:
- uses: actions/checkout@v3
- name: Run the action
uses: ./
with:
version: 7.0.0
standalone: ${{ matrix.standalone }}
- name: install Node.js
uses: actions/setup-node@v3
with:
# [email protected] is not compatible with Node.js 12
node-version: 12.22.12
- name: 'Test: which (pnpm)'
run: which pnpm
- name: 'Test: which (pnpx)'
if: matrix.standalone == false
run: which pnpx
- name: 'Test: install when standalone is true'
if: matrix.standalone
run: pnpm install
- name: 'Test: install when standalone is false'
if: matrix.standalone == false
# Since the default shell on windows runner is pwsh, we specify bash explicitly
shell: bash
run: |
if pnpm install; then
echo "pnpm install should fail"
exit 1
else
echo "pnpm install failed as expected"
fi
test_run_install:
name: 'Test with run_install (${{ matrix.run_install.name }}, ${{ matrix.os }})'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
pnpm:
- 4.11.1
os:
- ubuntu-latest
- macos-latest
- windows-latest
run_install:
- name: 'null'
value: 'null'
- name: 'empty object'
value: '{}'
- name: 'recursive'
value: |
recursive: true
- name: 'global'
value: |
args:
- --global
- --global-dir=./pnpm-global
- npm
- yarn
- pnpm
- name: 'array'
value: |
- {}
- recursive: true
- args:
- --global
- --global-dir=./pnpm-global
- npm
- yarn
- pnpm
steps:
- uses: actions/checkout@v3
- name: Run the action
uses: ./
with:
version: 4.11.1
run_install: ${{ matrix.run_install.value }}
- name: 'Test: which'
run: which pnpm; which pnpx
- name: 'Test: install'
run: pnpm install
+2
View File
@@ -2,9 +2,11 @@ node_modules
*.log
/dist/*
!/dist/index.js
!/dist/pnpm.js
tmp
temp
*.tmp
*.temp
tmp.*
temp.*
.pnpm-store
+113 -19
View File
@@ -1,24 +1,52 @@
# Setup PNPM
# Setup pnpm
Install PNPM package manager.
Install pnpm package manager.
## Inputs
### `version`
**Required** Version of PNPM to install.
Version of pnpm to install.
**Optional** when there is a [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html).
otherwise, this field is **required** It supports npm versioning scheme, it could be an exact version (such as `6.24.1`), or a version range (such as `6`, `6.x.x`, `6.24.x`, `^6.24.1`, `*`, etc.), or `latest`.
### `dest`
**Optional** Where to store PNPM files.
**Optional** Where to store pnpm files.
### `bin_dest`
### `run_install`
**Optional** Where to store executables (`pnpm` and `pnpx` commands).
**Optional** (_default:_ `null`) If specified, run `pnpm install`.
### `registry`
If `run_install` is either `null` or `false`, pnpm will not install any npm package.
**Optional** Registry to download PNPM from.
If `run_install` is `true`, pnpm will install dependencies recursively.
If `run_install` is a YAML string representation of either an object or an array, pnpm will execute every install commands.
#### `run_install.recursive`
**Optional** (_type:_ `boolean`, _default:_ `false`) Whether to use `pnpm recursive install`.
#### `run_install.cwd`
**Optional** (_type:_ `string`) Working directory when run `pnpm [recursive] install`.
#### `run_install.args`
**Optional** (_type:_ `string[]`) Additional arguments after `pnpm [recursive] install`, e.g. `[--frozen-lockfile, --strict-peer-dependencies]`.
### `package_json_file`
**Optional** (_type:_ `string`, _default:_ `package.json`) File path to the `package.json` to read "packageManager" configuration.
### `standalone`
**Optional** (_type:_ `boolean`, _default:_ `false`) When set to true, [@pnpm/exe](https://www.npmjs.com/package/@pnpm/exe), which is a Node.js bundled package, will be installed, enabling using `pnpm` without Node.js.
This is useful when you want to use a incompatible pair of Node.js and pnpm.
## Outputs
@@ -28,29 +56,95 @@ Expanded path of inputs#dest.
### `bin_dest`
Expanded path of inputs@bin_dest.
Location of `pnpm` and `pnpx` command.
## Usage example
### Just install pnpm
```yaml
on:
- push
- pull_request
jobs:
runs-on: ubuntu-latest
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v1
with:
version: 4.11.1
- name: Install dependencies
run: pnpm install
steps:
- uses: pnpm/action-setup@v2
with:
version: 8
```
### Install pnpm and a few npm packages
```yaml
on:
- push
- pull_request
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- args: [--global, gulp, prettier, typescript]
```
### Use cache to reduce installation time
```yaml
on:
- push
- pull_request
jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 7
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
```
**Note:** You don't need to run `pnpm store prune` at the end; post-action has already taken care of that.
## Notes
This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself.
+17 -12
View File
@@ -1,24 +1,29 @@
name: Setup PNPM
description: Install PNPM package manager
name: Setup pnpm
description: Install pnpm package manager
branding:
icon: package
color: orange
inputs:
version:
description: Version of PNPM to install
required: true
description: Version of pnpm to install
required: false
dest:
description: Where to store PNPM files
description: Where to store pnpm files
required: false
default: ~/setup-pnpm
bin_dest:
description: Where to store executables (pnpm and pnpx commands)
run_install:
description: If specified, run `pnpm install`
required: false
default: ~/setup-pnpm/.bin
registry:
description: Registry to download PNPM from
default: 'null'
package_json_file:
description: File path to the package.json to read "packageManager" configuration
required: false
default: https://registry.npmjs.com
default: 'package.json'
standalone:
description: When set to true, @pnpm/exe, which is a Node.js bundled package, will be installed, enabling using pnpm without Node.js.
required: false
default: 'false'
runs:
using: node12
using: node16
main: dist/index.js
post: dist/index.js
+10 -1
View File
@@ -1 +1,10 @@
module.exports=function(e,i){"use strict";var n={};function __webpack_require__(i){if(n[i]){return n[i].exports}var t=n[i]={i:i,l:false,exports:{}};e[i].call(t.exports,t,t.exports,__webpack_require__);t.l=true;return t.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(803)}return startup()}({0:function(e,i){"use strict";Object.defineProperty(i,"__esModule",{value:true});i.ref="301414cec74a2b6b63c95b42f2ad1790ccb980ed";i.url=`https://raw.githubusercontent.com/pnpm/self-installer/${i.ref}/install.js`;i.default=i.url},1:function(e){"use strict";class CancelError extends Error{constructor(){super("Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(e){return function(){const i=[].slice.apply(arguments);return new PCancelable((n,t,a)=>{i.push(a);e.apply(null,i).then(n,t)})}}constructor(e){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._promise=new Promise((i,n)=>{this._reject=n;return e(e=>{this._isPending=false;i(e)},e=>{this._isPending=false;n(e)},e=>{this._cancelHandlers.push(e)})})}then(e,i){return this._promise.then(e,i)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(){if(!this._isPending||this._isCanceled){return}if(this._cancelHandlers.length>0){try{for(const e of this._cancelHandlers){e()}}catch(e){this._reject(e)}}this._isCanceled=true;this._reject(new CancelError)}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);e.exports=PCancelable;e.exports.CancelError=CancelError},2:function(e,i,n){"use strict";const t=n(747);const a=n(622);const r=n(210);const o={mode:511&~process.umask(),fs:t};const s=e=>{if(process.platform==="win32"){const i=/[<>:"|?*]/.test(e.replace(a.parse(e).root,""));if(i){const i=new Error(`Path contains invalid characters: ${e}`);i.code="EINVAL";throw i}}};e.exports=((e,i)=>Promise.resolve().then(()=>{s(e);i=Object.assign({},o,i);const n=r(i.fs.mkdir);const t=r(i.fs.stat);const c=e=>{return n(e,i.mode).then(()=>e).catch(i=>{if(i.code==="ENOENT"){if(i.message.includes("null bytes")||a.dirname(e)===e){throw i}return c(a.dirname(e)).then(()=>c(e))}return t(e).then(i=>i.isDirectory()?e:Promise.reject()).catch(()=>{throw i})})};return c(a.resolve(e))}));e.exports.sync=((e,i)=>{s(e);i=Object.assign({},o,i);const n=e=>{try{i.fs.mkdirSync(e,i.mode)}catch(t){if(t.code==="ENOENT"){if(t.message.includes("null bytes")||a.dirname(e)===e){throw t}n(a.dirname(e));return n(e)}try{if(!i.fs.statSync(e).isDirectory()){throw new Error("The path is not a directory")}}catch(e){throw t}}return e};return n(a.resolve(e))})},3:function(e,i,n){var t=n(669);var a=n(45);var r=n(791);var o=n(286);var s=n(441).Writable;var c=n(441).PassThrough;var p=function(){};var u=function(e){e&=511;return e&&512-e};var l=function(e,i){var n=new d(e,i);n.end();return n};var f=function(e,i){if(i.path)e.name=i.path;if(i.linkpath)e.linkname=i.linkpath;if(i.size)e.size=parseInt(i.size,10);e.pax=i;return e};var d=function(e,i){this._parent=e;this.offset=i;c.call(this)};t.inherits(d,c);d.prototype.destroy=function(e){this._parent.destroy(e)};var m=function(e){if(!(this instanceof m))return new m(e);s.call(this,e);e=e||{};this._offset=0;this._buffer=a();this._missing=0;this._partial=false;this._onparse=p;this._header=null;this._stream=null;this._overflow=null;this._cb=null;this._locked=false;this._destroyed=false;this._pax=null;this._paxGlobal=null;this._gnuLongPath=null;this._gnuLongLinkPath=null;var i=this;var n=i._buffer;var t=function(){i._continue()};var c=function(e){i._locked=false;if(e)return i.destroy(e);if(!i._stream)t()};var h=function(){i._stream=null;var e=u(i._header.size);if(e)i._parse(e,x);else i._parse(512,w);if(!i._locked)t()};var x=function(){i._buffer.consume(u(i._header.size));i._parse(512,w);t()};var v=function(){var e=i._header.size;i._paxGlobal=o.decodePax(n.slice(0,e));n.consume(e);h()};var b=function(){var e=i._header.size;i._pax=o.decodePax(n.slice(0,e));if(i._paxGlobal)i._pax=r(i._paxGlobal,i._pax);n.consume(e);h()};var g=function(){var t=i._header.size;this._gnuLongPath=o.decodeLongPath(n.slice(0,t),e.filenameEncoding);n.consume(t);h()};var y=function(){var t=i._header.size;this._gnuLongLinkPath=o.decodeLongPath(n.slice(0,t),e.filenameEncoding);n.consume(t);h()};var w=function(){var a=i._offset;var r;try{r=i._header=o.decode(n.slice(0,512),e.filenameEncoding)}catch(e){i.emit("error",e)}n.consume(512);if(!r){i._parse(512,w);t();return}if(r.type==="gnu-long-path"){i._parse(r.size,g);t();return}if(r.type==="gnu-long-link-path"){i._parse(r.size,y);t();return}if(r.type==="pax-global-header"){i._parse(r.size,v);t();return}if(r.type==="pax-header"){i._parse(r.size,b);t();return}if(i._gnuLongPath){r.name=i._gnuLongPath;i._gnuLongPath=null}if(i._gnuLongLinkPath){r.linkname=i._gnuLongLinkPath;i._gnuLongLinkPath=null}if(i._pax){i._header=r=f(r,i._pax);i._pax=null}i._locked=true;if(!r.size||r.type==="direcLine truncated
(()=>{var e={9450:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});const i=t(8829);const n=a(t(8436));const s=a(t(2191));const o=a(t(3326));const l=a(t(9150));const u=a(t(9268));async function main(){const e=(0,n.default)();const r=(0,i.getState)("is_post");if(r==="true")return(0,u.default)(e);(0,i.saveState)("is_post","true");await(0,s.default)(e);console.log("Installation Completed!");(0,o.default)(e);(0,l.default)(e)}main().catch((e=>{console.error(e);(0,i.setFailed)(e)}))},8436:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.getInputs=void 0;const i=t(8829);const n=a(t(6906));const s=t(4264);const o={required:true};const parseInputPath=e=>(0,n.default)((0,i.getInput)(e,o));const getInputs=()=>({version:(0,i.getInput)("version"),dest:parseInputPath("dest"),runInstall:(0,s.parseRunInstall)("run_install"),packageJsonFile:parseInputPath("package_json_file"),standalone:(0,i.getBooleanInput)("standalone")});r.getInputs=getInputs;r["default"]=r.getInputs},4264:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.parseRunInstall=void 0;const i=t(8829);const n=a(t(4376));const s=t(1236);const o=a(t(7282));const l=a(t(5379));const u={required:true};function parseRunInstall(e){const r=(0,s.load)((0,i.getInput)(e,u));const t=new n.default({allErrors:true});const a=t.compile(l.default);if(!a(r)){for(const e of a.errors){(0,i.error)(`with.run_install${e.dataPath}: ${e.message}`)}return o.default.exit(1)}if(!r)return[];if(r===true)return[{recursive:true}];if(Array.isArray(r))return r;return[r]}r.parseRunInstall=parseRunInstall},2191:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.install=r.runSelfInstaller=void 0;const i=t(8829);const n=a(t(5907));r.runSelfInstaller=n.default;async function install(e){(0,i.startGroup)("Running self-installer...");const r=await(0,n.default)(e);(0,i.endGroup)();if(r){return(0,i.setFailed)(`Something went wrong, self-installer exits with code ${r}`)}}r.install=install;r["default"]=install},5907:function(e,r,t){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:true});r.runSelfInstaller=void 0;const i=t(8829);const n=t(2081);const s=t(1690);const o=a(t(1017));const l=t(7282);async function runSelfInstaller(e){const{version:r,dest:t,packageJsonFile:a,standalone:u}=e;await(0,s.remove)(t);const c=o.default.join(t,"package.json");await(0,s.ensureFile)(c);await(0,s.writeFile)(c,JSON.stringify({private:true}));const f=await readTarget({version:r,packageJsonFile:a,standalone:u});const p=(0,n.spawn)(l.execPath,[o.default.join(__dirname,"pnpm.js"),"install",f,"--no-lockfile"],{cwd:t,stdio:["pipe","inherit","inherit"]});const d=await new Promise(((e,r)=>{p.on("error",r);p.on("close",e)}));if(d===0){const e=o.default.join(t,"node_modules/.bin");(0,i.addPath)(e);(0,i.exportVariable)("PNPM_HOME",e)}return d}r.runSelfInstaller=runSelfInstaller;async function readTarget(e){const{version:r,packageJsonFile:t,standalone:a}=e;if(r)return`${a?"@pnpm/exe":"pnpm"}@${r}`;const{GITHUB_WORKSPACE:i}=process.env;if(!i){throw new Error(`No workspace is found.\nIf you're intended to let pnpm/action-setup read preferred pnpm version from the "packageManager" field in the package.json file,\nplease run the actions/checkout before pnpm/action-setup.\nOtherwise, please specify the pnpm version in the action configuration.`)}const{packageManager:n}=JSON.parse(await(0,s.readFile)(o.default.join(i,t),"utf8"));if(typeof n!=="string"){throw new Error(`No pnpm version is specified.\nPlease specify it by one of the following ways:\n - in the GitHub Action config with the key "version"\n - in the package.json with the key "packageManager"`)}if(!n.startsWith("pnpm@")){throw new Error("Invalid packageManager field in package.json")}if(a){return n.replace("pnpm@","@pnpm/exe@")}return n}r["default"]=runSelfInstaller},3326:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.setOutputs=void 0;const a=t(8829);const i=t(3763);function setOutputs(e){const r=(0,i.getBinDest)(e);(0,a.addPath)(r);(0,a.setOutput)("dest",e.dest);(0,a.setOutput)("bin_dest",r)}r.setOutputs=setOutputs;r["default"]=setOutputs},9150:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.runPnpmInstall=void 0;const a=t(8829);const i=t(2081);const n=t(3763);function runPnpmInstall(e){const r=(0,n.patchPnpmEnv)(e);for(const t of e.runInstall){const e=["install"];if(t.recursive)e.unshift("recursive");if(t.args)e.push(...t.args);const n=["pnpm",...e].join(" ");(0,a.startGroup)(`Line truncated
/*!
* expand-tilde <https://github.com/jonschlinkert/expand-tilde>
*
* Copyright (c) 2015 Jon Schlinkert.
* Licensed under the MIT license.
*/
var a=t(3554);var i=t(1017);e.exports=function expandTilde(e){var r=a();if(e.charCodeAt(0)===126){if(e.charCodeAt(1)===43){return i.join(process.cwd(),e.slice(2))}return r?i.join(r,e.slice(1)):e}return e}},2155:e=>{"use strict";e.exports=function equal(e,r){if(e===r)return true;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return false;var t,a,i;if(Array.isArray(e)){t=e.length;if(t!=r.length)return false;for(a=t;a--!==0;)if(!equal(e[a],r[a]))return false;return true}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();i=Object.keys(e);t=i.length;if(t!==Object.keys(r).length)return false;for(a=t;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return false;for(a=t;a--!==0;){var n=i[a];if(!equal(e[n],r[n]))return false}return true}return e!==e&&r!==r}},7822:e=>{"use strict";e.exports=function(e,r){if(!r)r={};if(typeof r==="function")r={cmp:r};var t=typeof r.cycles==="boolean"?r.cycles:false;var a=r.cmp&&function(e){return function(r){return function(t,a){var i={key:t,value:r[t]};var n={key:a,value:r[a]};return e(i,n)}}}(r.cmp);var i=[];return function stringify(e){if(e&&e.toJSON&&typeof e.toJSON==="function"){e=e.toJSON()}if(e===undefined)return;if(typeof e=="number")return isFinite(e)?""+e:"null";if(typeof e!=="object")return JSON.stringify(e);var r,n;if(Array.isArray(e)){n="[";for(r=0;r<e.length;r++){if(r)n+=",";n+=stringify(e[r])||"null"}return n+"]"}if(e===null)return"null";if(i.indexOf(e)!==-1){if(t)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=i.push(e)-1;var o=Object.keys(e).sort(a&&a(e));n="";for(r=0;r<o.length;r++){var l=o[r];var u=stringify(e[l]);if(!u)continue;if(n)n+=",";n+=JSON.stringify(l)+":"+u}i.splice(s,1);return"{"+n+"}"}(e)}},2168:(e,r,t)=>{"use strict";const a=t(9262);const i=t(1017);const n=t(8695).mkdirsSync;const s=t(8223).utimesMillisSync;const o=t(5513);function copySync(e,r,t){if(typeof t==="function"){t={filter:t}}t=t||{};t.clobber="clobber"in t?!!t.clobber:true;t.overwrite="overwrite"in t?!!t.overwrite:t.clobber;if(t.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002")}const{srcStat:a,destStat:i}=o.checkPathsSync(e,r,"copy",t);o.checkParentPathsSync(e,a,r,"copy");return handleFilterAndCopy(i,e,r,t)}function handleFilterAndCopy(e,r,t,s){if(s.filter&&!s.filter(r,t))return;const o=i.dirname(t);if(!a.existsSync(o))n(o);return getStats(e,r,t,s)}function startCopy(e,r,t,a){if(a.filter&&!a.filter(r,t))return;return getStats(e,r,t,a)}function getStats(e,r,t,i){const n=i.dereference?a.statSync:a.lstatSync;const s=n(r);if(s.isDirectory())return onDir(s,e,r,t,i);else if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return onFile(s,e,r,t,i);else if(s.isSymbolicLink())return onLink(e,r,t,i);else if(s.isSocket())throw new Error(`Cannot copy a socket file: ${r}`);else if(s.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${r}`);throw new Error(`Unknown file: ${r}`)}function onFile(e,r,t,a,i){if(!r)return copyFile(e,t,a,i);return mayCopyFile(e,t,a,i)}function mayCopyFile(e,r,t,i){if(i.overwrite){a.unlinkSync(t);return copyFile(e,r,t,i)}else if(i.errorOnExist){throw new Error(`'${t}' already exists`)}}function copyFile(e,r,t,i){a.copyFileSync(r,t);if(i.preserveTimestamps)handleTimestamps(e.mode,r,t);return setDestMode(t,e.mode)}function handleTimestamps(e,r,t){if(fileIsNotWritable(e))makeFileWritable(t,e);return setDestTimestamps(r,t)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,r){return setDestMode(e,r|128)}function setDestMode(e,r){return a.chmodSync(e,r)}function setDestTimestamps(e,r){const t=a.statSync(e);return s(r,t.atime,t.mtime)}function onDir(e,r,t,a,i){if(!r)return mkDirAndCopy(e.mode,t,a,i);return copyDir(t,a,i)}function mkDirAndCopy(e,r,t,i){a.mkdirSync(t);copyDir(r,t,i);return setDestMode(t,e)}function copyDir(e,r,t){a.readdirSync(e).forEach((a=>copyDirItem(a,e,r,t)))}function copyDirItem(e,r,t,a){const n=i.join(r,e);const s=i.join(t,e);const{destStat:l}=o.checkPathsSync(n,s,"copy",a);return startCopy(l,n,s,a)}function onLink(e,r,t,n){let s=a.readlinkSync(r);if(n.dereference){s=i.resolve(process.cwd(),s)}if(!e){return a.symlinkSync(s,t)}else{let e;try{e=a.readlinkSync(t)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return a.symlinkSync(s,t);throw e}if(n.dereference){e=i.resolve(process.cwd(),e)}if(o.isSrcSubdir(s,e)){throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${e}'.`)}if(a.statSync(t).isDirectory()&&o.isSrcSubdir(e,s)){throw new Error(`Cannot overwrite '${e}' with '${s}'.`)}return copyLink(s,t)}}function copyLink(e,r){a.unlinkSync(r);return a.symlinkSync(e,r)}e.exports=coLine truncated
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
(function(e,t){true?t(r):0})(this,(function(e){"use strict";function merge(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++){r[t]=arguments[t]}if(r.length>1){r[0]=r[0].slice(0,-1);var a=r.length-1;for(var i=1;i<a;++i){r[i]=r[i].slice(1,-1)}r[a]=r[a].slice(1);return r.join("")}else{return r[0]}}function subexp(e){return"(?:"+e+")"}function typeOf(e){return e===undefined?"undefined":e===null?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(e){return e.toUpperCase()}function toArray(e){return e!==undefined&&e!==null?e instanceof Array?e:typeof e.length!=="number"||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function assign(e,r){var t=e;if(r){for(var a in r){t[a]=r[a]}}return t}function buildExps(e){var r="[A-Za-z]",t="[\\x0D]",a="[0-9]",i="[\\x22]",n=merge(a,"[A-Fa-f]"),s="[\\x0A]",o="[\\x20]",l=subexp(subexp("%[EFef]"+n+"%"+n+n+"%"+n+n)+"|"+subexp("%[89A-Fa-f]"+n+"%"+n+n)+"|"+subexp("%"+n+n)),u="[\\:\\/\\?\\#\\[\\]\\@]",c="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",f=merge(u,c),p=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",d=e?"[\\uE000-\\uF8FF]":"[]",h=merge(r,a,"[\\-\\.\\_\\~]",p),m=subexp(r+merge(r,a,"[\\+\\-\\.]")+"*"),v=subexp(subexp(l+"|"+merge(h,c,"[\\:]"))+"*"),y=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("[1-9]"+a)+"|"+a),g=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+a)+"|"+subexp("1"+a+a)+"|"+subexp("0?[1-9]"+a)+"|0?0?"+a),w=subexp(g+"\\."+g+"\\."+g+"\\."+g),S=subexp(n+"{1,4}"),b=subexp(subexp(S+"\\:"+S)+"|"+w),E=subexp(subexp(S+"\\:")+"{6}"+b),P=subexp("\\:\\:"+subexp(S+"\\:")+"{5}"+b),_=subexp(subexp(S)+"?\\:\\:"+subexp(S+"\\:")+"{4}"+b),x=subexp(subexp(subexp(S+"\\:")+"{0,1}"+S)+"?\\:\\:"+subexp(S+"\\:")+"{3}"+b),O=subexp(subexp(subexp(S+"\\:")+"{0,2}"+S)+"?\\:\\:"+subexp(S+"\\:")+"{2}"+b),k=subexp(subexp(subexp(S+"\\:")+"{0,3}"+S)+"?\\:\\:"+S+"\\:"+b),C=subexp(subexp(subexp(S+"\\:")+"{0,4}"+S)+"?\\:\\:"+b),R=subexp(subexp(subexp(S+"\\:")+"{0,5}"+S)+"?\\:\\:"+S),A=subexp(subexp(subexp(S+"\\:")+"{0,6}"+S)+"?\\:\\:"),F=subexp([E,P,_,x,O,k,C,R,A].join("|")),D=subexp(subexp(h+"|"+l)+"+"),I=subexp(F+"\\%25"+D),j=subexp(F+subexp("\\%25|\\%(?!"+n+"{2})")+D),T=subexp("[vV]"+n+"+\\."+merge(h,c,"[\\:]")+"+"),$=subexp("\\["+subexp(j+"|"+F+"|"+T)+"\\]"),N=subexp(subexp(l+"|"+merge(h,c))+"*"),L=subexp($+"|"+w+"(?!"+N+")"+"|"+N),M=subexp(a+"*"),q=subexp(subexp(v+"@")+"?"+L+subexp("\\:"+M)+"?"),U=subexp(l+"|"+merge(h,c,"[\\:\\@]")),H=subexp(U+"*"),B=subexp(U+"+"),z=subexp(subexp(l+"|"+merge(h,c,"[\\@]"))+"+"),V=subexp(subexp("\\/"+H)+"*"),W=subexp("\\/"+subexp(B+V)+"?"),Q=subexp(z+V),Y=subexp(B+V),K="(?!"+U+")",J=subexp(V+"|"+W+"|"+Q+"|"+Y+"|"+K),G=subexp(subexp(U+"|"+merge("[\\/\\?]",d))+"*"),Z=subexp(subexp(U+"|[\\/\\?]")+"*"),X=subexp(subexp("\\/\\/"+q+V)+"|"+W+"|"+Y+"|"+K),ee=subexp(m+"\\:"+X+subexp("\\?"+G)+"?"+subexp("\\#"+Z)+"?"),re=subexp(subexp("\\/\\/"+q+V)+"|"+W+"|"+Q+"|"+K),te=subexp(re+subexp("\\?"+G)+"?"+subexp("\\#"+Z)+"?"),ae=subexp(ee+"|"+te),ie=subexp(m+"\\:"+X+subexp("\\?"+G)+"?"),ne="^("+m+")\\:"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+L+")"+subexp("\\:("+M+")")+"?)")+"?("+V+"|"+W+"|"+Y+"|"+K+")")+subexp("\\?("+G+")")+"?"+subexp("\\#("+Z+")")+"?$",se="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+L+")"+subexp("\\:("+M+")")+"?)")+"?("+V+"|"+W+"|"+Q+"|"+K+")")+subexp("\\?("+G+")")+"?"+subexp("\\#("+Z+")")+"?$",oe="^("+m+")\\:"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+L+")"+subexp("\\:("+M+")")+"?)")+"?("+V+"|"+W+"|"+Y+"|"+K+")")+subexp("\\?("+G+")")+"?$",le="^"+subexp("\\#("+Z+")")+"?$",ue="^"+subexp("("+v+")@")+"?("+L+")"+subexp("\\:("+M+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",r,a,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",h,c),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",h,c),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",h,c),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",h,c),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",h,c,"[\\:\\@\\/\\?]",d),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",h,c,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",h,c),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",h,f),"g"),PCT_ENCODED:new RegExp(l,"g"),IPV4ADDRESS:new RegExp("^("+w+")$"),IPV6ADDRESS:new RegExp("^\\[?("+F+")"+subexp(subexp("\\%25|\\%(?!"+n+"{2})")+"("+D+")")+"?\\]?$")}}var r=buildExps(false);var t=buildExps(true);var a=function(){function sliceIterator(e,r){var t=[];var a=true;var i=false;var n=undefined;try{for(var s=e[Symbol.iterator](),o;!(a=(o=s.next()).done);a=true){t.push(o.value);if(r&&t.length===r)break}}catch(e){i=true;n=e}finally{try{if(!a&&s["return"])s["return"]()}finally{if(i)throw n}}return t}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(e){if(ArrayLine truncated
+134031
View File
File diff suppressed because it is too large. Load diff
+14 -8
View File
@@ -1,20 +1,26 @@
{
"private": true,
"scripts": {
"build:schemas": "ts-schema-autogen generate",
"build:ncc": "ncc build --minify --no-source-map-register --no-cache dist/tsc/index.js --out dist/",
"build": "tsc && pnpm run build:ncc",
"build": "pnpm run build:schemas && tsc && pnpm run build:ncc && cp src/install-pnpm/pnpm.js dist/pnpm.js",
"start": "pnpm run build && sh ./run.sh"
},
"dependencies": {
"download": "^8.0.0",
"expand-tilde": "^2.0.2",
"@actions/core": "^1.2.4",
"@types/download": "^6.2.4",
"@actions/core": "^1.10.0",
"@types/expand-tilde": "^2.0.0",
"@types/node": "^13.13.5"
"@types/fs-extra": "^9.0.13",
"@types/js-yaml": "^4.0.5",
"@types/node": "^14.18.54",
"@types/node-fetch": "^2.6.4",
"ajv": "^6.12.6",
"expand-tilde": "^2.0.2",
"fs-extra": "^10.1.0",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"typescript": "^3.8.3",
"@zeit/ncc": "^0.22.1"
"@ts-schema-autogen/cli": "^0.1.2",
"@vercel/ncc": "^0.33.4",
"typescript": "^4.9.5"
}
}
+781 -767
View File
File diff suppressed because it is too large. Load diff
+4
View File
@@ -1,6 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"pinVersions": false,
"extends": [
"config:base"
],
"ignoreDeps": [
"ajv"
]
}
+2 -2
View File
@@ -3,6 +3,6 @@
export HOME="$(pwd)"
export INPUT_VERSION=4.11.1
export INPUT_DEST='~/pnpm.temp'
export INPUT_BIN_DEST='~/pnpm.temp/.bin'
export INPUT_REGISTRY=https://registry.npmjs.com
export INPUT_RUN_INSTALL=null
export INPUT_standalone=false
exec node dist/index.js
+11 -6
View File
@@ -1,14 +1,19 @@
import { setFailed } from '@actions/core'
import { setFailed, saveState, getState } from '@actions/core'
import getInputs from './inputs'
import installPnpm from './install-pnpm'
import setOutputs from './outputs'
import install from './install'
import pnpmInstall from './pnpm-install'
import pruneStore from './pnpm-store-prune'
async function main() {
const inputs = getInputs()
await install(inputs).then(() => {
console.log('Installation Completed!')
setOutputs(inputs)
})
const isPost = getState('is_post')
if (isPost === 'true') return pruneStore(inputs)
saveState('is_post', 'true')
await installPnpm(inputs)
console.log('Installation Completed!')
setOutputs(inputs)
pnpmInstall(inputs)
}
main().catch(error => {
+10 -7
View File
@@ -1,11 +1,13 @@
import { getInput, InputOptions } from '@actions/core'
import { getBooleanInput, getInput, InputOptions } from '@actions/core'
import expandTilde from 'expand-tilde'
import { RunInstall, parseRunInstall } from './run-install'
export interface Inputs {
readonly version: string
readonly version?: string
readonly dest: string
readonly binDest: string
readonly registry: string
readonly runInstall: RunInstall[]
readonly packageJsonFile: string
readonly standalone: boolean
}
const options: InputOptions = {
@@ -15,10 +17,11 @@ const options: InputOptions = {
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
export const getInputs = (): Inputs => ({
version: getInput('version', options),
version: getInput('version'),
dest: parseInputPath('dest'),
binDest: parseInputPath('bin_dest'),
registry: getInput('registry', options),
runInstall: parseRunInstall('run_install'),
packageJsonFile: parseInputPath('package_json_file'),
standalone: getBooleanInput('standalone'),
})
export default getInputs
@@ -0,0 +1,21 @@
{
"$schema": "https://raw.githubusercontent.com/ksxnodeapps/ts-schema-autogen/master/packages/schemas/config.schema.json",
"instruction": {
"compilerOptions": {
"strict": true,
"target": "ES2018",
"lib": [
"ES2018",
"ES2019",
"ES2020",
"ESNext"
],
"moduleResolution": "Node",
"esModuleInterop": true,
"resolveJsonModule": true
},
"input": "run-install.ts",
"symbol": "RunInstallInput",
"output": "run-install-input.schema.json"
}
}
+39
View File
@@ -0,0 +1,39 @@
{
"anyOf": [
{
"$ref": "#/definitions/RunInstall"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/RunInstall"
}
},
{
"type": [
"null",
"boolean"
]
}
],
"definitions": {
"RunInstall": {
"type": "object",
"properties": {
"recursive": {
"type": "boolean"
},
"cwd": {
"type": "string"
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
+39
View File
@@ -0,0 +1,39 @@
import { getInput, error, InputOptions } from '@actions/core'
import Ajv from 'ajv'
import { load } from 'js-yaml'
import process from 'process'
import runInstallSchema from './run-install-input.schema.json'
export interface RunInstall {
readonly recursive?: boolean
readonly cwd?: string
readonly args?: readonly string[]
}
export type RunInstallInput =
| null
| boolean
| RunInstall
| RunInstall[]
const options: InputOptions = {
required: true,
}
export function parseRunInstall(name: string): RunInstall[] {
const result: RunInstallInput = load(getInput(name, options)) as any
const ajv = new Ajv({
allErrors: true,
})
const validate = ajv.compile(runInstallSchema)
if (!validate(result)) {
for (const errorItem of validate.errors!) {
error(`with.run_install${errorItem.dataPath}: ${errorItem.message}`)
}
return process.exit(1)
}
if (!result) return []
if (result === true) return [{ recursive: true }]
if (Array.isArray(result)) return result
return [result]
}
@@ -1,13 +1,15 @@
import { setFailed } from '@actions/core'
import { setFailed, startGroup, endGroup } from '@actions/core'
import { Inputs } from '../inputs'
import runSelfInstaller from './run'
export { runSelfInstaller }
export async function install(inputs: Inputs) {
startGroup('Running self-installer...')
const status = await runSelfInstaller(inputs)
endGroup()
if (status) {
return setFailed(`Something does wrong, self-installer exits with code ${status}`)
return setFailed(`Something went wrong, self-installer exits with code ${status}`)
}
}
File diff suppressed because it is too large. Load diff
+72
View File
@@ -0,0 +1,72 @@
import { addPath, exportVariable } from '@actions/core'
import { spawn } from 'child_process'
import { remove, ensureFile, writeFile, readFile } from 'fs-extra'
import path from 'path'
import { execPath } from 'process'
import { Inputs } from '../inputs'
export async function runSelfInstaller(inputs: Inputs): Promise<number> {
const { version, dest, packageJsonFile, standalone } = inputs
// prepare self install
await remove(dest)
const pkgJson = path.join(dest, 'package.json')
await ensureFile(pkgJson)
await writeFile(pkgJson, JSON.stringify({ private: true }))
// prepare target pnpm
const target = await readTarget({ version, packageJsonFile, standalone })
const cp = spawn(execPath, [path.join(__dirname, 'pnpm.js'), 'install', target, '--no-lockfile'], {
cwd: dest,
stdio: ['pipe', 'inherit', 'inherit'],
})
const exitCode = await new Promise<number>((resolve, reject) => {
cp.on('error', reject)
cp.on('close', resolve)
})
if (exitCode === 0) {
const pnpmHome = path.join(dest, 'node_modules/.bin')
addPath(pnpmHome)
exportVariable('PNPM_HOME', pnpmHome)
}
return exitCode
}
async function readTarget(opts: {
readonly version?: string | undefined
readonly packageJsonFile: string
readonly standalone: boolean
}) {
const { version, packageJsonFile, standalone } = opts
if (version) return `${ standalone ? '@pnpm/exe' : 'pnpm' }@${version}`
const { GITHUB_WORKSPACE } = process.env
if (!GITHUB_WORKSPACE) {
throw new Error(`No workspace is found.
If you're intended to let pnpm/action-setup read preferred pnpm version from the "packageManager" field in the package.json file,
please run the actions/checkout before pnpm/action-setup.
Otherwise, please specify the pnpm version in the action configuration.`)
}
const { packageManager } = JSON.parse(await readFile(path.join(GITHUB_WORKSPACE, packageJsonFile), 'utf8'))
if (typeof packageManager !== 'string') {
throw new Error(`No pnpm version is specified.
Please specify it by one of the following ways:
- in the GitHub Action config with the key "version"
- in the package.json with the key "packageManager"`)
}
if (!packageManager.startsWith('pnpm@')) {
throw new Error('Invalid packageManager field in package.json')
}
if(standalone){
return packageManager.replace('pnpm@', '@pnpm/exe@')
}
return packageManager
}
export default runSelfInstaller
-25
View File
@@ -1,25 +0,0 @@
import { spawn } from 'child_process'
import { execPath } from 'process'
import { downloadSelfInstaller } from '../self-installer'
import { Inputs } from '../inputs'
export function runSelfInstaller(inputs: Inputs): Promise<number> {
const cp = spawn(execPath, {
env: {
PNPM_VERSION: inputs.version,
PNPM_DEST: inputs.dest,
PNPM_BIN_DEST: inputs.binDest,
PNPM_REGISTRY: inputs.registry,
},
stdio: ['pipe', 'inherit', 'inherit'],
})
downloadSelfInstaller().pipe(cp.stdin)
return new Promise((resolve, reject) => {
cp.on('error', reject)
cp.on('close', resolve)
})
}
export default runSelfInstaller
+4 -2
View File
@@ -1,10 +1,12 @@
import { setOutput, addPath } from '@actions/core'
import { Inputs } from '../inputs'
import { getBinDest } from '../utils'
export function setOutputs(inputs: Inputs) {
addPath(inputs.binDest)
const binDest = getBinDest(inputs)
addPath(binDest)
setOutput('dest', inputs.dest)
setOutput('bin_dest', inputs.binDest)
setOutput('bin_dest', binDest)
}
export default setOutputs
+38
View File
@@ -0,0 +1,38 @@
import { setFailed, startGroup, endGroup } from '@actions/core'
import { spawnSync } from 'child_process'
import { Inputs } from '../inputs'
import { patchPnpmEnv } from '../utils'
export function runPnpmInstall(inputs: Inputs) {
const env = patchPnpmEnv(inputs)
for (const options of inputs.runInstall) {
const args = ['install']
if (options.recursive) args.unshift('recursive')
if (options.args) args.push(...options.args)
const cmdStr = ['pnpm', ...args].join(' ')
startGroup(`Running ${cmdStr}...`)
const { error, status } = spawnSync('pnpm', args, {
stdio: 'inherit',
cwd: options.cwd,
shell: true,
env,
})
endGroup()
if (error) {
setFailed(error)
continue
}
if (status) {
setFailed(`Command ${cmdStr} (cwd: ${options.cwd}) exits with status ${status}`)
continue
}
}
}
export default runPnpmInstall
+31
View File
@@ -0,0 +1,31 @@
import { warning, startGroup, endGroup } from '@actions/core'
import { spawnSync } from 'child_process'
import { Inputs } from '../inputs'
import { patchPnpmEnv } from '../utils'
export function pruneStore(inputs: Inputs) {
if (inputs.runInstall.length === 0) {
console.log('Pruning is unnecessary.')
return
}
startGroup('Running pnpm store prune...')
const { error, status } = spawnSync('pnpm', ['store', 'prune'], {
stdio: 'inherit',
shell: true,
env: patchPnpmEnv(inputs),
})
endGroup()
if (error) {
warning(error)
return
}
if (status) {
warning(`command pnpm store prune exits with code ${status}`)
return
}
}
export default pruneStore
-4
View File
@@ -1,4 +0,0 @@
import download from 'download'
import url from './url'
export const downloadSelfInstaller = () => download(url)
export default downloadSelfInstaller
-2
View File
@@ -1,2 +0,0 @@
export * from './url'
export * from './download'
-3
View File
@@ -1,3 +0,0 @@
export const ref = '301414cec74a2b6b63c95b42f2ad1790ccb980ed'
export const url = `https://raw.githubusercontent.com/pnpm/self-installer/${ref}/install.js`
export default url
+10
View File
@@ -0,0 +1,10 @@
import path from 'path'
import process from 'process'
import { Inputs } from '../inputs'
export const getBinDest = (inputs: Inputs): string => path.join(inputs.dest, 'node_modules', '.bin')
export const patchPnpmEnv = (inputs: Inputs): NodeJS.ProcessEnv => ({
...process.env,
PATH: getBinDest(inputs) + path.delimiter + process.env.PATH,
})