mirror of
https://github.com/docker/setup-buildx-action.git
synced 2026-10-06 16:44:38 +03:00
Compare commits
245
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d04d5d948 | ||
|
|
cd74e05d9b | ||
|
|
eee38ec7b3 | ||
|
|
7a83f65b5a | ||
|
|
a5aa96747d | ||
|
|
e73d53fa4e | ||
|
|
28a438e9ed | ||
|
|
034e9d37dd | ||
|
|
b4664d8fd0 | ||
|
|
a8257dec35 | ||
|
|
9cd4410b76 | ||
|
|
7064bb6cb0 | ||
|
|
57d4a8d20c | ||
|
|
0dadf93d54 | ||
|
|
1a12f33edd | ||
|
|
1282d41a96 | ||
|
|
01144634a7 | ||
|
|
cb437c6618 | ||
|
|
4b6c254447 | ||
|
|
3d95d526ba | ||
|
|
2231aab25d | ||
|
|
483f4842ce | ||
|
|
a43d49b256 | ||
|
|
64bf327336 | ||
|
|
94782da071 | ||
|
|
d6c542fbcd | ||
|
|
eaf69fbc6f | ||
|
|
f95826b456 | ||
|
|
fb37e2879d | ||
|
|
099630bcb6 | ||
|
|
70d132ddbe | ||
|
|
7c525be6cc | ||
|
|
ca8948fcde | ||
|
|
86fc44fcc0 | ||
|
|
c7c4c00f3e | ||
|
|
7a35da204c | ||
|
|
d965a53926 | ||
|
|
16c25413c8 | ||
|
|
b278ce4ad9 | ||
|
|
8d2750c68a | ||
|
|
e81846bcc4 | ||
|
|
65d18f8f8a | ||
|
|
000d75d273 | ||
|
|
1583c0f09d | ||
|
|
ed158e7963 | ||
|
|
4cc794f83e | ||
|
|
4dfc3d6c5d | ||
|
|
af1b253b8d | ||
|
|
3c6ab92b04 | ||
|
|
2c8bcdab54 | ||
|
|
1051acaba6 | ||
|
|
e8cd182ec7 | ||
|
|
8c5c87276d | ||
|
|
90fa7ac870 | ||
|
|
7ebadadf6b | ||
|
|
ee3eb2f3a4 | ||
|
|
c65d441f38 | ||
|
|
da183f8ca3 | ||
|
|
f7a6c723e1 | ||
|
|
8424fa0070 | ||
|
|
c52693d481 | ||
|
|
5efa6e34fd | ||
|
|
774224adf6 | ||
|
|
5d221e8956 | ||
|
|
68163b97ca | ||
|
|
ae7d6893e8 | ||
|
|
ac3a803dd3 | ||
|
|
e468171a9d | ||
|
|
a3e7502fd0 | ||
|
|
b145473295 | ||
|
|
18ce135bb5 | ||
|
|
0e198e93af | ||
|
|
05f3f3ac10 | ||
|
|
622913496d | ||
|
|
c6f6a07025 | ||
|
|
6c5e29d848 | ||
|
|
548b297749 | ||
|
|
36590ad0c1 | ||
|
|
4143b5899b | ||
|
|
3f1544eb9e | ||
|
|
f3204bbfac | ||
|
|
4ba329ef89 | ||
|
|
e600775e52 | ||
|
|
b2b2ffa946 | ||
|
|
fe905840cd | ||
|
|
8998bbe94b | ||
|
|
830833e0c7 | ||
|
|
941183f0a0 | ||
|
|
311b62b254 | ||
|
|
afeb29a6e0 | ||
|
|
b560416601 | ||
|
|
516bb780e5 | ||
|
|
11445527f0 | ||
|
|
b5ca514318 | ||
|
|
1418a4ef33 | ||
|
|
93acf831ce | ||
|
|
f7ce87c1d6 | ||
|
|
aa1e2a0b49 | ||
|
|
673e008776 | ||
|
|
ba31df4664 | ||
|
|
5475af18ec | ||
|
|
acacad903e | ||
|
|
6a25f988bd | ||
|
|
ca1af179f5 | ||
|
|
6524bf65af | ||
|
|
8d5e0747fc | ||
|
|
7199e57b35 | ||
|
|
db63cee3de | ||
|
|
043ebe137f | ||
|
|
686da9073d | ||
|
|
a3d74876b8 | ||
|
|
4dcdbcec48 | ||
|
|
1a8ac74316 | ||
|
|
e827ebe8ba | ||
|
|
adacc1474e | ||
|
|
0f069ddc17 | ||
|
|
d036b3238c | ||
|
|
460e45646d | ||
|
|
93aa1c807f | ||
|
|
d391aad55c | ||
|
|
e5b688ea46 | ||
|
|
c47758b77c | ||
|
|
8fea382513 | ||
|
|
2874e980e8 | ||
|
|
8026d2bc36 | ||
|
|
e51aab53e9 | ||
|
|
fd7390e14d | ||
|
|
910a304005 | ||
|
|
3623ee443e | ||
|
|
e0e5ecf670 | ||
|
|
5334dd0cdd | ||
|
|
214bb6dac1 | ||
|
|
818c69a4ea | ||
|
|
b467d6aa7a | ||
|
|
7594cf3831 | ||
|
|
988b5a0280 | ||
|
|
2c215620b8 | ||
|
|
3382292cd5 | ||
|
|
3d68780484 | ||
|
|
d069e98648 | ||
|
|
8b850f86dc | ||
|
|
aa33708b10 | ||
|
|
2d99e3412d | ||
|
|
4dab43650b | ||
|
|
49a04d6890 | ||
|
|
a6ade2e34f | ||
|
|
2f2694b8d1 | ||
|
|
0a4bab6632 | ||
|
|
2ad185228a | ||
|
|
560ac469d6 | ||
|
|
b3a341759e | ||
|
|
4fd812986e | ||
|
|
3386dc4251 | ||
|
|
d191aef416 | ||
|
|
f686054aab | ||
|
|
78547859d7 | ||
|
|
830928c706 | ||
|
|
26d2aec173 | ||
|
|
ab17e3ec80 | ||
|
|
d79cb80903 | ||
|
|
13cf78894f | ||
|
|
0e592087a0 | ||
|
|
47032b9b53 | ||
|
|
abe89fb761 | ||
|
|
e027232c25 | ||
|
|
5d9397e7ca | ||
|
|
e9ab4c6a14 | ||
|
|
748835b452 | ||
|
|
554c728605 | ||
|
|
1c1261e632 | ||
|
|
5138f76647 | ||
|
|
eddcf46655 | ||
|
|
2740b29678 | ||
|
|
1113efed2b | ||
|
|
8a2a7ad780 | ||
|
|
e3c7deb79b | ||
|
|
be3701b211 | ||
|
|
e2ed622d10 | ||
|
|
b73b950903 | ||
|
|
157d6d0106 | ||
|
|
a530e948ad | ||
|
|
28ecb964cd | ||
|
|
dc25d8b2ee | ||
|
|
d70bba72b1 | ||
|
|
7638634cb7 | ||
|
|
c68420fe0b | ||
|
|
2b51285047 | ||
|
|
0f00370563 | ||
|
|
11c9683db9 | ||
|
|
56a16b8f2a | ||
|
|
c23f46eb91 | ||
|
|
f876da6242 | ||
|
|
b7cf918227 | ||
|
|
0150f0ed7a | ||
|
|
d89f1f9116 | ||
|
|
12d65f6595 | ||
|
|
8e1cfa56de | ||
|
|
0d103c3126 | ||
|
|
f19477aacd | ||
|
|
a4180f835d | ||
|
|
524315340d | ||
|
|
3679a54023 | ||
|
|
37a22a2fb2 | ||
|
|
65afe610a1 | ||
|
|
fcb8f722fd | ||
|
|
f62b9a17c0 | ||
|
|
74c5b717e5 | ||
|
|
0d7aea7476 | ||
|
|
edfb0fe620 | ||
|
|
ee40da0772 | ||
|
|
02e65a5ab9 | ||
|
|
6d5347c402 | ||
|
|
ab3fcb73e7 | ||
|
|
3762d454f3 | ||
|
|
cdd4983d88 | ||
|
|
a3e8dc13a7 | ||
|
|
5d98624985 | ||
|
|
fa0a3f8db8 | ||
|
|
0d99838e0e | ||
|
|
dedd61cf5d | ||
|
|
a9e6efb8d7 | ||
|
|
572af8c114 | ||
|
|
8bda7f18d0 | ||
|
|
36dc84a6af | ||
|
|
1eaf7017ec | ||
|
|
35db0cdb94 | ||
|
|
524ee0563f | ||
|
|
91c74bb1dc | ||
|
|
7d508e5a8a | ||
|
|
c9db9161e9 | ||
|
|
f95db51fdd | ||
|
|
998a87c2c1 | ||
|
|
28bae59336 | ||
|
|
c215341715 | ||
|
|
02e9319239 | ||
|
|
5c9160effc | ||
|
|
1283140f57 | ||
|
|
c6afe06e4a | ||
|
|
f35e0d5a04 | ||
|
|
baeb468fb2 | ||
|
|
8e48232775 | ||
|
|
a52126db3d | ||
|
|
2afcb42c88 | ||
|
|
2fbc37fd36 | ||
|
|
23d726350c |
No files matched your search
+11
-1
@@ -1,2 +1,12 @@
|
||||
/coverage
|
||||
/node_modules
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es2021": true,
|
||||
"jest": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"jest",
|
||||
"prettier"
|
||||
]
|
||||
}
|
||||
@@ -1,2 +1,4 @@
|
||||
/.yarn/releases/** binary
|
||||
/.yarn/plugins/** binary
|
||||
/dist/** linguist-generated=true
|
||||
/lib/** linguist-generated=true
|
||||
@@ -0,0 +1,3 @@
|
||||
# Code of conduct
|
||||
|
||||
- [Moby community guidelines](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#moby-community-guidelines)
|
||||
@@ -0,0 +1,101 @@
|
||||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Bug Report
|
||||
description: Report a bug
|
||||
labels:
|
||||
- status/triage
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for taking the time to report a bug!
|
||||
If this is a security issue please report it to the [Docker Security team](mailto:security@docker.com).
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Contributing guidelines
|
||||
description: >
|
||||
Make sure you've read the contributing guidelines before proceeding.
|
||||
options:
|
||||
- label: I've read the [contributing guidelines](https://github.com/docker/setup-buildx-action/blob/master/.github/CONTRIBUTING.md) and wholeheartedly agree
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I've found a bug, and:"
|
||||
description: |
|
||||
Make sure that your request fulfills all of the following requirements.
|
||||
If one requirement cannot be satisfied, explain in detail why.
|
||||
options:
|
||||
- label: The documentation does not mention anything about my problem
|
||||
- label: There are no open or closed issues that are related to my problem
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: >
|
||||
Provide a brief description of the bug in 1-2 sentences.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
description: >
|
||||
Describe precisely what you'd expect to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual behaviour
|
||||
description: >
|
||||
Describe precisely what is actually happening.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Repository URL
|
||||
description: >
|
||||
Enter the URL of the repository where you are experiencing the
|
||||
issue. If your repository is private, provide a link to a minimal
|
||||
repository that reproduces the issue.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Workflow run URL
|
||||
description: >
|
||||
Enter the URL of the GitHub Action workflow run if public (e.g.
|
||||
`https://github.com/<user>/<repo>/actions/runs/<id>`)
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: YAML workflow
|
||||
description: |
|
||||
Provide the YAML of the workflow that's causing the issue.
|
||||
Make sure to remove any sensitive information.
|
||||
render: yaml
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Workflow logs
|
||||
description: >
|
||||
[Attach](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files)
|
||||
the [log file of your workflow run](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
|
||||
and make sure to remove any sensitive information.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: BuildKit logs
|
||||
description: >
|
||||
If applicable, provide the [BuildKit container logs](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs)
|
||||
render: text
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional info
|
||||
description: |
|
||||
Provide any additional information that could be useful.
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
|
||||
### Behaviour
|
||||
|
||||
#### Steps to reproduce this issue
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
#### Expected behaviour
|
||||
|
||||
> Tell us what should happen
|
||||
|
||||
#### Actual behaviour
|
||||
|
||||
> Tell us what happens instead
|
||||
|
||||
### Configuration
|
||||
|
||||
* Repository URL (if public):
|
||||
* Build URL (if public):
|
||||
|
||||
```yml
|
||||
# paste your YAML workflow file here and remove sensitive data
|
||||
```
|
||||
|
||||
### Logs
|
||||
|
||||
> Download the [log file of your build](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
|
||||
> and [attach it](https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue.
|
||||
@@ -0,0 +1,9 @@
|
||||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions and Discussions
|
||||
url: https://github.com/docker/setup-buildx-action/discussions/new
|
||||
about: Use Github Discussions to ask questions and/or open discussion topics.
|
||||
- name: Documentation
|
||||
url: https://docs.docker.com/build/ci/github-actions/
|
||||
about: Read the documentation.
|
||||
@@ -0,0 +1,15 @@
|
||||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Feature request
|
||||
description: Missing functionality? Come tell us about it!
|
||||
labels:
|
||||
- kind/enhancement
|
||||
- status/triage
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: What is the feature you want to see?
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,12 @@
|
||||
# Reporting security issues
|
||||
|
||||
The project maintainers take security seriously. If you discover a security
|
||||
issue, please bring it to their attention right away!
|
||||
|
||||
**Please _DO NOT_ file a public issue**, instead send your report privately to
|
||||
[security@docker.com](mailto:security@docker.com).
|
||||
|
||||
Security reports are greatly appreciated, and we will publicly thank you for it.
|
||||
We also like to send gifts—if you'd like Docker swag, make sure to let
|
||||
us know. We currently do not offer a paid security bounty program, but are not
|
||||
ruling it out in the future.
|
||||
@@ -1,31 +0,0 @@
|
||||
# Support [](https://isitmaintained.com/project/docker/setup-buildx-action)
|
||||
|
||||
First, [be a good guy](https://github.com/kossnocorp/etiquette/blob/master/README.md).
|
||||
|
||||
## Reporting an issue
|
||||
|
||||
Please do a search in [open issues](https://github.com/docker/setup-buildx-action/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed.
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment.
|
||||
|
||||
:+1: - upvote
|
||||
|
||||
:-1: - downvote
|
||||
|
||||
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
|
||||
|
||||
## Writing good bug reports and feature requests
|
||||
|
||||
File a single issue per problem and feature request.
|
||||
|
||||
* Do not enumerate multiple bugs or feature requests in the same issue.
|
||||
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
|
||||
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
|
||||
You are now ready to [create a new issue](https://github.com/docker/setup-buildx-action/issues/new/choose)!
|
||||
|
||||
## Closure policy
|
||||
|
||||
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
|
||||
* Issues that go a week without a response from original poster are subject to closure at our discretion.
|
||||
+121
-80
@@ -1,6 +1,11 @@
|
||||
name: ci
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
push:
|
||||
@@ -21,12 +26,13 @@ jobs:
|
||||
- ""
|
||||
- "latest"
|
||||
- "v0.4.1"
|
||||
- "cloud:latest"
|
||||
- "cloud:v0.11.2-desktop.2"
|
||||
- "lab:latest"
|
||||
- "lab:v0.11.2-desktop.2"
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
@@ -45,7 +51,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx 1
|
||||
uses: ./
|
||||
@@ -58,7 +64,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Stop docker
|
||||
run: |
|
||||
@@ -86,7 +92,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Create Dockerfile
|
||||
run: |
|
||||
@@ -96,7 +102,7 @@ jobs:
|
||||
EOL
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -104,27 +110,11 @@ jobs:
|
||||
buildkitd-flags: --debug
|
||||
-
|
||||
name: Build
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
||||
|
||||
install:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
with:
|
||||
install: true
|
||||
-
|
||||
name: Check cmd
|
||||
run: |
|
||||
docker build --help
|
||||
|
||||
use:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@@ -136,7 +126,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -159,7 +149,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -172,7 +162,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -205,7 +195,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Create context
|
||||
run: |
|
||||
@@ -222,12 +212,12 @@ jobs:
|
||||
env:
|
||||
DOCKER_CONTEXT: mycontext
|
||||
|
||||
config:
|
||||
buildkitd-config:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Create buildkitd conf
|
||||
run: |
|
||||
@@ -247,19 +237,19 @@ jobs:
|
||||
uses: ./
|
||||
with:
|
||||
buildkitd-flags: --debug
|
||||
config: /tmp/buildkitd.toml
|
||||
buildkitd-config: /tmp/buildkitd.toml
|
||||
-
|
||||
name: Build
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
|
||||
config-inline:
|
||||
buildkitd-config-inline:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Create Dockerfile
|
||||
run: |
|
||||
@@ -271,13 +261,13 @@ jobs:
|
||||
uses: ./
|
||||
with:
|
||||
buildkitd-flags: --debug
|
||||
config-inline: |
|
||||
buildkitd-config-inline: |
|
||||
debug = true
|
||||
[registry."docker.io"]
|
||||
mirrors = ["mirror.gcr.io"]
|
||||
-
|
||||
name: Build
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
|
||||
@@ -295,10 +285,10 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v4
|
||||
with:
|
||||
platforms: ${{ matrix.qemu-platforms }}
|
||||
-
|
||||
@@ -324,7 +314,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -347,7 +337,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Uninstall docker cli
|
||||
run: |
|
||||
@@ -375,7 +365,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Uninstall docker cli
|
||||
run: |
|
||||
@@ -401,42 +391,12 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
|
||||
standalone-install-error:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Uninstall docker cli
|
||||
run: |
|
||||
if dpkg -s "docker-ce" >/dev/null 2>&1; then
|
||||
sudo dpkg -r --force-depends docker-ce-cli docker-buildx-plugin
|
||||
else
|
||||
sudo apt-get purge -y moby-cli moby-buildx
|
||||
fi
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
continue-on-error: true
|
||||
uses: ./
|
||||
with:
|
||||
install: true
|
||||
-
|
||||
name: Check
|
||||
run: |
|
||||
echo "${{ toJson(steps.buildx) }}"
|
||||
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||
echo "::error::Should have failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
append:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Create dummy contexts
|
||||
run: |
|
||||
@@ -465,10 +425,10 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -480,7 +440,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Create Docker context
|
||||
run: |
|
||||
@@ -503,7 +463,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
@@ -511,22 +471,21 @@ jobs:
|
||||
cleanup: ${{ matrix.cleanup }}
|
||||
|
||||
k3s:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- latest
|
||||
- v0.11.0
|
||||
- v0.10.5
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Install k3s
|
||||
uses: crazy-max/.github/.github/actions/install-k3s@605d30d5ae97f6680578ace4b56645af79343e60
|
||||
with:
|
||||
version: "v1.21.2-k3s1"
|
||||
uses: crazy-max/.github/.github/actions/install-k3s@a94383ec9e125b23907fb6fcebf7ff87964595e5
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
@@ -559,3 +518,85 @@ jobs:
|
||||
uses: docker/build-push-action@master
|
||||
with:
|
||||
context: .
|
||||
|
||||
cache-binary:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
cache:
|
||||
- true
|
||||
- false
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
with:
|
||||
version: v0.11.2
|
||||
cache-binary: ${{ matrix.cache }}
|
||||
|
||||
windows-error:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
continue-on-error: true
|
||||
uses: ./
|
||||
-
|
||||
name: Check
|
||||
run: |
|
||||
echo "${{ toJson(steps.buildx) }}"
|
||||
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||
echo "::error::Should have failed"
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
keep-state:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
with:
|
||||
name: foo
|
||||
keep-state: true
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
with:
|
||||
name: foo
|
||||
keep-state: true
|
||||
|
||||
keep-state-error:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
continue-on-error: true
|
||||
uses: ./
|
||||
with:
|
||||
driver: docker
|
||||
keep-state: true
|
||||
-
|
||||
name: Check
|
||||
run: |
|
||||
echo "${{ toJson(steps.buildx) }}"
|
||||
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||
echo "::error::Should have failed"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,17 @@
|
||||
name: pr-assign-author
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
@@ -0,0 +1,21 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
@@ -1,5 +1,9 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -13,17 +17,18 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: ./
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v3
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
files: ./coverage/clover.xml
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
@@ -0,0 +1,49 @@
|
||||
name: update-dist
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
update-dist:
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: GitHub auth token from GitHub App
|
||||
id: docker-read-app
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||
owner: docker
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.docker-read-app.outputs.token || github.token }}
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
-
|
||||
name: Commit and push dist
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
(
|
||||
set -x
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add dist
|
||||
git commit -m "chore: update generated content"
|
||||
git push
|
||||
)
|
||||
else
|
||||
echo "No changes in dist"
|
||||
fi
|
||||
@@ -1,5 +1,9 @@
|
||||
name: validate
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -11,16 +15,17 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Targets matrix
|
||||
id: targets
|
||||
run: |
|
||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
with:
|
||||
target: validate
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -31,11 +36,8 @@ jobs:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v3
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
+14
-57
@@ -1,12 +1,5 @@
|
||||
/.dev
|
||||
node_modules
|
||||
lib
|
||||
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
@@ -24,34 +18,14 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
@@ -61,36 +35,19 @@ typings/
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.test
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
@@ -0,0 +1,6 @@
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/
|
||||
+1
-2
@@ -6,6 +6,5 @@
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": false,
|
||||
"arrowParens": "avoid",
|
||||
"parser": "typescript"
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
# https://yarnpkg.com/configuration/yarnrc
|
||||
|
||||
compressionLevel: mixed
|
||||
enableGlobalCache: false
|
||||
enableHardenedMode: true
|
||||
|
||||
logFilters:
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
- code: YN0086
|
||||
level: discard
|
||||
|
||||
nodeLinker: node-modules
|
||||
@@ -42,15 +42,15 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v5
|
||||
-
|
||||
# Add support for more platforms with QEMU (optional)
|
||||
# https://github.com/docker/setup-qemu-action
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
uses: docker/setup-buildx-action@v3
|
||||
```
|
||||
|
||||
## Configuring your builder
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
|
||||
### inputs
|
||||
|
||||
Following inputs can be used as `step.with` keys:
|
||||
The following inputs can be used as `step.with` keys:
|
||||
|
||||
> `List` type is a newline-delimited string
|
||||
> ```yaml
|
||||
@@ -85,33 +85,41 @@ Following inputs can be used as `step.with` keys:
|
||||
> platforms: linux/amd64,linux/arm64
|
||||
> ```
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|-------------------|----------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `version` | String | | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
|
||||
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
|
||||
| `driver-opts` | List | | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
||||
| `buildkitd-flags` | String | | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon |
|
||||
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
|
||||
| `use` | Bool | `true` | Switch to this builder instance |
|
||||
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
||||
| `platforms` | List/CSV | | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones. |
|
||||
| `config`¹ | String | | [BuildKit config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
||||
| `config-inline`¹ | String | | Same as `config` but inline |
|
||||
| `append` | YAML | | [Append additional nodes](docs/advanced/append-nodes.md) to the builder |
|
||||
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |
|
||||
| Name | Type | Default | Description |
|
||||
|------------------------------|----------|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `version` | String | | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
|
||||
| `name` | String | | Name of the builder. If not specified, one will be generated or if it already exists, it will be used instead of creating a new one |
|
||||
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
|
||||
| `driver-opts` | List | | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
||||
| `buildkitd-flags` | String | | [BuildKit daemon flags](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) |
|
||||
| `buildkitd-config` \* | String | | [BuildKit daemon config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
||||
| `buildkitd-config-inline` \* | String | | Same as `buildkitd-config` but inline |
|
||||
| `use` | Bool | `true` | Switch to this builder instance |
|
||||
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
||||
| `platforms` | List/CSV | | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones |
|
||||
| `append` | YAML | | [Append additional nodes](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder) to the builder |
|
||||
| `keep-state` | Bool | `false` | Keep BuildKit state on `cleanup`. This is only useful on persistent self-hosted runners |
|
||||
| `cache-binary` | Bool | `true` | Cache buildx binary to GitHub Actions cache backend |
|
||||
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |
|
||||
|
||||
> * ¹ `config` and `config-inline` are mutually exclusive
|
||||
> [!IMPORTANT]
|
||||
> If you set the `buildkitd-flags` input, the default flags (`--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host`)
|
||||
> will be reset. If you want to retain the default behavior, make sure to
|
||||
> include these flags in your custom `buildkitd-flags` value.
|
||||
|
||||
> [!NOTE]
|
||||
> `buildkitd-config` and `buildkitd-config-inline` are mutually exclusive.
|
||||
|
||||
### outputs
|
||||
|
||||
Following outputs are available
|
||||
The following outputs are available:
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------|--------|-------------------------------------------------|
|
||||
| `name` | String | Builder name |
|
||||
| `driver` | String | Builder driver |
|
||||
| `platforms` | String | Builder node platforms (preferred or available) |
|
||||
| `nodes` | JSON | Builder [nodes metadata](#nodes-output) |
|
||||
| Name | Type | Description |
|
||||
|-------------|--------|-----------------------------------------------------|
|
||||
| `name` | String | Builder name |
|
||||
| `driver` | String | Builder driver |
|
||||
| `platforms` | String | Builder node platforms (preferred and/or available) |
|
||||
| `nodes` | JSON | Builder [nodes metadata](#nodes-output) |
|
||||
|
||||
### environment variables
|
||||
|
||||
|
||||
+281
-24
@@ -1,16 +1,40 @@
|
||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import * as uuid from 'uuid';
|
||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
||||
import {beforeEach, describe, expect, test, vi} from 'vitest';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
import * as context from '../src/context';
|
||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||
import {Context} from '@docker/actions-toolkit/lib/context.js';
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
|
||||
jest.mock('uuid');
|
||||
jest.spyOn(uuid, 'v4').mockReturnValue('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||
|
||||
jest.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
|
||||
import * as context from '../src/context.js';
|
||||
|
||||
const fixturesDir = path.join(__dirname, 'fixtures');
|
||||
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'context-'));
|
||||
const tmpName = path.join(tmpDir, '.tmpname-vi');
|
||||
|
||||
vi.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||
if (!fs.existsSync(tmpDir)) {
|
||||
fs.mkdirSync(tmpDir, {recursive: true});
|
||||
}
|
||||
return tmpDir;
|
||||
});
|
||||
|
||||
vi.spyOn(Context, 'tmpName').mockImplementation((): string => {
|
||||
return tmpName;
|
||||
});
|
||||
|
||||
vi.mock('crypto', async () => {
|
||||
return {
|
||||
...(await vi.importActual('crypto')),
|
||||
randomUUID: vi.fn(() => '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d')
|
||||
};
|
||||
});
|
||||
|
||||
vi.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
|
||||
return Promise.resolve('default');
|
||||
});
|
||||
|
||||
@@ -30,9 +54,10 @@ describe('getCreateArgs', () => {
|
||||
0,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['install', 'false'],
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -47,9 +72,10 @@ describe('getCreateArgs', () => {
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['driver', 'docker'],
|
||||
['install', 'false'],
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -63,10 +89,11 @@ describe('getCreateArgs', () => {
|
||||
2,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['install', 'false'],
|
||||
['use', 'false'],
|
||||
['driver-opts', 'image=moby/buildkit:master\nnetwork=host'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -83,9 +110,10 @@ describe('getCreateArgs', () => {
|
||||
new Map<string, string>([
|
||||
['driver', 'remote'],
|
||||
['endpoint', 'tls://foo:1234'],
|
||||
['install', 'false'],
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -102,9 +130,10 @@ describe('getCreateArgs', () => {
|
||||
['driver', 'remote'],
|
||||
['platforms', 'linux/arm64,linux/arm/v7'],
|
||||
['endpoint', 'tls://foo:1234'],
|
||||
['install', 'false'],
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -119,10 +148,11 @@ describe('getCreateArgs', () => {
|
||||
5,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['install', 'false'],
|
||||
['use', 'false'],
|
||||
['driver-opts', `"env.no_proxy=localhost,127.0.0.1,.mydomain"`],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -136,10 +166,11 @@ describe('getCreateArgs', () => {
|
||||
6,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['install', 'false'],
|
||||
['use', 'false'],
|
||||
['platforms', 'linux/amd64\n"linux/arm64,linux/arm/v7"'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
@@ -153,25 +184,116 @@ describe('getCreateArgs', () => {
|
||||
7,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['install', 'false'],
|
||||
['use', 'false'],
|
||||
['driver', 'unknown'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||
'--driver', 'unknown',
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
8,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['use', 'false'],
|
||||
['buildkitd-config', path.join(fixturesDir, 'buildkitd.toml')],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||
'--driver', 'docker-container',
|
||||
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||
'--config', tmpName,
|
||||
]
|
||||
],
|
||||
[
|
||||
9,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['use', 'false'],
|
||||
['buildkitd-config-inline', 'debug = true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||
'--driver', 'docker-container',
|
||||
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||
'--config', tmpName,
|
||||
]
|
||||
],
|
||||
[
|
||||
10,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['use', 'false'],
|
||||
['driver', 'cloud'],
|
||||
['buildkitd-flags', '--allow-insecure-entitlement network.host'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||
'--driver', 'cloud',
|
||||
'--buildkitd-flags', '--allow-insecure-entitlement network.host',
|
||||
]
|
||||
],
|
||||
[
|
||||
11,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['use', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['keep-state', 'false'],
|
||||
['name', 'test-builder-name'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
'--name', 'test-builder-name',
|
||||
'--driver', 'docker-container',
|
||||
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||
'--use'
|
||||
]
|
||||
],
|
||||
[
|
||||
12,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['use', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['keep-state', 'true'],
|
||||
['name', 'test-builder-name'],
|
||||
]),
|
||||
[
|
||||
'create',
|
||||
'--name', 'test-builder-name',
|
||||
'--driver', 'docker-container',
|
||||
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||
'--use',
|
||||
]
|
||||
],
|
||||
])(
|
||||
'[%d] given buildx %s and %p as inputs, returns %p',
|
||||
'[%d] given buildx %o and %o as inputs, returns %o',
|
||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
setInput(name, value);
|
||||
});
|
||||
const toolkit = new Toolkit();
|
||||
jest.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||
return buildxVersion;
|
||||
});
|
||||
const inp = await context.getInputs();
|
||||
@@ -197,9 +319,10 @@ describe('getAppendArgs', () => {
|
||||
0,
|
||||
'v0.10.3',
|
||||
new Map<string, string>([
|
||||
['install', 'false'],
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
{
|
||||
"name": "aws_graviton2",
|
||||
@@ -222,13 +345,13 @@ describe('getAppendArgs', () => {
|
||||
]
|
||||
]
|
||||
])(
|
||||
'[%d] given buildx %s and %p as inputs, returns %p',
|
||||
'[%d] given buildx %o and %o as inputs, returns %o',
|
||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, node: Node, expected: Array<string>) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
setInput(name, value);
|
||||
});
|
||||
const toolkit = new Toolkit();
|
||||
jest.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||
return buildxVersion;
|
||||
});
|
||||
const inp = await context.getInputs();
|
||||
@@ -238,6 +361,140 @@ describe('getAppendArgs', () => {
|
||||
);
|
||||
});
|
||||
|
||||
describe('getVersion', () => {
|
||||
beforeEach(() => {
|
||||
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||
if (!key.startsWith('INPUT_')) {
|
||||
object[key] = process.env[key];
|
||||
}
|
||||
return object;
|
||||
}, {});
|
||||
});
|
||||
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
0,
|
||||
new Map<string, string>([
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
''
|
||||
],
|
||||
[
|
||||
1,
|
||||
new Map<string, string>([
|
||||
['version', 'latest'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'latest'
|
||||
],
|
||||
[
|
||||
2,
|
||||
new Map<string, string>([
|
||||
['version', 'edge'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'edge'
|
||||
],
|
||||
[
|
||||
3,
|
||||
new Map<string, string>([
|
||||
['version', 'v0.19.2'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'v0.19.2'
|
||||
],
|
||||
[
|
||||
4,
|
||||
new Map<string, string>([
|
||||
['version', 'latest'],
|
||||
['driver', 'cloud'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'cloud:latest'
|
||||
],
|
||||
[
|
||||
5,
|
||||
new Map<string, string>([
|
||||
['version', 'edge'],
|
||||
['driver', 'cloud'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'cloud:edge'
|
||||
],
|
||||
[
|
||||
6,
|
||||
new Map<string, string>([
|
||||
['driver', 'cloud'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'cloud:latest'
|
||||
],
|
||||
[
|
||||
7,
|
||||
new Map<string, string>([
|
||||
['version', 'cloud:v0.11.2-desktop.2'],
|
||||
['driver', 'cloud'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'cloud:v0.11.2-desktop.2'
|
||||
],
|
||||
[
|
||||
8,
|
||||
new Map<string, string>([
|
||||
['version', 'cloud:v0.11.2-desktop.2'],
|
||||
// defaults
|
||||
['use', 'true'],
|
||||
['cache-binary', 'true'],
|
||||
['cleanup', 'true'],
|
||||
['keep-state', 'false']
|
||||
]),
|
||||
'cloud:v0.11.2-desktop.2'
|
||||
],
|
||||
])(
|
||||
'[%d] given %o as inputs, returns version %o',
|
||||
async (num: number, inputs: Map<string, string>, expected: string) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
setInput(name, value);
|
||||
});
|
||||
const inp = await context.getInputs();
|
||||
expect(context.getVersion(inp)).toEqual(expected);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
|
||||
function getInputName(name: string): string {
|
||||
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
debug = true
|
||||
@@ -0,0 +1,12 @@
|
||||
import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-action-'));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/setup-buildx-action',
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
});
|
||||
+18
-12
@@ -18,32 +18,38 @@ inputs:
|
||||
description: 'List of additional driver-specific options. (eg. image=moby/buildkit:master)'
|
||||
required: false
|
||||
buildkitd-flags:
|
||||
description: 'Flags for buildkitd daemon'
|
||||
default: '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
|
||||
description: 'BuildKit daemon flags'
|
||||
required: false
|
||||
install:
|
||||
description: 'Sets up docker build command as an alias to docker buildx build'
|
||||
default: 'false'
|
||||
buildkitd-config:
|
||||
description: 'BuildKit daemon config file'
|
||||
required: false
|
||||
buildkitd-config-inline:
|
||||
description: 'Inline BuildKit daemon config'
|
||||
required: false
|
||||
use:
|
||||
description: 'Switch to this builder instance'
|
||||
default: 'true'
|
||||
required: false
|
||||
name:
|
||||
description: 'Name of the builder. If not specified, one will be generated or if it already exists, it will be used instead of creating a new one.'
|
||||
required: false
|
||||
endpoint:
|
||||
description: 'Optional address for docker socket or context from `docker context ls`'
|
||||
required: false
|
||||
platforms:
|
||||
description: 'Fixed platforms for current node. If not empty, values take priority over the detected ones'
|
||||
required: false
|
||||
config:
|
||||
description: 'BuildKit config file'
|
||||
required: false
|
||||
config-inline:
|
||||
description: 'Inline BuildKit config'
|
||||
required: false
|
||||
append:
|
||||
description: 'Append additional nodes to the builder'
|
||||
required: false
|
||||
keep-state:
|
||||
description: 'Keep BuildKit state on cleanup. This is only useful on persistent self-hosted runners.'
|
||||
default: 'false'
|
||||
required: false
|
||||
cache-binary:
|
||||
description: 'Cache buildx binary to GitHub Actions cache backend'
|
||||
default: 'true'
|
||||
required: false
|
||||
cleanup:
|
||||
description: 'Cleanup temp files and remove builder at the end of a job'
|
||||
default: 'true'
|
||||
@@ -66,6 +72,6 @@ outputs:
|
||||
description: 'Builder node flags (deprecated, use nodes output instead)'
|
||||
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node24'
|
||||
main: 'dist/index.js'
|
||||
post: 'dist/index.js'
|
||||
+45
-35
@@ -1,15 +1,21 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=16
|
||||
ARG DOCKER_VERSION=20.10.13
|
||||
ARG BUILDX_VERSION=0.8.1
|
||||
ARG NODE_VERSION=24
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
RUN apk add --no-cache cpio findutils git rsync
|
||||
WORKDIR /src
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||
set -e
|
||||
corepack enable
|
||||
yarn --version
|
||||
yarn config set --home enableTelemetry 0
|
||||
EOT
|
||||
|
||||
FROM base AS deps
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||
|
||||
@@ -18,62 +24,66 @@ COPY --from=deps /vendor /
|
||||
|
||||
FROM deps AS vendor-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /vendor/* .
|
||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
|
||||
git status --porcelain -- yarn.lock
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /vendor/* .
|
||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||
git status --porcelain -- yarn.lock
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS build
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||
RUN --mount=target=/context \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules <<EOT
|
||||
set -e
|
||||
rsync -a /context/. .
|
||||
rm -rf dist
|
||||
yarn run build
|
||||
mkdir /out
|
||||
cp -r dist /out
|
||||
EOT
|
||||
|
||||
FROM scratch AS build-update
|
||||
COPY --from=build /out /
|
||||
|
||||
FROM build AS build-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /out/* .
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||
git status --porcelain -- dist
|
||||
exit 1
|
||||
fi
|
||||
RUN --mount=target=/context \
|
||||
--mount=target=.,type=tmpfs <<EOT
|
||||
set -e
|
||||
rsync -a /context/. .
|
||||
git add -A
|
||||
rm -rf dist
|
||||
cp -rf /out/* .
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||
git status --porcelain -- dist
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS format
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run format \
|
||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
||||
yarn run format && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||
|
||||
FROM scratch AS format-update
|
||||
COPY --from=format /out /
|
||||
|
||||
FROM deps AS lint
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run lint
|
||||
|
||||
FROM docker:${DOCKER_VERSION} as docker
|
||||
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
|
||||
|
||||
FROM deps AS test
|
||||
ENV RUNNER_TEMP=/tmp/github_runner
|
||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
--mount=type=bind,from=docker,source=/usr/local/bin/docker,target=/usr/bin/docker \
|
||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/bin/buildx \
|
||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
|
||||
yarn run test --coverageDirectory=/tmp/coverage
|
||||
yarn run test --coverage --coverage.reportsDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
+301
@@ -0,0 +1,301 @@
|
||||
export const id = 606;
|
||||
export const ids = [606];
|
||||
export const modules = {
|
||||
|
||||
/***/ 606:
|
||||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (/* binding */ pMap)
|
||||
/* harmony export */ });
|
||||
/* unused harmony exports pMapIterable, pMapSkip */
|
||||
async function pMap(
|
||||
iterable,
|
||||
mapper,
|
||||
{
|
||||
concurrency = Number.POSITIVE_INFINITY,
|
||||
stopOnError = true,
|
||||
signal,
|
||||
} = {},
|
||||
) {
|
||||
return new Promise((resolve_, reject_) => {
|
||||
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
||||
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
||||
}
|
||||
|
||||
if (typeof mapper !== 'function') {
|
||||
throw new TypeError('Mapper function is required');
|
||||
}
|
||||
|
||||
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
||||
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
||||
}
|
||||
|
||||
const result = [];
|
||||
const errors = [];
|
||||
const skippedIndexesMap = new Map();
|
||||
let isRejected = false;
|
||||
let isResolved = false;
|
||||
let isIterableDone = false;
|
||||
let resolvingCount = 0;
|
||||
let currentIndex = 0;
|
||||
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
||||
|
||||
const signalListener = () => {
|
||||
reject(signal.reason);
|
||||
};
|
||||
|
||||
const cleanup = () => {
|
||||
signal?.removeEventListener('abort', signalListener);
|
||||
};
|
||||
|
||||
const resolve = value => {
|
||||
resolve_(value);
|
||||
cleanup();
|
||||
};
|
||||
|
||||
const reject = reason => {
|
||||
isRejected = true;
|
||||
isResolved = true;
|
||||
reject_(reason);
|
||||
cleanup();
|
||||
};
|
||||
|
||||
if (signal) {
|
||||
if (signal.aborted) {
|
||||
reject(signal.reason);
|
||||
}
|
||||
|
||||
signal.addEventListener('abort', signalListener, {once: true});
|
||||
}
|
||||
|
||||
const next = async () => {
|
||||
if (isResolved) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextItem = await iterator.next();
|
||||
|
||||
const index = currentIndex;
|
||||
currentIndex++;
|
||||
|
||||
// Note: `iterator.next()` can be called many times in parallel.
|
||||
// This can cause multiple calls to this `next()` function to
|
||||
// receive a `nextItem` with `done === true`.
|
||||
// The shutdown logic that rejects/resolves must be protected
|
||||
// so it runs only one time as the `skippedIndex` logic is
|
||||
// non-idempotent.
|
||||
if (nextItem.done) {
|
||||
isIterableDone = true;
|
||||
|
||||
if (resolvingCount === 0 && !isResolved) {
|
||||
if (!stopOnError && errors.length > 0) {
|
||||
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
|
||||
return;
|
||||
}
|
||||
|
||||
isResolved = true;
|
||||
|
||||
if (skippedIndexesMap.size === 0) {
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
|
||||
const pureResult = [];
|
||||
|
||||
// Support multiple `pMapSkip`'s.
|
||||
for (const [index, value] of result.entries()) {
|
||||
if (skippedIndexesMap.get(index) === pMapSkip) {
|
||||
continue;
|
||||
}
|
||||
|
||||
pureResult.push(value);
|
||||
}
|
||||
|
||||
resolve(pureResult);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
resolvingCount++;
|
||||
|
||||
// Intentionally detached
|
||||
(async () => {
|
||||
try {
|
||||
const element = await nextItem.value;
|
||||
|
||||
if (isResolved) {
|
||||
return;
|
||||
}
|
||||
|
||||
const value = await mapper(element, index);
|
||||
|
||||
// Use Map to stage the index of the element.
|
||||
if (value === pMapSkip) {
|
||||
skippedIndexesMap.set(index, value);
|
||||
}
|
||||
|
||||
result[index] = value;
|
||||
|
||||
resolvingCount--;
|
||||
await next();
|
||||
} catch (error) {
|
||||
if (stopOnError) {
|
||||
reject(error);
|
||||
} else {
|
||||
errors.push(error);
|
||||
resolvingCount--;
|
||||
|
||||
// In that case we can't really continue regardless of `stopOnError` state
|
||||
// since an iterable is likely to continue throwing after it throws once.
|
||||
// If we continue calling `next()` indefinitely we will likely end up
|
||||
// in an infinite loop of failed iteration.
|
||||
try {
|
||||
await next();
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
// Create the concurrent runners in a detached (non-awaited)
|
||||
// promise. We need this so we can await the `next()` calls
|
||||
// to stop creating runners before hitting the concurrency limit
|
||||
// if the iterable has already been marked as done.
|
||||
// NOTE: We *must* do this for async iterators otherwise we'll spin up
|
||||
// infinite `next()` calls by default and never start the event loop.
|
||||
(async () => {
|
||||
for (let index = 0; index < concurrency; index++) {
|
||||
try {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await next();
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
break;
|
||||
}
|
||||
|
||||
if (isIterableDone || isRejected) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
function pMapIterable(
|
||||
iterable,
|
||||
mapper,
|
||||
{
|
||||
concurrency = Number.POSITIVE_INFINITY,
|
||||
backpressure = concurrency,
|
||||
} = {},
|
||||
) {
|
||||
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
||||
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
||||
}
|
||||
|
||||
if (typeof mapper !== 'function') {
|
||||
throw new TypeError('Mapper function is required');
|
||||
}
|
||||
|
||||
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
||||
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
||||
}
|
||||
|
||||
if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {
|
||||
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
|
||||
}
|
||||
|
||||
return {
|
||||
async * [Symbol.asyncIterator]() {
|
||||
const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
||||
|
||||
const promises = [];
|
||||
let pendingPromisesCount = 0;
|
||||
let isDone = false;
|
||||
let index = 0;
|
||||
|
||||
function trySpawn() {
|
||||
if (isDone || !(pendingPromisesCount < concurrency && promises.length < backpressure)) {
|
||||
return;
|
||||
}
|
||||
|
||||
pendingPromisesCount++;
|
||||
|
||||
const promise = (async () => {
|
||||
const {done, value} = await iterator.next();
|
||||
|
||||
if (done) {
|
||||
pendingPromisesCount--;
|
||||
return {done: true};
|
||||
}
|
||||
|
||||
// Spawn if still below concurrency and backpressure limit
|
||||
trySpawn();
|
||||
|
||||
try {
|
||||
const returnValue = await mapper(await value, index++);
|
||||
|
||||
pendingPromisesCount--;
|
||||
|
||||
if (returnValue === pMapSkip) {
|
||||
const index = promises.indexOf(promise);
|
||||
|
||||
if (index > 0) {
|
||||
promises.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Spawn if still below backpressure limit and just dropped below concurrency limit
|
||||
trySpawn();
|
||||
|
||||
return {done: false, value: returnValue};
|
||||
} catch (error) {
|
||||
pendingPromisesCount--;
|
||||
isDone = true;
|
||||
return {error};
|
||||
}
|
||||
})();
|
||||
|
||||
promises.push(promise);
|
||||
}
|
||||
|
||||
trySpawn();
|
||||
|
||||
while (promises.length > 0) {
|
||||
const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop
|
||||
|
||||
promises.shift();
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (done) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Spawn if just dropped below backpressure limit and below the concurrency limit
|
||||
trySpawn();
|
||||
|
||||
if (value === pMapSkip) {
|
||||
continue;
|
||||
}
|
||||
|
||||
yield value;
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const pMapSkip = Symbol('skip');
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
};
|
||||
|
||||
//# sourceMappingURL=606.index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"606.index.js","mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":[".././node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the elemeLine truncated
|
||||
+39
-18
@@ -1,30 +1,51 @@
|
||||
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7799:function(r,i,a){"use strict";var s=this&&this.__createBinding||(Object.create?function(r,i,a,s){if(s===undefined)s=a;var p=Object.getOwnPropertyDescriptor(i,a);if(!p||("get"in p?!i.__esModule:p.writable||p.configurable)){p={enumerable:true,get:function(){return i[a]}}}Object.defineProperty(r,s,p)}:function(r,i,a,s){if(s===undefined)s=a;r[s]=i[a]});var p=this&&this.__setModuleDefault||(Object.create?function(r,i){Object.defineProperty(r,"default",{enumerable:true,value:i})}:function(r,i){r["default"]=i});var l=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a in r)if(a!=="default"&&Object.prototype.hasOwnProperty.call(r,a))s(i,r,a);p(i,r);return i};var c=this&&this.__awaiter||function(r,i,a,s){function adopt(r){return r instanceof a?r:new a((function(i){i(r)}))}return new(a||(a=Promise))((function(a,p){function fulfilled(r){try{step(s.next(r))}catch(r){p(r)}}function rejected(r){try{step(s["throw"](r))}catch(r){p(r)}}function step(r){r.done?a(r.value):adopt(r.value).then(fulfilled,rejected)}step((s=s.apply(r,i||[])).next())}))};Object.defineProperty(i,"__esModule",{value:true});i.saveCache=i.restoreCache=i.isFeatureAvailable=i.ReserveCacheError=i.ValidationError=void 0;const d=l(a(2186));const u=l(a(1017));const m=l(a(1518));const h=l(a(8245));const g=a(3434);class ValidationError extends Error{constructor(r){super(r);this.name="ValidationError";Object.setPrototypeOf(this,ValidationError.prototype)}}i.ValidationError=ValidationError;class ReserveCacheError extends Error{constructor(r){super(r);this.name="ReserveCacheError";Object.setPrototypeOf(this,ReserveCacheError.prototype)}}i.ReserveCacheError=ReserveCacheError;function checkPaths(r){if(!r||r.length===0){throw new ValidationError(`Path Validation Error: At least one directory or file path is required`)}}function checkKey(r){if(r.length>512){throw new ValidationError(`Key Validation Error: ${r} cannot be larger than 512 characters.`)}const i=/^[^,]*$/;if(!i.test(r)){throw new ValidationError(`Key Validation Error: ${r} cannot contain commas.`)}}function isFeatureAvailable(){return!!process.env["ACTIONS_CACHE_URL"]}i.isFeatureAvailable=isFeatureAvailable;function restoreCache(r,i,a,s,p=false){return c(this,void 0,void 0,(function*(){checkPaths(r);a=a||[];const l=[i,...a];d.debug("Resolved Keys:");d.debug(JSON.stringify(l));if(l.length>10){throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`)}for(const r of l){checkKey(r)}const c=yield m.getCompressionMethod();let y="";try{const i=yield h.getCacheEntry(l,r,{compressionMethod:c,enableCrossOsArchive:p});if(!(i===null||i===void 0?void 0:i.archiveLocation)){return undefined}if(s===null||s===void 0?void 0:s.lookupOnly){d.info("Lookup only - skipping download");return i.cacheKey}y=u.join(yield m.createTempDirectory(),m.getCacheFileName(c));d.debug(`Archive Path: ${y}`);yield h.downloadCache(i.archiveLocation,y,s);if(d.isDebug()){yield(0,g.listTar)(y,c)}const a=m.getArchiveFileSizeInBytes(y);d.info(`Cache Size: ~${Math.round(a/(1024*1024))} MB (${a} B)`);yield(0,g.extractTar)(y,c);d.info("Cache restored successfully");return i.cacheKey}catch(r){const i=r;if(i.name===ValidationError.name){throw r}else{d.warning(`Failed to restore: ${r.message}`)}}finally{try{yield m.unlinkFile(y)}catch(r){d.debug(`Failed to delete archive: ${r}`)}}return undefined}))}i.restoreCache=restoreCache;function saveCache(r,i,a,s=false){var p,l,y,v,b;return c(this,void 0,void 0,(function*(){checkPaths(r);checkKey(i);const c=yield m.getCompressionMethod();let x=-1;const w=yield m.resolvePaths(r);d.debug("Cache Paths:");d.debug(`${JSON.stringify(w)}`);if(w.length===0){throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`)}const S=yield m.createTempDirectory();const _=u.join(S,m.getCacheFileName(c));d.debug(`Archive Path: ${_}`);try{yield(0,g.createTar)(S,w,c);if(d.isDebug()){yield(0,g.listTar)(_,c)}const u=10*1024*1024*1024;const E=m.getArchiveFileSizeInBytes(_);d.debug(`File Size: ${E}`);if(E>u&&!m.isGhes()){throw new Error(`Cache size of ~${Math.round(E/(1024*1024))} MB (${E} B) is over the 10GB limit, not saving cache.`)}d.debug("Reserving Cache");const T=yield h.reserveCache(i,r,{compressionMethod:c,enableCrossOsArchive:s,cacheSize:E});if((p=T===null||T===void 0?void 0:T.result)===null||p===void 0?void 0:p.cacheId){x=(l=T===null||T===void 0?void 0:T.result)===null||l===void 0?void 0:l.cacheId}else if((T===null||T===void 0?void 0:T.statusCode)===400){throw new Error((v=(y=T===null||T===void 0?void 0:T.error)===null||y===void 0?void 0:y.message)!==null&&v!==void 0?v:`Cache size of ~${Math.round(E/(1024*1024))} MB (${E} B) is over the data cap limit, not saving cache.`)}else{throw new ReserveCacheError(`Unable to reserve cache with key ${i}, another job may be creating this cache. More details: ${(b=T===null||T===Line truncated
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
import './sourcemap-register.cjs';import{createRequire as i}from"module";var u={23311:function(i,u){var p=this&&this.__awaiter||function(i,u,p,A){function adopt(i){return i instanceof p?i:new p((function(u){u(i)}))}return new(p||(p=Promise))((function(p,g){function fulfilled(i){try{step(A.next(i))}catch(i){g(i)}}function rejected(i){try{step(A["throw"](i))}catch(i){g(i)}}function step(i){i.done?p(i.value):adopt(i.value).then(fulfilled,rejected)}step((A=A.apply(i,u||[])).next())}))};Object.defineProperty(u,"__esModule",{value:true});u.ClientStreamingCall=void 0;class ClientStreamingCall{constructor(i,u,p,A,g,C,S){this.method=i;this.requestHeaders=u;this.requests=p;this.headers=A;this.response=g;this.status=C;this.trailers=S}then(i,u){return this.promiseFinished().then((u=>i?Promise.resolve(i(u)):u),(i=>u?Promise.resolve(u(i)):Promise.reject(i)))}promiseFinished(){return p(this,void 0,void 0,(function*(){let[i,u,p,A]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:i,response:u,status:p,trailers:A}}))}}u.ClientStreamingCall=ClientStreamingCall},69499:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.Deferred=u.DeferredState=void 0;var p;(function(i){i[i["PENDING"]=0]="PENDING";i[i["REJECTED"]=1]="REJECTED";i[i["RESOLVED"]=2]="RESOLVED"})(p=u.DeferredState||(u.DeferredState={}));class Deferred{constructor(i=true){this._state=p.PENDING;this._promise=new Promise(((i,u)=>{this._resolve=i;this._reject=u}));if(i){this._promise.catch((i=>{}))}}get state(){return this._state}get promise(){return this._promise}resolve(i){if(this.state!==p.PENDING)throw new Error(`cannot resolve ${p[this.state].toLowerCase()}`);this._resolve(i);this._state=p.RESOLVED}reject(i){if(this.state!==p.PENDING)throw new Error(`cannot reject ${p[this.state].toLowerCase()}`);this._reject(i);this._state=p.REJECTED}resolvePending(i){if(this._state===p.PENDING)this.resolve(i)}rejectPending(i){if(this._state===p.PENDING)this.reject(i)}}u.Deferred=Deferred},40800:function(i,u){var p=this&&this.__awaiter||function(i,u,p,A){function adopt(i){return i instanceof p?i:new p((function(u){u(i)}))}return new(p||(p=Promise))((function(p,g){function fulfilled(i){try{step(A.next(i))}catch(i){g(i)}}function rejected(i){try{step(A["throw"](i))}catch(i){g(i)}}function step(i){i.done?p(i.value):adopt(i.value).then(fulfilled,rejected)}step((A=A.apply(i,u||[])).next())}))};Object.defineProperty(u,"__esModule",{value:true});u.DuplexStreamingCall=void 0;class DuplexStreamingCall{constructor(i,u,p,A,g,C,S){this.method=i;this.requestHeaders=u;this.requests=p;this.headers=A;this.responses=g;this.status=C;this.trailers=S}then(i,u){return this.promiseFinished().then((u=>i?Promise.resolve(i(u)):u),(i=>u?Promise.resolve(u(i)):Promise.reject(i)))}promiseFinished(){return p(this,void 0,void 0,(function*(){let[i,u,p]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:i,status:u,trailers:p}}))}}u.DuplexStreamingCall=DuplexStreamingCall},76762:(i,u,p)=>{var A;A={value:true};var g=p(42554);Object.defineProperty(u,"C0",{enumerable:true,get:function(){return g.ServiceType}});var C=p(83402);A={enumerable:true,get:function(){return C.readMethodOptions}};A={enumerable:true,get:function(){return C.readMethodOption}};A={enumerable:true,get:function(){return C.readServiceOption}};var S=p(50422);A={enumerable:true,get:function(){return S.RpcError}};var w=p(63474);A={enumerable:true,get:function(){return w.mergeRpcOptions}};var B=p(58788);A={enumerable:true,get:function(){return B.RpcOutputStreamController}};var v=p(37816);A={enumerable:true,get:function(){return v.TestTransport}};var N=p(69499);A={enumerable:true,get:function(){return N.Deferred}};A={enumerable:true,get:function(){return N.DeferredState}};var T=p(40800);A={enumerable:true,get:function(){return T.DuplexStreamingCall}};var Q=p(23311);A={enumerable:true,get:function(){return Q.ClientStreamingCall}};var x=p(22715);A={enumerable:true,get:function(){return x.ServerStreamingCall}};var _=p(80738);A={enumerable:true,get:function(){return _.UnaryCall}};var k=p(84359);A={enumerable:true,get:function(){return k.stackIntercept}};A={enumerable:true,get:function(){return k.stackDuplexStreamingInterceptors}};A={enumerable:true,get:function(){return k.stackClientStreamingInterceptors}};A={enumerable:true,get:function(){return k.stackServerStreamingInterceptors}};A={enumerable:true,get:function(){return k.stackUnaryInterceptors}};var O=p(44626);A={enumerable:true,get:function(){return O.ServerCallContextController}}},83402:(i,u,p)=>{Object.defineProperty(u,"__esModule",{value:true});u.readServiceOption=u.readMethodOption=u.readMethodOptions=u.normalizeMethodInfo=void 0;const A=p(88372);function normalizeMethodInfo(i,u){var p,g,C;let S=i;S.service=u;S.localName=(p=S.localName)!==null&&p!==void 0?p:A.lowerCamelCase(S.name);S.serverStreaming=!!S.serverStreaming;S.Line truncated
|
||||
/**
|
||||
* @preserve
|
||||
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/function isObject(r){return Object.prototype.toString.call(r)==="[object Object]"}function isPlainObject(r){var i,a;if(isObject(r)===false)return false;i=r.constructor;if(i===undefined)return true;a=i.prototype;if(isObject(a)===false)return false;if(a.hasOwnProperty("isPrototypeOf")===false){return false}return true}i.isPlainObject=isPlainObject},1917:(r,i,a)=>{"use strict";var s=a(1161);var p=a(8866);function renamed(r,i){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. "+"Use yaml."+i+" instead, which is now safe by default.")}}r.exports.Type=a(6073);r.exports.Schema=a(1082);r.exports.FAILSAFE_SCHEMA=a(8562);r.exports.JSON_SCHEMA=a(1035);r.exports.CORE_SCHEMA=a(2011);r.exports.DEFAULT_SCHEMA=a(8759);r.exports.load=s.load;r.exports.loadAll=s.loadAll;r.exports.dump=p.dump;r.exports.YAMLException=a(8179);r.exports.types={binary:a(7900),float:a(2705),map:a(6150),null:a(721),pairs:a(6860),set:a(9548),timestamp:a(9212),bool:a(4993),int:a(1615),merge:a(6104),omap:a(9046),seq:a(7283),str:a(3619)};r.exports.safeLoad=renamed("safeLoad","load");r.exports.safeLoadAll=renamed("safeLoadAll","loadAll");r.exports.safeDump=renamed("safeDump","dump")},6829:r=>{"use strict";function isNothing(r){return typeof r==="undefined"||r===null}function isObject(r){return typeof r==="object"&&r!==null}function toArray(r){if(Array.isArray(r))return r;else if(isNothing(r))return[];return[r]}function extend(r,i){var a,s,p,l;if(i){l=Object.keys(i);for(a=0,s=l.length;a<s;a+=1){p=l[a];r[p]=i[p]}}return r}function repeat(r,i){var a="",s;for(s=0;s<i;s+=1){a+=r}return a}function isNegativeZero(r){return r===0&&Number.NEGATIVE_INFINITY===1/r}r.exports.isNothing=isNothing;r.exports.isObject=isObject;r.exports.toArray=toArray;r.exports.repeat=repeat;r.exports.isNegativeZero=isNegativeZero;r.exports.extend=extend},8866:(r,i,a)=>{"use strict";var s=a(6829);var p=a(8179);var l=a(8759);var c=Object.prototype.toString;var d=Object.prototype.hasOwnProperty;var u=65279;var m=9;var h=10;var g=13;var y=32;var v=33;var b=34;var x=35;var w=37;var S=38;var _=39;var E=42;var T=44;var N=45;var P=58;var O=61;var C=62;var R=63;var A=64;var D=91;var k=93;var I=96;var L=123;var M=124;var B=125;var j={};j[0]="\\0";j[7]="\\a";j[8]="\\b";j[9]="\\t";j[10]="\\n";j[11]="\\v";j[12]="\\f";j[13]="\\r";j[27]="\\e";j[34]='\\"';j[92]="\\\\";j[133]="\\N";j[160]="\\_";j[8232]="\\L";j[8233]="\\P";var q=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];var z=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(r,i){var a,s,p,l,c,u,m;if(i===null)return{};a={};s=Object.keys(i);for(p=0,l=s.length;p<l;p+=1){c=s[p];u=String(i[c]);if(c.slice(0,2)==="!!"){c="tag:yaml.org,2002:"+c.slice(2)}m=r.compiledTypeMap["fallback"][c];if(m&&d.call(m.styleAliases,u)){u=m.styleAliases[u]}a[c]=u}return a}function encodeHex(r){var i,a,l;i=r.toString(16).toUpperCase();if(r<=255){a="x";l=2}else if(r<=65535){a="u";l=4}else if(r<=4294967295){a="U";l=8}else{throw new p("code point within a string may not be greater than 0xFFFFFFFF")}return"\\"+a+s.repeat("0",l-i.length)+i}var U=1,G=2;function State(r){this.schema=r["schema"]||l;this.indent=Math.max(1,r["indent"]||2);this.noArrayIndent=r["noArrayIndent"]||false;this.skipInvalid=r["skipInvalid"]||false;this.flowLevel=s.isNothing(r["flowLevel"])?-1:r["flowLevel"];this.styleMap=compileStyleMap(this.schema,r["styles"]||null);this.sortKeys=r["sortKeys"]||false;this.lineWidth=r["lineWidth"]||80;this.noRefs=r["noRefs"]||false;this.noCompatMode=r["noCompatMode"]||false;this.condenseFlow=r["condenseFlow"]||false;this.quotingType=r["quotingType"]==='"'?G:U;this.forceQuotes=r["forceQuotes"]||false;this.replacer=typeof r["replacer"]==="function"?r["replacer"]:null;this.implicitTypes=this.schema.compiledImplicit;this.explicitTypes=this.schema.compiledExplicit;this.tag=null;this.result="";this.duplicates=[];this.usedDuplicates=null}function indentString(r,i){var a=s.repeat(" ",i),p=0,l=-1,c="",d,u=r.length;while(p<u){l=r.indexOf("\n",p);if(l===-1){d=r.slice(p);p=u}else{d=r.slice(p,l+1);p=l+1}if(d.length&&d!=="\n")c+=a;c+=d}return c}function generateNextLine(r,i){return"\n"+s.repeat(" ",r.indent*i)}function testImplicitResolving(r,i){var a,s,p;for(a=0,s=r.implicitTypes.length;a<s;a+=1){p=r.implicitTypes[a];if(p.resolve(i)){return true}}return false}function isWhitespace(r){return r===y||r===m}function isPrintable(r){return 32<=r&&r<=126||161<=r&&r<=55295&&r!==8232&&r!==8233||57344<=r&&r<=65533&&r!==u||65536<=r&&r<=1114111}function isNsCharOrWhitespace(r){return isPrintable(r)&&r!==u&&r!==g&&r!==h}function isPlainSafe(r,i,a){var s=isNsCharOrWhitespace(r);var p=s&&!isWhitespace(r);return(a?s:s&&r!==T&&r!==D&&r!==k&&r!==L&&r!==B)&&r!==x&&!(i===P&&!p)||isNsCharOrWhitespace(i)&&!isWhitespace(i)&&r===x||i===P&&p}function isPlainSafeFirst(r){return isPrintable(r)&&r!==u&&!isWhitespace(r)&&r!==N&&r!==R&&r!==P&&r!==T&&r!==D&&r!==k&&r!==L&&r!==B&&r!==x&&r!==S&&r!==E&&r!==v&&r!==M&&r!==O&&r!==C&&r!=Line truncated
|
||||
/*!
|
||||
* mime-db
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
||||
* @see http://github.com/homebrewing/brauhaus-diff
|
||||
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
||||
* @see http://github.com/garycourt/murmurhash-js
|
||||
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
||||
* @see http://sites.google.com/site/murmurhash/
|
||||
*/
|
||||
r.exports=a(3765)},3583:(r,i,a)=>{"use strict";
|
||||
(function(){var u;function MurmurHash3(i,p){var A=this instanceof MurmurHash3?this:u;A.reset(p);if(typeof i==="string"&&i.length>0){A.hash(i)}if(A!==this){return A}}MurmurHash3.prototype.hash=function(i){var u,p,A,g,C;C=i.length;this.len+=C;p=this.k1;A=0;switch(this.rem){case 0:p^=C>A?i.charCodeAt(A++)&65535:0;case 1:p^=C>A?(i.charCodeAt(A++)&65535)<<8:0;case 2:p^=C>A?(i.charCodeAt(A++)&65535)<<16:0;case 3:p^=C>A?(i.charCodeAt(A)&255)<<24:0;p^=C>A?(i.charCodeAt(A++)&65280)>>8:0}this.rem=C+this.rem&3;C-=this.rem;if(C>0){u=this.h1;while(1){p=p*11601+(p&65535)*3432906752&4294967295;p=p<<15|p>>>17;p=p*13715+(p&65535)*461832192&4294967295;u^=p;u=u<<13|u>>>19;u=u*5+3864292196&4294967295;if(A>=C){break}p=i.charCodeAt(A++)&65535^(i.charCodeAt(A++)&65535)<<8^(i.charCodeAt(A++)&65535)<<16;g=i.charCodeAt(A++);p^=(g&255)<<24^(g&65280)>>8}p=0;switch(this.rem){case 3:p^=(i.charCodeAt(A+2)&65535)<<16;case 2:p^=(i.charCodeAt(A+1)&65535)<<8;case 1:p^=i.charCodeAt(A)&65535}this.h1=u}this.k1=p;return this};MurmurHash3.prototype.result=function(){var i,u;i=this.k1;u=this.h1;if(i>0){i=i*11601+(i&65535)*3432906752&4294967295;i=i<<15|i>>>17;i=i*13715+(i&65535)*461832192&4294967295;u^=i}u^=this.len;u^=u>>>16;u=u*51819+(u&65535)*2246770688&4294967295;u^=u>>>13;u=u*44597+(u&65535)*3266445312&4294967295;u^=u>>>16;return u>>>0};MurmurHash3.prototype.reset=function(i){this.h1=typeof i==="number"?i:0;this.rem=this.k1=this.len=0;return this};u=new MurmurHash3;if(true){i.exports=MurmurHash3}else{}})()},68850:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.AddressError=void 0;class AddressError extends Error{constructor(i,u){super(i);this.name="AddressError";if(u!==null){this.parseMessage=u}}}u.AddressError=AddressError},45864:(i,u)=>{Object.defineProperty(u,"__esModule",{value:true});u.isCorrect=u.isInSubnet=void 0;function isInSubnet(i){if(this.subnetMask<i.subnetMask){return false}if(this.mask(i.subnetMask)===i.mask()){return true}return false}u.isInSubnet=isInSubnet;function isCorrect(i){return function(){if(this.addressMinusSuffix!==this.correctForm()){return false}if(this.subnetMask===i&&!this.parsedSubnet){return true}return this.parsedSubnet===String(this.subnetMask)}}u.isCorrect=isCorrect},79253:function(i,u,p){var A=this&&this.__createBinding||(Object.create?function(i,u,p,A){if(A===undefined)A=p;var g=Object.getOwnPropertyDescriptor(u,p);if(!g||("get"in g?!u.__esModule:g.writable||g.configurable)){g={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,A,g)}:function(i,u,p,A){if(A===undefined)A=p;i[A]=u[p]});var g=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var C=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var p in i)if(p!=="default"&&Object.prototype.hasOwnProperty.call(i,p))A(u,i,p);g(u,i);return u};Object.defineProperty(u,"__esModule",{value:true});u.v6=u.AddressError=u.Address6=u.Address4=void 0;const S=p(17946);Object.defineProperty(u,"Address4",{enumerable:true,get:function(){return S.Address4}});const w=p(38096);Object.defineProperty(u,"Address6",{enumerable:true,get:function(){return w.Address6}});const B=p(68850);Object.defineProperty(u,"AddressError",{enumerable:true,get:function(){return B.AddressError}});const v=C(p(20339));u.v6={helpers:v}},17946:function(i,u,p){var A=this&&this.__createBinding||(Object.create?function(i,u,p,A){if(A===undefined)A=p;var g=Object.getOwnPropertyDescriptor(u,p);if(!g||("get"in g?!u.__esModule:g.writable||g.configurable)){g={enumerable:true,get:function(){return u[p]}}}Object.defineProperty(i,A,g)}:function(i,u,p,A){if(A===undefined)A=p;i[A]=u[p]});var g=this&&this.__setModuleDefault||(Object.create?function(i,u){Object.defineProperty(i,"default",{enumerable:true,value:u})}:function(i,u){i["default"]=u});var C=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var p in i)if(p!=="default"&&Object.prototype.hasOwnProperty.call(i,p))A(u,i,p);g(u,i);return u};Object.defineProperty(u,"__esModule",{value:true});u.Address4=void 0;const S=C(p(45864));const w=C(p(66437));const B=p(68850);const v=p(95947);const N=p(19973);class Address4{constructor(i){this.groups=w.GROUPS;this.parsedAddress=[];this.parsedSubnet="";this.subnet="/32";this.subnetMask=32;this.v4=true;this.isCorrect=S.isCorrect(w.BITS);this.isInSubnet=S.isInSubnet;this.address=i;const u=w.RE_SUBNET_STRING.exec(i);if(u){this.parsedSubnet=u[0].replace("/","");this.subnetMask=parseInt(this.parsedSubnet,10);this.subnet=`/${this.subnetMask}`;if(this.subnetMask<0||this.subnetMask>w.BITS){throw new B.AddressError("Invalid subnet mask.")}i=i.replace(w.RE_SUBNET_STRING,"")}this.addressMinusSuffix=i;this.parsedAddress=this.parse(i)}static isValid(i){try{new Address4(i);return true}catch(i){return false}}parse(i){const u=i.split(".");if(!i.match(w.RE_ADDRESS)){throw new B.AddressError("Invalid IPv4 address.")}return u}correctForLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2010-2012 Mikeal Rogers
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an "AS
|
||||
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/if(new S.URL(i.url).hostname!==w.hostname){i.headers.delete("authorization");i.headers.delete("cookie")}if(u.status===303||i.method==="POST"&&[301,302].includes(u.status)){A.method="GET";A.body=null;i.headers.delete("content-length")}A.headers={};i.headers.forEach(((i,u)=>{A.headers[u]=i}));A.counter=++i.counter;const B=new g(S.format(w),A);return{request:B,options:A}};const fetch=async(i,u)=>{const p=w.storable(i,u)?await B(i,u):await v(i,u);if(!["GET","HEAD"].includes(i.method)&&p.status>=200&&p.status<=399){await B.invalidate(i,u)}if(!canFollowRedirect(i,p,u)){return p}const A=getRedirect(i,p,u);return fetch(A.request,A.options)};i.exports=fetch},39310:(i,u,p)=>{const{FetchError:A,Headers:g,Request:C,Response:S}=p(88483);const w=p(99824);const B=p(67242);const makeFetchHappen=(i,u)=>{const p=w(u);const A=new C(i,p);return B(A,p)};makeFetchHappen.defaults=(i,u={},p=makeFetchHappen)=>{if(typeof i==="object"){u=i;i=null}const defaultedFetch=(A,g={})=>{const C=A||i;const S={...u,...g,headers:{...u.headers,...g.headers}};return p(C,S)};defaultedFetch.defaults=(i,u={})=>makeFetchHappen.defaults(i,u,defaultedFetch);return defaultedFetch};i.exports=makeFetchHappen;i.exports.FetchError=A;i.exports.Headers=g;i.exports.Request=C;i.exports.Response=S},99824:(i,u,p)=>{const A=p(72250);const g=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"];const configureOptions=i=>{const{strictSSL:u,...p}={...i};p.method=p.method?p.method.toUpperCase():"GET";if(u===undefined||u===null){p.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}else{p.rejectUnauthorized=u!==false}if(!p.retry){p.retry={retries:0}}else if(typeof p.retry==="string"){const i=parseInt(p.retry,10);if(isFinite(i)){p.retry={retries:i}}else{p.retry={retries:0}}}else if(typeof p.retry==="number"){p.retry={retries:p.retry}}else{p.retry={retries:0,...p.retry}}p.dns={ttl:5*60*1e3,lookup:A.lookup,...p.dns};p.cache=p.cache||"default";if(p.cache==="default"){const i=Object.keys(p.headers||{}).some((i=>g.includes(i.toLowerCase())));if(i){p.cache="no-store"}}p.cacheAdditionalHeaders=p.cacheAdditionalHeaders||[];if(p.cacheManager&&!p.cachePath){p.cachePath=p.cacheManager}return p};i.exports=configureOptions},22314:(i,u,p)=>{const A=p(52899);class CachingMinipassPipeline extends A{#a=[];#c=new Map;constructor(i,...u){super();this.#a=i.events;if(u.length){this.push(...u)}}on(i,u){if(this.#a.includes(i)&&this.#c.has(i)){return u(...this.#c.get(i))}return super.on(i,u)}emit(i,...u){if(this.#a.includes(i)){this.#c.set(i,u)}return super.emit(i,...u)}}i.exports=CachingMinipassPipeline},20766:(i,u,p)=>{const{Minipass:A}=p(78275);const g=p(88483);const{promiseRetry:C}=p(49498);const S=p(68951);const{log:w}=p(26687);const B=p(22314);const{getAgent:v}=p(57995);const N=p(96734);const T=`${N.name}/${N.version} (+https://npm.im/${N.name})`;const Q=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"];const x=["request-timeout"];const remoteFetch=(i,u)=>{const p=v(i.url,{...u,signal:undefined});if(!i.headers.has("connection")){i.headers.set("connection",p?"keep-alive":"close")}if(!i.headers.has("user-agent")){i.headers.set("user-agent",T)}const N={...u,agent:p,redirect:"manual"};return C((async(p,C)=>{const v=new g.Request(i,N);try{let i=await g(v,N);if(N.integrity&&i.status===200){const u=S.integrityStream({algorithms:N.algorithms,integrity:N.integrity,size:N.size});const p=new B({events:["integrity","size"]},i.body,u);u.on("integrity",(i=>p.emit("integrity",i)));u.on("size",(i=>p.emit("size",i)));i=new g.Response(p,i);i.body.hasIntegrityEmitter=true}i.headers.set("x-fetch-attempts",C);const T=A.isStream(v.body);const Q=v.method!=="POST"&&!T&&([408,420,429].includes(i.status)||i.status>=500);if(Q){if(typeof u.onRetry==="function"){u.onRetry(i)}w.http("fetch",`${v.method} ${v.url} attempt ${C} failed with ${i.status}`);return p(i)}return i}catch(i){const A=i.code==="EPROMISERETRY"?i.retried.code:i.code;const S=i.retried instanceof g.Response||Q.includes(A)&&x.includes(i.type);if(v.method==="POST"||S){throw i}if(typeof u.onRetry==="function"){u.onRetry(i)}w.http("fetch",`${v.method} ${v.url} attempt ${C} failed with ${i.code}`);return p(i)}}),u.retry).catch((i=>{if(i.status>=400&&i.type!=="system"){return i}throw i}))};i.exports=remoteFetch},43772:(i,u,p)=>{i.exports=minimatch;minimatch.Minimatch=Minimatch;var A=function(){try{return p(16928)}catch(i){}}()||{sep:"/"};minimatch.sep=A.sep;var g=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var C=p(73783);var S={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var w="[^/]";var B=w+"*?";var v="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var N="(?:(?!(?:\\/|^)\\.).)*?";var T=charSet("().*{}+?[]^$\\!");function charSet(i){return i.split("").reduce((function(i,u){i[u]=true;return i}),{})}var Q=/\/+/;minimatch.filter=filter;fu
Line truncated
|
||||
/*!
|
||||
* mime-types
|
||||
* Copyright(c) 2014 Jonathan Ong
|
||||
* negotiator
|
||||
* Copyright(c) 2012 Federico Romero
|
||||
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/var s=a(7426);var p=a(1017).extname;var l=/^\s*([^;\s]*)(?:;|\s|$)/;var c=/^text\//i;i.charset=charset;i.charsets={lookup:charset};i.contentType=contentType;i.extension=extension;i.extensions=Object.create(null);i.lookup=lookup;i.types=Object.create(null);populateMaps(i.extensions,i.types);function charset(r){if(!r||typeof r!=="string"){return false}var i=l.exec(r);var a=i&&s[i[1].toLowerCase()];if(a&&a.charset){return a.charset}if(i&&c.test(i[1])){return"UTF-8"}return false}function contentType(r){if(!r||typeof r!=="string"){return false}var a=r.indexOf("/")===-1?i.lookup(r):r;if(!a){return false}if(a.indexOf("charset")===-1){var s=i.charset(a);if(s)a+="; charset="+s.toLowerCase()}return a}function extension(r){if(!r||typeof r!=="string"){return false}var a=l.exec(r);var s=a&&i.extensions[a[1].toLowerCase()];if(!s||!s.length){return false}return s[0]}function lookup(r){if(!r||typeof r!=="string"){return false}var a=p("x."+r).toLowerCase().substr(1);if(!a){return false}return i.types[a]||false}function populateMaps(r,i){var a=["nginx","apache",undefined,"iana"];Object.keys(s).forEach((function forEachMimeType(p){var l=s[p];var c=l.extensions;if(!c||!c.length){return}r[p]=c;for(var d=0;d<c.length;d++){var u=c[d];if(i[u]){var m=a.indexOf(s[i[u]].source);var h=a.indexOf(l.source);if(i[u]!=="application/octet-stream"&&(m>h||m===h&&i[u].substr(0,12)==="application/")){continue}}i[u]=p}}))}},3973:(r,i,a)=>{r.exports=minimatch;minimatch.Minimatch=Minimatch;var s=function(){try{return a(1017)}catch(r){}}()||{sep:"/"};minimatch.sep=s.sep;var p=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var l=a(3717);var c={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var d="[^/]";var u=d+"*?";var m="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var h="(?:(?!(?:\\/|^)\\.).)*?";var g=charSet("().*{}+?[]^$\\!");function charSet(r){return r.split("").reduce((function(r,i){r[i]=true;return r}),{})}var y=/\/+/;minimatch.filter=filter;function filter(r,i){i=i||{};return function(a,s,p){return minimatch(a,r,i)}}function ext(r,i){i=i||{};var a={};Object.keys(r).forEach((function(i){a[i]=r[i]}));Object.keys(i).forEach((function(r){a[r]=i[r]}));return a}minimatch.defaults=function(r){if(!r||typeof r!=="object"||!Object.keys(r).length){return minimatch}var i=minimatch;var a=function minimatch(a,s,p){return i(a,s,ext(r,p))};a.Minimatch=function Minimatch(a,s){return new i.Minimatch(a,ext(r,s))};a.Minimatch.defaults=function defaults(a){return i.defaults(ext(r,a)).Minimatch};a.filter=function filter(a,s){return i.filter(a,ext(r,s))};a.defaults=function defaults(a){return i.defaults(ext(r,a))};a.makeRe=function makeRe(a,s){return i.makeRe(a,ext(r,s))};a.braceExpand=function braceExpand(a,s){return i.braceExpand(a,ext(r,s))};a.match=function(a,s,p){return i.match(a,s,ext(r,p))};return a};Minimatch.defaults=function(r){return minimatch.defaults(r).Minimatch};function minimatch(r,i,a){assertValidPattern(i);if(!a)a={};if(!a.nocomment&&i.charAt(0)==="#"){return false}return new Minimatch(i,a).match(r)}function Minimatch(r,i){if(!(this instanceof Minimatch)){return new Minimatch(r,i)}assertValidPattern(r);if(!i)i={};r=r.trim();if(!i.allowWindowsEscape&&s.sep!=="/"){r=r.split(s.sep).join("/")}this.options=i;this.set=[];this.pattern=r;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!i.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var r=this.pattern;var i=this.options;if(!i.nocomment&&r.charAt(0)==="#"){this.comment=true;return}if(!r){this.empty=true;return}this.parseNegate();var a=this.globSet=this.braceExpand();if(i.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,a);a=this.globParts=a.map((function(r){return r.split(y)}));this.debug(this.pattern,a);a=a.map((function(r,i,a){return r.map(this.parse,this)}),this);this.debug(this.pattern,a);a=a.filter((function(r){return r.indexOf(false)===-1}));this.debug(this.pattern,a);this.set=a}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var r=this.pattern;var i=false;var a=this.options;var s=0;if(a.nonegate)return;for(var p=0,l=r.length;p<l&&r.charAt(p)==="!";p++){i=!i;s++}if(s)this.pattern=r.substr(s);this.negate=i}minimatch.braceExpand=function(r,i){return braceExpand(r,i)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(r,i){if(!i){if(this instanceof Minimatch){i=this.options}else{i={}}}r=typeof r==="undefined"?this.pattern:r;assertValidPattern(r);if(i.nobrace||!/\{(?:(?!\{).)*\}/.test(r)){return[r]}return l(r)}var v=1024*64;var assertValidPattern=function(r){if(typeof r!=="string"){throw new TypeError("invalid pattern")}if(r.length>v){throw new TypeError("pattern is too long")}};Minimatch.prototype.parse=parse;var b={};function parse(r,i){assertValidPattern(r);var a=this.options;if(r==="**"){if(!a.noglobstar)return p;else r="*"}iLine truncated
|
||||
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var r=String.fromCharCode;var i=Math.floor;var fromCodePoint=function(){var a=16384;var s=[];var p;var l;var c=-1;var d=arguments.length;if(!d){return""}var u="";while(++c<d){var m=Number(arguments[c]);if(!isFinite(m)||m<0||m>1114111||i(m)!==m){throw RangeError("Invalid code point: "+m)}if(m<=65535){s.push(m)}else{m-=65536;p=(m>>10)+55296;l=m%1024+56320;s.push(p,l)}if(c+1===d||s.length>a){u+=r.apply(null,s);s.length=0}}return u};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:i)},5911:(r,i)=>{i=r.exports=SemVer;var a;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){a=function(){var r=Array.prototype.slice.call(arguments,0);r.unshift("SEMVER");console.log.apply(console,r)}}else{a=function(){}}i.SEMVER_SPEC_VERSION="2.0.0";var s=256;var p=Number.MAX_SAFE_INTEGER||9007199254740991;var l=16;var c=i.re=[];var d=i.src=[];var u=i.tokens={};var m=0;function tok(r){u[r]=m++}tok("NUMERICIDENTIFIER");d[u.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");d[u.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");d[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");d[u.MAINVERSION]="("+d[u.NUMERICIDENTIFIER]+")\\."+"("+d[u.NUMERICIDENTIFIER]+")\\."+"("+d[u.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");d[u.MAINVERSIONLOOSE]="("+d[u.NUMERICIDENTIFIERLOOSE]+")\\."+"("+d[u.NUMERICIDENTIFIERLOOSE]+")\\."+"("+d[u.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");d[u.PRERELEASEIDENTIFIER]="(?:"+d[u.NUMERICIDENTIFIER]+"|"+d[u.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");d[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+d[u.NUMERICIDENTIFIERLOOSE]+"|"+d[u.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");d[u.PRERELEASE]="(?:-("+d[u.PRERELEASEIDENTIFIER]+"(?:\\."+d[u.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");d[u.PRERELEASELOOSE]="(?:-?("+d[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+d[u.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");d[u.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");d[u.BUILD]="(?:\\+("+d[u.BUILDIDENTIFIER]+"(?:\\."+d[u.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");d[u.FULLPLAIN]="v?"+d[u.MAINVERSION]+d[u.PRERELEASE]+"?"+d[u.BUILD]+"?";d[u.FULL]="^"+d[u.FULLPLAIN]+"$";tok("LOOSEPLAIN");d[u.LOOSEPLAIN]="[v=\\s]*"+d[u.MAINVERSIONLOOSE]+d[u.PRERELEASELOOSE]+"?"+d[u.BUILD]+"?";tok("LOOSE");d[u.LOOSE]="^"+d[u.LOOSEPLAIN]+"$";tok("GTLT");d[u.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");d[u.XRANGEIDENTIFIERLOOSE]=d[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");d[u.XRANGEIDENTIFIER]=d[u.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");d[u.XRANGEPLAIN]="[v=\\s]*("+d[u.XRANGEIDENTIFIER]+")"+"(?:\\.("+d[u.XRANGEIDENTIFIER]+")"+"(?:\\.("+d[u.XRANGEIDENTIFIER]+")"+"(?:"+d[u.PRERELEASE]+")?"+d[u.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");d[u.XRANGEPLAINLOOSE]="[v=\\s]*("+d[u.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+d[u.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+d[u.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+d[u.PRERELEASELOOSE]+")?"+d[u.BUILD]+"?"+")?)?";tok("XRANGE");d[u.XRANGE]="^"+d[u.GTLT]+"\\s*"+d[u.XRANGEPLAIN]+"$";tok("XRANGELOOSE");d[u.XRANGELOOSE]="^"+d[u.GTLT]+"\\s*"+d[u.XRANGEPLAINLOOSE]+"$";tok("COERCE");d[u.COERCE]="(^|[^\\d])"+"(\\d{1,"+l+"})"+"(?:\\.(\\d{1,"+l+"}))?"+"(?:\\.(\\d{1,"+l+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");c[u.COERCERTL]=new RegExp(d[u.COERCE],"g");tok("LONETILDE");d[u.LONETILDE]="(?:~>?)";tok("TILDETRIM");d[u.TILDETRIM]="(\\s*)"+d[u.LONETILDE]+"\\s+";c[u.TILDETRIM]=new RegExp(d[u.TILDETRIM],"g");var h="$1~";tok("TILDE");d[u.TILDE]="^"+d[u.LONETILDE]+d[u.XRANGEPLAIN]+"$";tok("TILDELOOSE");d[u.TILDELOOSE]="^"+d[u.LONETILDE]+d[u.XRANGEPLAINLOOSE]+"$";tok("LONECARET");d[u.LONECARET]="(?:\\^)";tok("CARETTRIM");d[u.CARETTRIM]="(\\s*)"+d[u.LONECARET]+"\\s+";c[u.CARETTRIM]=new RegExp(d[u.CARETTRIM],"g");var g="$1^";tok("CARET");d[u.CARET]="^"+d[u.LONECARET]+d[u.XRANGEPLAIN]+"$";tok("CARETLOOSE");d[u.CARETLOOSE]="^"+d[u.LONECARET]+d[u.XRANGEPLAINLOOSE]+"$";tok("COMPARATORLOOSE");d[u.COMPARATORLOOSE]="^"+d[u.GTLT]+"\\s*("+d[u.LOOSEPLAIN]+")$|^$";tok("COMPARATOR");d[u.COMPARATOR]="^"+d[u.GTLT]+"\\s*("+d[u.FULLPLAIN]+")$|^$";tok("COMPARATORTRIM");d[u.COMPARATORTRIM]="(\\s*)"+d[u.GTLT]+"\\s*("+d[u.LOOSEPLAIN]+"|"+d[u.XRANGEPLAIN]+")";c[u.COMPARATORTRIM]=new RegExp(d[u.COMPARATORTRIM],"g");var y="$1$2$3";tok("HYPHENRANGE");d[u.HYPHENRANGE]="^\\s*("+d[u.XRANGEPLAIN]+")"+"\\s+-\\s+"+"("+d[u.XRANGEPLAIN]+")"+"\\s*$";tok("HYPHENRANGELOOSE");d[u.HYPHENRANGELOOSE]="^\\s*("+d[u.XRANGEPLAINLOOSE]+")"+"\\s+-\\s+"+"("+d[u.XRANGEPLAINLOOSE]+")"+"\\s*$";tok("STAR");d[u.STAR]="(<|>)?=?\\s*\\*";for(var v=0;v<m;v++){a(v,d[v]);if(!c[v]){c[v]=new RegExp(d[v])}}i.parse=parse;function parse(r,i){if(!i||typeof i!=="object"){i={loose:!!i,includePrerelease:false}}if(r instanceof SemVer)Line truncated
|
||||
*/
|
||||
var A=p(79168);var g=p(25111);var C=p(56008);var S=p(53672);i.exports=Negotiator;i.exports.Negotiator=Negotiator;function Negotiator(i){if(!(this instanceof Negotiator)){return new Negotiator(i)}this.request=i}Negotiator.prototype.charset=function charset(i){var u=this.charsets(i);return u&&u[0]};Negotiator.prototype.charsets=function charsets(i){return A(this.request.headers["accept-charset"],i)};Negotiator.prototype.encoding=function encoding(i,u){var p=this.encodings(i,u);return p&&p[0]};Negotiator.prototype.encodings=function encodings(i,u){var p=u||{};return g(this.request.headers["accept-encoding"],i,p.preferred)};Negotiator.prototype.language=function language(i){var u=this.languages(i);return u&&u[0]};Negotiator.prototype.languages=function languages(i){return C(this.request.headers["accept-language"],i)};Negotiator.prototype.mediaType=function mediaType(i){var u=this.mediaTypes(i);return u&&u[0]};Negotiator.prototype.mediaTypes=function mediaTypes(i){return S(this.request.headers.accept,i)};Negotiator.prototype.preferredCharset=Negotiator.prototype.charset;Negotiator.prototype.preferredCharsets=Negotiator.prototype.charsets;Negotiator.prototype.preferredEncoding=Negotiator.prototype.encoding;Negotiator.prototype.preferredEncodings=Negotiator.prototype.encodings;Negotiator.prototype.preferredLanguage=Negotiator.prototype.language;Negotiator.prototype.preferredLanguages=Negotiator.prototype.languages;Negotiator.prototype.preferredMediaType=Negotiator.prototype.mediaType;Negotiator.prototype.preferredMediaTypes=Negotiator.prototype.mediaTypes},79168:i=>{i.exports=preferredCharsets;i.exports.preferredCharsets=preferredCharsets;var u=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptCharset(i){var u=i.split(",");for(var p=0,A=0;p<u.length;p++){var g=parseCharset(u[p].trim(),p);if(g){u[A++]=g}}u.length=A;return u}function parseCharset(i,p){var A=u.exec(i);if(!A)return null;var g=A[1];var C=1;if(A[2]){var S=A[2].split(";");for(var w=0;w<S.length;w++){var B=S[w].trim().split("=");if(B[0]==="q"){C=parseFloat(B[1]);break}}}return{charset:g,q:C,i:p}}function getCharsetPriority(i,u,p){var A={o:-1,q:0,s:0};for(var g=0;g<u.length;g++){var C=specify(i,u[g],p);if(C&&(A.s-C.s||A.q-C.q||A.o-C.o)<0){A=C}}return A}function specify(i,u,p){var A=0;if(u.charset.toLowerCase()===i.toLowerCase()){A|=1}else if(u.charset!=="*"){return null}return{i:p,o:u.i,q:u.q,s:A}}function preferredCharsets(i,u){var p=parseAcceptCharset(i===undefined?"*":i||"");if(!u){return p.filter(isQuality).sort(compareSpecs).map(getFullCharset)}var A=u.map((function getPriority(i,u){return getCharsetPriority(i,p,u)}));return A.filter(isQuality).sort(compareSpecs).map((function getCharset(i){return u[A.indexOf(i)]}))}function compareSpecs(i,u){return u.q-i.q||u.s-i.s||i.o-u.o||i.i-u.i||0}function getFullCharset(i){return i.charset}function isQuality(i){return i.q>0}},25111:i=>{i.exports=preferredEncodings;i.exports.preferredEncodings=preferredEncodings;var u=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptEncoding(i){var u=i.split(",");var p=false;var A=1;for(var g=0,C=0;g<u.length;g++){var S=parseEncoding(u[g].trim(),g);if(S){u[C++]=S;p=p||specify("identity",S);A=Math.min(A,S.q||1)}}if(!p){u[C++]={encoding:"identity",q:A,i:g}}u.length=C;return u}function parseEncoding(i,p){var A=u.exec(i);if(!A)return null;var g=A[1];var C=1;if(A[2]){var S=A[2].split(";");for(var w=0;w<S.length;w++){var B=S[w].trim().split("=");if(B[0]==="q"){C=parseFloat(B[1]);break}}}return{encoding:g,q:C,i:p}}function getEncodingPriority(i,u,p){var A={encoding:i,o:-1,q:0,s:0};for(var g=0;g<u.length;g++){var C=specify(i,u[g],p);if(C&&(A.s-C.s||A.q-C.q||A.o-C.o)<0){A=C}}return A}function specify(i,u,p){var A=0;if(u.encoding.toLowerCase()===i.toLowerCase()){A|=1}else if(u.encoding!=="*"){return null}return{encoding:i,i:p,o:u.i,q:u.q,s:A}}function preferredEncodings(i,u,p){var A=parseAcceptEncoding(i||"");var g=p?function comparator(i,u){if(i.q!==u.q){return u.q-i.q}var A=p.indexOf(i.encoding);var g=p.indexOf(u.encoding);if(A===-1&&g===-1){return u.s-i.s||i.o-u.o||i.i-u.i}if(A!==-1&&g!==-1){return A-g}return A===-1?1:-1}:compareSpecs;if(!u){return A.filter(isQuality).sort(g).map(getFullEncoding)}var C=u.map((function getPriority(i,u){return getEncodingPriority(i,A,u)}));return C.filter(isQuality).sort(g).map((function getEncoding(i){return u[C.indexOf(i)]}))}function compareSpecs(i,u){return u.q-i.q||u.s-i.s||i.o-u.o||i.i-u.i}function getFullEncoding(i){return i.encoding}function isQuality(i){return i.q>0}},56008:i=>{i.exports=preferredLanguages;i.exports.preferredLanguages=preferredLanguages;var u=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function parseAcceptLanguage(i){var u=i.split(",");for(var p=0,A=0;p<u.length;p++){var g=parseLanguage(u[p].trim(),p);if(g){u[A++]=g}}u.length=A;return u}function parseLanguage(i,p){var A=u.exec(i);if(!A)return null;var g=A[1];var C=A[2];var S=g;if(C)S+="-"+C;var w=1;if(A[3]){var B=A[3].split(";");for(var v=0;v<B.length;v++){var N=B[v].split(Line truncated
|
||||
/*!
|
||||
* Tmp
|
||||
*
|
||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||
*
|
||||
* MIT Licensed
|
||||
*/
|
||||
const s=a(7147);const p=a(2037);const l=a(1017);const c=a(6113);const d={fs:s.constants,os:p.constants};const u=a(4959);const m="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",h=/XXXXXX/,g=3,y=(d.O_CREAT||d.fs.O_CREAT)|(d.O_EXCL||d.fs.O_EXCL)|(d.O_RDWR||d.fs.O_RDWR),v=p.platform()==="win32",b=d.EBADF||d.os.errno.EBADF,x=d.ENOENT||d.os.errno.ENOENT,w=448,S=384,_="exit",E=[],T=s.rmdirSync.bind(s),N=u.sync;let P=false;function tmpName(r,i){const a=_parseArguments(r,i),p=a[0],l=a[1];try{_assertAndSanitizeOptions(p)}catch(r){return l(r)}let c=p.tries;(function _getUniqueName(){try{const r=_generateTmpName(p);s.stat(r,(function(i){if(!i){if(c-- >0)return _getUniqueName();return l(new Error("Could not get a unique tmp filename, max tries reached "+r))}l(null,r)}))}catch(r){l(r)}})()}function tmpNameSync(r){const i=_parseArguments(r),a=i[0];_assertAndSanitizeOptions(a);let p=a.tries;do{const r=_generateTmpName(a);try{s.statSync(r)}catch(i){return r}}while(p-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(r,i){const a=_parseArguments(r,i),p=a[0],l=a[1];tmpName(p,(function _tmpNameCreated(r,i){if(r)return l(r);s.open(i,y,p.mode||S,(function _fileCreated(r,a){if(r)return l(r);if(p.discardDescriptor){return s.close(a,(function _discardCallback(r){return l(r,i,undefined,_prepareTmpFileRemoveCallback(i,-1,p,false))}))}else{const r=p.discardDescriptor||p.detachDescriptor;l(null,i,a,_prepareTmpFileRemoveCallback(i,r?-1:a,p,false))}}))}))}function fileSync(r){const i=_parseArguments(r),a=i[0];const p=a.discardDescriptor||a.detachDescriptor;const l=tmpNameSync(a);var c=s.openSync(l,y,a.mode||S);if(a.discardDescriptor){s.closeSync(c);c=undefined}return{name:l,fd:c,removeCallback:_prepareTmpFileRemoveCallback(l,p?-1:c,a,true)}}function dir(r,i){const a=_parseArguments(r,i),p=a[0],l=a[1];tmpName(p,(function _tmpNameCreated(r,i){if(r)return l(r);s.mkdir(i,p.mode||w,(function _dirCreated(r){if(r)return l(r);l(null,i,_prepareTmpDirRemoveCallback(i,p,false))}))}))}function dirSync(r){const i=_parseArguments(r),a=i[0];const p=tmpNameSync(a);s.mkdirSync(p,a.mode||w);return{name:p,removeCallback:_prepareTmpDirRemoveCallback(p,a,true)}}function _removeFileAsync(r,i){const _handler=function(r){if(r&&!_isENOENT(r)){return i(r)}i()};if(0<=r[0])s.close(r[0],(function(){s.unlink(r[1],_handler)}));else s.unlink(r[1],_handler)}function _removeFileSync(r){let i=null;try{if(0<=r[0])s.closeSync(r[0])}catch(r){if(!_isEBADF(r)&&!_isENOENT(r))throw r}finally{try{s.unlinkSync(r[1])}catch(r){if(!_isENOENT(r))i=r}}if(i!==null){throw i}}function _prepareTmpFileRemoveCallback(r,i,a,s){const p=_prepareRemoveCallback(_removeFileSync,[i,r],s);const l=_prepareRemoveCallback(_removeFileAsync,[i,r],s,p);if(!a.keep)E.unshift(p);return s?p:l}function _prepareTmpDirRemoveCallback(r,i,a){const p=i.unsafeCleanup?u:s.rmdir.bind(s);const l=i.unsafeCleanup?N:T;const c=_prepareRemoveCallback(l,r,a);const d=_prepareRemoveCallback(p,r,a,c);if(!i.keep)E.unshift(c);return a?c:d}function _prepareRemoveCallback(r,i,a,s){let p=false;return function _cleanupCallback(l){if(!p){const c=s||_cleanupCallback;const d=E.indexOf(c);if(d>=0)E.splice(d,1);p=true;if(a||r===T||r===N){return r(i)}else{return r(i,l||function(){})}}}}function _garbageCollector(){if(!P)return;while(E.length){try{E[0]()}catch(r){}}}function _randomChars(r){let i=[],a=null;try{a=c.randomBytes(r)}catch(i){a=c.pseudoRandomBytes(r)}for(var s=0;s<r;s++){i.push(m[a[s]%m.length])}return i.join("")}function _isBlank(r){return r===null||_isUndefined(r)||!r.trim()}function _isUndefined(r){return typeof r==="undefined"}function _parseArguments(r,i){if(typeof r==="function"){return[{},r]}if(_isUndefined(r)){return[{},i]}const a={};for(const i of Object.getOwnPropertyNames(r)){a[i]=r[i]}return[a,i]}function _generateTmpName(r){const i=r.tmpdir;if(!_isUndefined(r.name))return l.join(i,r.dir,r.name);if(!_isUndefined(r.template))return l.join(i,r.dir,r.template).replace(h,_randomChars(6));const a=[r.prefix?r.prefix:"tmp","-",process.pid,"-",_randomChars(12),r.postfix?"-"+r.postfix:""].join("");return l.join(i,r.dir,a)}function _assertAndSanitizeOptions(r){r.tmpdir=_getTmpDir(r);const i=r.tmpdir;if(!_isUndefined(r.name))_assertIsRelative(r.name,"name",i);if(!_isUndefined(r.dir))_assertIsRelative(r.dir,"dir",i);if(!_isUndefined(r.template)){_assertIsRelative(r.template,"template",i);if(!r.template.match(h))throw new Error(`Invalid template, found "${r.template}".`)}if(!_isUndefined(r.tries)&&isNaN(r.tries)||r.tries<0)throw new Error(`Invalid tries, found "${r.tries}".`);r.tries=_isUndefined(r.name)?r.tries||g:1;r.keep=!!r.keep;r.detachDescriptor=!!r.detachDescriptor;r.discardDescriptor=!!r.discardDescriptor;r.unsafeCleanup=!!r.unsafeCleanup;r.dir=_isUndefined(r.dir)?"":l.relative(i,_resolvePath(r.dir,i));r.template=_isUndefined(r.template)?undefined:l.relative(i,_resolvePath(r.template,i));r.template=_isBlank(r.template)?undefined:l.relative(r.dir,r.template);r.naLine truncated
|
||||
*/const g=p(79896);const C=p(70857);const S=p(16928);const w=p(76982);const B={fs:g.constants,os:C.constants};const v="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",N=/XXXXXX/,T=3,Q=(B.O_CREAT||B.fs.O_CREAT)|(B.O_EXCL||B.fs.O_EXCL)|(B.O_RDWR||B.fs.O_RDWR),x=C.platform()==="win32",_=B.EBADF||B.os.errno.EBADF,k=B.ENOENT||B.os.errno.ENOENT,O=448,D=384,P="exit",L=[],U=g.rmdirSync.bind(g);let H=false;function rimraf(i,u){return g.rm(i,{recursive:true},u)}function FN_RIMRAF_SYNC(i){return g.rmSync(i,{recursive:true})}function tmpName(i,u){const p=_parseArguments(i,u),A=p[0],C=p[1];_assertAndSanitizeOptions(A,(function(i,u){if(i)return C(i);let p=u.tries;(function _getUniqueName(){try{const i=_generateTmpName(u);g.stat(i,(function(u){if(!u){if(p-- >0)return _getUniqueName();return C(new Error("Could not get a unique tmp filename, max tries reached "+i))}C(null,i)}))}catch(i){C(i)}})()}))}function tmpNameSync(i){const u=_parseArguments(i),p=u[0];const A=_assertAndSanitizeOptionsSync(p);let C=A.tries;do{const i=_generateTmpName(A);try{g.statSync(i)}catch(u){return i}}while(C-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(i,u){const p=_parseArguments(i,u),A=p[0],C=p[1];tmpName(A,(function _tmpNameCreated(i,u){if(i)return C(i);g.open(u,Q,A.mode||D,(function _fileCreated(i,p){if(i)return C(i);if(A.discardDescriptor){return g.close(p,(function _discardCallback(i){return C(i,u,undefined,_prepareTmpFileRemoveCallback(u,-1,A,false))}))}else{const i=A.discardDescriptor||A.detachDescriptor;C(null,u,p,_prepareTmpFileRemoveCallback(u,i?-1:p,A,false))}}))}))}function fileSync(i){const u=_parseArguments(i),p=u[0];const A=p.discardDescriptor||p.detachDescriptor;const C=tmpNameSync(p);let S=g.openSync(C,Q,p.mode||D);if(p.discardDescriptor){g.closeSync(S);S=undefined}return{name:C,fd:S,removeCallback:_prepareTmpFileRemoveCallback(C,A?-1:S,p,true)}}function dir(i,u){const p=_parseArguments(i,u),A=p[0],C=p[1];tmpName(A,(function _tmpNameCreated(i,u){if(i)return C(i);g.mkdir(u,A.mode||O,(function _dirCreated(i){if(i)return C(i);C(null,u,_prepareTmpDirRemoveCallback(u,A,false))}))}))}function dirSync(i){const u=_parseArguments(i),p=u[0];const A=tmpNameSync(p);g.mkdirSync(A,p.mode||O);return{name:A,removeCallback:_prepareTmpDirRemoveCallback(A,p,true)}}function _removeFileAsync(i,u){const _handler=function(i){if(i&&!_isENOENT(i)){return u(i)}u()};if(0<=i[0])g.close(i[0],(function(){g.unlink(i[1],_handler)}));else g.unlink(i[1],_handler)}function _removeFileSync(i){let u=null;try{if(0<=i[0])g.closeSync(i[0])}catch(i){if(!_isEBADF(i)&&!_isENOENT(i))throw i}finally{try{g.unlinkSync(i[1])}catch(i){if(!_isENOENT(i))u=i}}if(u!==null){throw u}}function _prepareTmpFileRemoveCallback(i,u,p,A){const g=_prepareRemoveCallback(_removeFileSync,[u,i],A);const C=_prepareRemoveCallback(_removeFileAsync,[u,i],A,g);if(!p.keep)L.unshift(g);return A?g:C}function _prepareTmpDirRemoveCallback(i,u,p){const A=u.unsafeCleanup?rimraf:g.rmdir.bind(g);const C=u.unsafeCleanup?FN_RIMRAF_SYNC:U;const S=_prepareRemoveCallback(C,i,p);const w=_prepareRemoveCallback(A,i,p,S);if(!u.keep)L.unshift(S);return p?S:w}function _prepareRemoveCallback(i,u,p,A){let g=false;return function _cleanupCallback(C){if(!g){const S=A||_cleanupCallback;const w=L.indexOf(S);if(w>=0)L.splice(w,1);g=true;if(p||i===U||i===FN_RIMRAF_SYNC){return i(u)}else{return i(u,C||function(){})}}}}function _garbageCollector(){if(!H)return;while(L.length){try{L[0]()}catch(i){}}}function _randomChars(i){let u=[],p=null;try{p=w.randomBytes(i)}catch(u){p=w.pseudoRandomBytes(i)}for(let A=0;A<i;A++){u.push(v[p[A]%v.length])}return u.join("")}function _isUndefined(i){return typeof i==="undefined"}function _parseArguments(i,u){if(typeof i==="function"){return[{},i]}if(_isUndefined(i)){return[{},u]}const p={};for(const u of Object.getOwnPropertyNames(i)){p[u]=i[u]}return[p,u]}function _resolvePath(i,u,p){const A=S.isAbsolute(i)?i:S.join(u,i);g.stat(A,(function(i){if(i){g.realpath(S.dirname(A),(function(i,u){if(i)return p(i);p(null,S.join(u,S.basename(A)))}))}else{g.realpath(A,p)}}))}function _resolvePathSync(i,u){const p=S.isAbsolute(i)?i:S.join(u,i);try{g.statSync(p);return g.realpathSync(p)}catch(i){const u=g.realpathSync(S.dirname(p));return S.join(u,S.basename(p))}}function _generateTmpName(i){const u=i.tmpdir;if(!_isUndefined(i.name)){return S.join(u,i.dir,i.name)}if(!_isUndefined(i.template)){return S.join(u,i.dir,i.template).replace(N,_randomChars(6))}const p=[i.prefix?i.prefix:"tmp","-",process.pid,"-",_randomChars(12),i.postfix?"-"+i.postfix:""].join("");return S.join(u,i.dir,p)}function _assertOptionsBase(i){if(!_isUndefined(i.name)){const u=i.name;if(S.isAbsolute(u))throw new Error(`name option must not contain an absolute path, found "${u}".`);const p=S.basename(u);if(p===".."||p==="."||p!==u)throw new Error(`name option must not contain a path, found "${u}".`)}if(!_isUndefined(i.template)&&!i.template.match(N)){throw new Error(`Invalid teLine truncated
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=i=>i.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=i=>i.replace(/\r?\n|\r/g,"\r\n");const A=[];const g=new Uint8Array([13,10]);N=0;let C=false;for(const[u,S]of i){if(typeof S==="string"){const i=j.encode(p+`; name="${escape(normalizeLinefeeds(u))}"`+`\r\n\r\n${normalizeLinefeeds(S)}\r\n`);A.push(i);N+=i.byteLength}else{const i=j.encode(`${p}; name="${escape(normalizeLinefeeds(u))}"`+(S.name?`; filename="${escape(S.name)}"`:"")+"\r\n"+`Content-Type: ${S.type||"application/octet-stream"}\r\n\r\n`);A.push(i,S,g);if(typeof S.size==="number"){N+=i.byteLength+S.size+g.byteLength}else{C=true}}}const S=j.encode(`--${u}--\r\n`);A.push(S);N+=S.byteLength;if(C){N=null}v=i;B=async function*(){for(const i of A){if(i.stream){yield*i.stream()}else{yield i}}};T=`multipart/form-data; boundary=${u}`}else if(C(i)){v=i;N=i.size;if(i.type){T=i.type}}else if(typeof i[Symbol.asyncIterator]==="function"){if(u){throw new TypeError("keepalive")}if(A.isDisturbed(i)||i.locked){throw new TypeError("Response body object should not be disturbed or locked")}p=i instanceof ReadableStream?i:g(i)}if(typeof v==="string"||A.isBuffer(v)){N=Buffer.byteLength(v)}if(B!=null){let u;p=new ReadableStream({async start(){u=B(i)[Symbol.asyncIterator]()},async pull(i){const{value:A,done:g}=await u.next();if(g){queueMicrotask((()=>{i.close();i.byobRequest?.respond(0)}))}else{if(!D(p)){const u=new Uint8Array(A);if(u.byteLength){i.enqueue(u)}}}return i.desiredSize>0},async cancel(i){await u.return()},type:"bytes"})}const Q={stream:p,source:v,length:N};return[Q,T]}function safelyExtractBody(i,u=false){if(i instanceof ReadableStream){O(!A.isDisturbed(i),"The body has already been consumed.");O(!i.locked,"The stream is locked.")}return extractBody(i,u)}function cloneBody(i,u){const[p,A]=u.stream.tee();u.stream=p;return{stream:A,length:u.length,source:u.source}}function throwIfAborted(i){if(i.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(i){const u={blob(){return consumeBody(this,(i=>{let u=bodyMimeType(this);if(u===null){u=""}else if(u){u=U(u)}return new k([i],{type:u})}),i)},arrayBuffer(){return consumeBody(this,(i=>new Uint8Array(i).buffer),i)},text(){return consumeBody(this,T,i)},json(){return consumeBody(this,parseJSONFromBytes,i)},formData(){return consumeBody(this,(i=>{const u=bodyMimeType(this);if(u!==null){switch(u.essence){case"multipart/form-data":{const p=H(i,u);if(p==="failure"){throw new TypeError("Failed to parse body as FormData.")}const A=new Q;A[x]=p;return A}case"application/x-www-form-urlencoded":{const u=new URLSearchParams(i.toString());const p=new Q;for(const[i,A]of u){p.append(i,A)}return p}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),i)},bytes(){return consumeBody(this,(i=>new Uint8Array(i)),i)}};return u}function mixinBody(i){Object.assign(i.prototype,bodyMixinMethods(i))}async function consumeBody(i,u,p){_.brandCheck(i,p);if(bodyUnusable(i)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(i[x]);const A=B();const errorSteps=i=>A.reject(i);const successSteps=i=>{try{A.resolve(u(i))}catch(i){errorSteps(i)}};if(i[x].body==null){successSteps(Buffer.allocUnsafe(0));return A.promise}await v(i[x].body,successSteps,errorSteps);return A.promise}function bodyUnusable(i){const u=i[x].body;return u!=null&&(u.stream.locked||A.isDisturbed(u.stream))}function parseJSONFromBytes(i){return JSON.parse(T(i))}function bodyMimeType(i){const u=i[x].headersList;const p=N(u);if(p==="failure"){return null}return p}i.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:$,hasFinalizationRegistry:q,bodyUnusable:bodyUnusable}},4495:i=>{const u=["GET","HEAD","POST"];const p=new Set(u);const A=[101,204,205,304];const g=[301,302,303,307,308];const C=new Set(g);const S=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const w=new Set(S);const B=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const v=new Set(B);const N=["follow","manual","error"];const T=["GET","HEAD","OPTIONS","TRACE"];const Q=new Set(T);const x=["navigate","same-origin","no-cors","cors"];const _=["omit","same-origin","include"];const k=["default","no-store","reload","no-cache","force-cLine truncated
|
||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */w[S-4]=p[0];w[S-3]=p[1];w[S-2]=p[2];w[S-1]=p[3];w[1]=C;if(C===126){w.writeUInt16BE(g,2)}else if(C===127){w[2]=w[3]=0;w.writeUIntBE(g,4,6)}w[1]|=128;for(let i=0;i<g;++i){w[S+i]=u[i]^p[i&3]}return w}}i.exports={WebsocketFrameSend:WebsocketFrameSend}},19469:(i,u,p)=>{const{createInflateRaw:A,Z_DEFAULT_WINDOWBITS:g}=p(38522);const{isValidClientWindowBits:C}=p(98625);const S=Buffer.from([0,0,255,255]);const w=Symbol("kBuffer");const B=Symbol("kLength");class PerMessageDeflate{#ce;#e={};constructor(i){this.#e.serverNoContextTakeover=i.has("server_no_context_takeover");this.#e.serverMaxWindowBits=i.get("server_max_window_bits")}decompress(i,u,p){if(!this.#ce){let i=g;if(this.#e.serverMaxWindowBits){if(!C(this.#e.serverMaxWindowBits)){p(new Error("Invalid server_max_window_bits"));return}i=Number.parseInt(this.#e.serverMaxWindowBits)}this.#ce=A({windowBits:i});this.#ce[w]=[];this.#ce[B]=0;this.#ce.on("data",(i=>{this.#ce[w].push(i);this.#ce[B]+=i.length}));this.#ce.on("error",(i=>{this.#ce=null;p(i)}))}this.#ce.write(i);if(u){this.#ce.write(S)}this.#ce.flush((()=>{const i=Buffer.concat(this.#ce[w],this.#ce[B]);this.#ce[w].length=0;this.#ce[B]=0;p(null,i)}))}}i.exports={PerMessageDeflate:PerMessageDeflate}},81652:(i,u,p)=>{const{Writable:A}=p(57075);const g=p(34589);const{parserStates:C,opcodes:S,states:w,emptyBuffer:B,sentCloseFrameState:v}=p(20736);const{kReadyState:N,kSentClose:T,kResponse:Q,kReceivedClose:x}=p(61216);const{channels:_}=p(42414);const{isValidStatusCode:k,isValidOpcode:O,failWebsocketConnection:D,websocketMessageReceived:P,utf8Decode:L,isControlFrame:U,isTextBinaryFrame:H,isContinuationFrame:z}=p(98625);const{WebsocketFrameSend:j}=p(3264);const{closeWebSocketConnection:q}=p(86897);const{PerMessageDeflate:$}=p(19469);class ByteParser extends A{#le=[];#ue=0;#de=false;#k=C.INFO;#he={};#pe=[];#fe;constructor(i,u){super();this.ws=i;this.#fe=u==null?new Map:u;if(this.#fe.has("permessage-deflate")){this.#fe.set("permessage-deflate",new $(u))}}_write(i,u,p){this.#le.push(i);this.#ue+=i.length;this.#de=true;this.run(p)}run(i){while(this.#de){if(this.#k===C.INFO){if(this.#ue<2){return i()}const u=this.consume(2);const p=(u[0]&128)!==0;const A=u[0]&15;const g=(u[1]&128)===128;const w=!p&&A!==S.CONTINUATION;const B=u[1]&127;const v=u[0]&64;const N=u[0]&32;const T=u[0]&16;if(!O(A)){D(this.ws,"Invalid opcode received");return i()}if(g){D(this.ws,"Frame cannot be masked");return i()}if(v!==0&&!this.#fe.has("permessage-deflate")){D(this.ws,"Expected RSV1 to be clear.");return}if(N!==0||T!==0){D(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(w&&!H(A)){D(this.ws,"Invalid frame type was fragmented.");return}if(H(A)&&this.#pe.length>0){D(this.ws,"Expected continuation frame");return}if(this.#he.fragmented&&w){D(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((B>125||w)&&U(A)){D(this.ws,"Control frame either too large or fragmented");return}if(z(A)&&this.#pe.length===0&&!this.#he.compressed){D(this.ws,"Unexpected continuation frame");return}if(B<=125){this.#he.payloadLength=B;this.#k=C.READ_DATA}else if(B===126){this.#k=C.PAYLOADLENGTH_16}else if(B===127){this.#k=C.PAYLOADLENGTH_64}if(H(A)){this.#he.binaryType=A;this.#he.compressed=v!==0}this.#he.opcode=A;this.#he.masked=g;this.#he.fin=p;this.#he.fragmented=w}else if(this.#k===C.PAYLOADLENGTH_16){if(this.#ue<2){return i()}const u=this.consume(2);this.#he.payloadLength=u.readUInt16BE(0);this.#k=C.READ_DATA}else if(this.#k===C.PAYLOADLENGTH_64){if(this.#ue<8){return i()}const u=this.consume(8);const p=u.readUInt32BE(0);if(p>2**31-1){D(this.ws,"Received payload length > 2^31 bytes.");return}const A=u.readUInt32BE(4);this.#he.payloadLength=(p<<8)+A;this.#k=C.READ_DATA}else if(this.#k===C.READ_DATA){if(this.#ue<this.#he.payloadLength){return i()}const u=this.consume(this.#he.payloadLength);if(U(this.#he.opcode)){this.#de=this.parseControlFrame(u);this.#k=C.INFO}else{if(!this.#he.compressed){this.#pe.push(u);if(!this.#he.fragmented&&this.#he.fin){const i=Buffer.concat(this.#pe);P(this.ws,this.#he.binaryType,i);this.#pe.length=0}this.#k=C.INFO}else{this.#fe.get("permessage-deflate").decompress(u,this.#he.fin,((u,p)=>{if(u){q(this.ws,1007,u.message,u.message.length);return}this.#pe.push(p);if(!this.#he.fin){this.#k=C.INFO;this.#de=true;this.run(i);return}P(this.ws,this.#he.binaryType,Buffer.concat(this.#pe));this.#de=true;this.#k=C.INFO;this.#pe.length=0;this.run(i)}));this.#de=false;break}}}}}consume(i){if(i>this.#ue){throw new Error("Called consume() before buffers satiated.")}else if(i===0){return B}if(this.#le[0].length===i){this.#ue-=this.#le[0].length;return this.#le.shift()}const u=Buffer.allocUnsafe(i);let p=0;while(p!==i){const A=this.#le[0];const{length:g}=A;if(g+p===i){u.set(this.#le.shift(),p);break}else if(g+p>i){u.set(A.subarray(0,i-p),p);this.#le[0]=A.subarray(i-p);break}else{u.set(this.#le.shift(),p);p+=A.length}}this.#ue-=i;return u}parseCloseBody(i){g(i.length!==1);let u;if(i.lengtLine truncated
|
||||
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
||||
function isNothing(i){return typeof i==="undefined"||i===null}function isObject(i){return typeof i==="object"&&i!==null}function toArray(i){if(Array.isArray(i))return i;else if(isNothing(i))return[];return[i]}function extend(i,u){var p,A,g,C;if(u){C=Object.keys(u);for(p=0,A=C.length;p<A;p+=1){g=C[p];i[g]=u[g]}}return i}function repeat(i,u){var p="",A;for(A=0;A<u;A+=1){p+=i}return p}function isNegativeZero(i){return i===0&&Number.NEGATIVE_INFINITY===1/i}var w=isNothing;var B=isObject;var v=toArray;var N=repeat;var T=isNegativeZero;var Q=extend;var x={isNothing:w,isObject:B,toArray:v,repeat:N,isNegativeZero:T,extend:Q};function formatError(i,u){var p="",A=i.reason||"(unknown reason)";if(!i.mark)return A;if(i.mark.name){p+='in "'+i.mark.name+'" '}p+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")";if(!u&&i.mark.snippet){p+="\n\n"+i.mark.snippet}return A+" "+p}function YAMLException$1(i,u){Error.call(this);this.name="YAMLException";this.reason=i;this.mark=u;this.message=formatError(this,false);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack||""}}YAMLException$1.prototype=Object.create(Error.prototype);YAMLException$1.prototype.constructor=YAMLException$1;YAMLException$1.prototype.toString=function toString(i){return this.name+": "+formatError(this,i)};var _=YAMLException$1;function getLine(i,u,p,A,g){var C="";var S="";var w=Math.floor(g/2)-1;if(A-u>w){C=" ... ";u=A-w+C.length}if(p-A>w){S=" ...";p=A+w-S.length}return{str:C+i.slice(u,p).replace(/\t/g,"→")+S,pos:A-u+C.length}}function padStart(i,u){return x.repeat(" ",u-i.length)+i}function makeSnippet(i,u){u=Object.create(u||null);if(!i.buffer)return null;if(!u.maxLength)u.maxLength=79;if(typeof u.indent!=="number")u.indent=1;if(typeof u.linesBefore!=="number")u.linesBefore=3;if(typeof u.linesAfter!=="number")u.linesAfter=2;var p=/\r?\n|\r|\0/g;var A=[0];var g=[];var C;var S=-1;while(C=p.exec(i.buffer)){g.push(C.index);A.push(C.index+C[0].length);if(i.position<=C.index&&S<0){S=A.length-2}}if(S<0)S=A.length-1;var w="",B,v;var N=Math.min(i.line+u.linesAfter,g.length).toString().length;var T=u.maxLength-(u.indent+N+3);for(B=1;B<=u.linesBefore;B++){if(S-B<0)break;v=getLine(i.buffer,A[S-B],g[S-B],i.position-(A[S]-A[S-B]),T);w=x.repeat(" ",u.indent)+padStart((i.line-B+1).toString(),N)+" | "+v.str+"\n"+w}v=getLine(i.buffer,A[S],g[S],i.position,T);w+=x.repeat(" ",u.indent)+padStart((i.line+1).toString(),N)+" | "+v.str+"\n";w+=x.repeat("-",u.indent+N+3+v.pos)+"^"+"\n";for(B=1;B<=u.linesAfter;B++){if(S+B>=g.length)break;v=getLine(i.buffer,A[S+B],g[S+B],i.position-(A[S]-A[S+B]),T);w+=x.repeat(" ",u.indent)+padStart((i.line+B+1).toString(),N)+" | "+v.str+"\n"}return w.replace(/\n$/,"")}var k=makeSnippet;var O=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"];var D=["scalar","sequence","mapping"];function compileStyleAliases(i){var u={};if(i!==null){Object.keys(i).forEach((function(p){i[p].forEach((function(i){u[String(i)]=p}))}))}return u}function Type$1(i,u){u=u||{};Object.keys(u).forEach((function(u){if(O.indexOf(u)===-1){throw new _('Unknown option "'+u+'" is met in definition of "'+i+'" YAML type.')}}));this.options=u;this.tag=i;this.kind=u["kind"]||null;this.resolve=u["resolve"]||function(){return true};this.construct=u["construct"]||function(i){return i};this.instanceOf=u["instanceOf"]||null;this.predicate=u["predicate"]||null;this.represent=u["represent"]||null;this.representName=u["representName"]||null;this.defaultStyle=u["defaultStyle"]||null;this.multi=u["multi"]||false;this.styleAliases=compileStyleAliases(u["styleAliases"]||null);if(D.indexOf(this.kind)===-1){throw new _('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}}var P=Type$1;function compileList(i,u){var p=[];i[u].forEach((function(i){var u=p.length;p.forEach((function(p,A){if(p.tag===i.tag&&p.kind===i.kind&&p.multi===i.multi){u=A}}));p[u]=i}));return p}function compileMap(){var i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},u,p;function collectType(u){if(u.multi){i.multi[u.kind].push(u);i.multi["fallback"].push(u)}else{i[u.kind][u.tag]=i["fallback"][u.tag]=u}}for(u=0,p=arguments.length;u<p;u+=1){arguments[u].forEach(collectType)}return i}function Schema$1(i){return this.extend(i)}Schema$1.prototype.extend=function extend(i){var u=[];var p=[];if(i instanceof P){p.push(i)}else if(Array.isArray(i)){p=p.concat(i)}else if(i&&(Array.isArray(i.implicit)||Array.isArray(i.explicit))){if(i.implicit)u=u.concat(i.implicit);if(i.explicit)p=p.concat(i.explicit)}else{throw new _("Schema.extend argument should be a Type, [ Type ], "+"or a schema definition ({ implicit: [...], explicit: [...] })")}u.forEach((function(i){if(!(i instanceof P)){throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")}if(i.loadKind&&i.loadKind!=="scalar"){throw new _("There is a non-scalar type inLine truncated
|
||||
/* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */if("response"in p){this.response=p.response}const A=Object.assign({},p.request);if(p.request.headers.authorization){A.headers=Object.assign({},p.request.headers,{authorization:p.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})}A.url=A.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=A}}var Km="10.0.8";var Zm={headers:{"user-agent":`octokit-request.js/${Km} ${getUserAgent()}`}};function dist_bundle_isPlainObject(i){if(typeof i!=="object"||i===null)return false;if(Object.prototype.toString.call(i)!=="[object Object]")return false;const u=Object.getPrototypeOf(i);if(u===null)return true;const p=Object.prototype.hasOwnProperty.call(u,"constructor")&&u.constructor;return typeof p==="function"&&p instanceof p&&Function.prototype.call(p)===Function.prototype.call(i)}var noop=()=>"";async function fetchWrapper(i){const u=i.request?.fetch||globalThis.fetch;if(!u){throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing")}const p=i.request?.log||console;const A=i.request?.parseSuccessResponseBody!==false;const g=dist_bundle_isPlainObject(i.body)||Array.isArray(i.body)?JSONStringify(i.body):i.body;const C=Object.fromEntries(Object.entries(i.headers).map((([i,u])=>[i,String(u)])));let S;try{S=await u(i.url,{method:i.method,body:g,redirect:i.request?.redirect,headers:C,signal:i.request?.signal,...i.body&&{duplex:"half"}})}catch(u){let p="Unknown Error";if(u instanceof Error){if(u.name==="AbortError"){u.status=500;throw u}p=u.message;if(u.name==="TypeError"&&"cause"in u){if(u.cause instanceof Error){p=u.cause.message}else if(typeof u.cause==="string"){p=u.cause}}}const A=new RequestError(p,500,{request:i});A.cause=u;throw A}const w=S.status;const B=S.url;const v={};for(const[i,u]of S.headers){v[i]=u}const N={url:B,status:w,headers:v,data:""};if("deprecation"in v){const u=v.link&&v.link.match(/<([^<>]+)>; rel="deprecation"/);const A=u&&u.pop();p.warn(`[@octokit/request] "${i.method} ${i.url}" is deprecated. It is scheduled to be removed on ${v.sunset}${A?`. See ${A}`:""}`)}if(w===204||w===205){return N}if(i.method==="HEAD"){if(w<400){return N}throw new RequestError(S.statusText,w,{response:N,request:i})}if(w===304){N.data=await getResponseData(S);throw new RequestError("Not modified",w,{response:N,request:i})}if(w>=400){N.data=await getResponseData(S);throw new RequestError(toErrorMessage(N.data),w,{response:N,request:i})}N.data=A?await getResponseData(S):S.body;return N}async function getResponseData(i){const u=i.headers.get("content-type");if(!u){return i.text().catch(noop)}const p=(0,Fm.xL)(u);if(isJSONResponse(p)){let u="";try{u=await i.text();return JSONParse(u)}catch(i){return u}}else if(p.type.startsWith("text/")||p.parameters.charset?.toLowerCase()==="utf-8"){return i.text().catch(noop)}else{return i.arrayBuffer().catch((
|
||||
/* v8 ignore next -- @preserve */
|
||||
()=>new ArrayBuffer(0)))}}function isJSONResponse(i){return i.type==="application/json"||i.type==="application/scim+json"}function toErrorMessage(i){if(typeof i==="string"){return i}if(i instanceof ArrayBuffer){return"Unknown error"}if("message"in i){const u="documentation_url"in i?` - ${i.documentation_url}`:"";return Array.isArray(i.errors)?`${i.message}: ${i.errors.map((i=>JSON.stringify(i))).join(", ")}${u}`:`${i.message}${u}`}return`Unknown error: ${JSON.stringify(i)}`}function dist_bundle_withDefaults(i,u){const p=i.defaults(u);const newApi=function(i,u){const A=p.merge(i,u);if(!A.request||!A.request.hook){return fetchWrapper(p.parse(A))}const request2=(i,u)=>fetchWrapper(p.parse(p.merge(i,u)));Object.assign(request2,{endpoint:p,defaults:dist_bundle_withDefaults.bind(null,p)});return A.request.hook(request2,A)};return Object.assign(newApi,{endpoint:p,defaults:dist_bundle_withDefaults.bind(null,p)})}var Xm=dist_bundle_withDefaults(Lm,Zm);
|
||||
/* v8 ignore next -- @preserve */
|
||||
/* v8 ignore else -- @preserve */var ey="0.0.0-development";function _buildMessageForResponseErrors(i){return`Request failed due to following response errors:\n`+i.errors.map((i=>` - ${i.message}`)).join("\n")}var ty=class extends Error{constructor(i,u,p){super(_buildMessageForResponseErrors(p));this.request=i;this.headers=u;this.response=p;this.errors=p.errors;this.data=p.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var ry=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var sy=["query","method","url"];var ny=/\/api\/v3\/?$/;function graphql(i,u,p){if(p){if(typeof u==="string"&&"query"in p){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const i in p){if(!sy.includes(i))continue;return Promise.reject(new Error(`[@octokit/graphql] "${i}" cannot be used as variable name`))}}const A=typeof u==="string"?Object.assign({query:u},p):u;const g=Object.keys(A).reduce(((i,u)=>{if(ry.includes(u)){i[u]=A[u];return i}if(!i.variables){i.variables={}}i.variables[u]=A[u];return i}),{});const C=A.baseUrl||i.endpoint.DEFAULTS.baseUrl;if(ny.test(C)){g.url=C.replace(ny,"/api/graphql")}return i(g).then((i=>{if(i.data.errors){const u={};for(const p of Object.keys(i.headers)){u[p]=i.headers[p]}throw new ty(g,u,i.data)}return i.data.data}))}function graphql_dist_bundle_withDefaults(i,u){const p=i.defaults(u);const newApi=(i,u)=>graphql(p,i,u);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,p),endpoint:p.endpoint})}var iy=graphql_dist_bundle_withDefaults(Xm,{headers:{"user-agent":`octokit-graphql.js/${ey} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(i){return graphql_dist_bundle_withDefaults(i,{method:"POST",url:"/graphql"})}var oy="(?:[a-zA-Z0-9_-]+)";var ay="\\.";var cy=new RegExp(`^${oy}${ay}${oy}${ay}${oy}$`);var ly=cy.test.bind(cy);async function auth(i){const u=ly(i);const p=i.startsWith("v1.")||i.startsWith("ghs_");const A=i.startsWith("ghu_");const g=u?"app":p?"installation":A?"user-to-server":"oauth";return{type:"token",token:i,tokenType:g}}function withAuthorizationPrefix(i){if(i.split(/\./).length===3){return`bearer ${i}`}return`token ${i}`}async function hook(i,u,p,A){const g=u.endpoint.merge(p,A);g.headers.authorization=withAuthorizationPrefix(i);return u(g)}var uy=function createTokenAuth2(i){if(!i){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof i!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}i=i.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,i),{hook:hook.bind(null,i)})};const dy="7.0.6";const dist_src_noop=()=>{};const hy=console.warn.bind(console);const py=console.error.bind(console);function createLogger(i={}){if(typeof i.debug!=="function"){i.debug=dist_src_noop}if(typeof i.info!=="function"){i.info=dist_src_noop}if(typeof i.warn!=="function"){i.warn=hy}if(typeof i.error!=="function"){i.error=py}return i}const fy=`octokit-core.js/${dy} ${getUserAgent()}`;class Octokit{static VERSION=dy;static defaults(i){const u=class extends(this){constructor(...u){const p=u[0]||{};if(typeof i==="function"){super(i(p));return}super(Object.assign({},i,p,p.userAgent&&i.userAgent?{userAgent:`${p.userAgent} ${i.userAgent}`}:null))}};return u}static plugins=[];static plugin(...i){const u=this.plugins;const p=class extends(this){static plugins=u.concat(i.filter((i=>!u.includes(i))))};return p}constructor(i={}){const u=new km.Collection;const p={baseUrl:Xm.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},i.request,{hook:u.bind(null,"request")}),mediaType:{previews:[],format:""}};p.headers["user-agent"]=i.userAgent?`${i.userAgent} ${fy}`:fy;if(i.baseUrl){p.baseUrl=i.baseUrl}if(i.previews){p.mediaType.previews=i.previews}if(i.timeZone){p.headers["time-zone"]=i.timeZone}this.request=Xm.defaults(p);this.graphql=withCustomRequest(this.request).defaults(p);this.log=createLogger(i.log);this.hook=u;if(!i.authStrategy){if(!i.auth){this.auth=async()=>({type:"unauthenticated"})}else{const p=uy(i.auth);u.wrap("request",p.hook);this.auth=p}}else{const{authStrategy:p,...A}=i;const g=p(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:A},i.auth));u.wrap("request",g.hook);this.auth=g}const A=this.constructor;for(let u=0;u<A.plugins.length;++u){Object.assign(this,A.plugins[u](this,i))}}request;graphql;log;hook;auth}const Ay="17.0.0";const gy={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repositoLine truncated
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/cache.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/internal/cacheHttpClient.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/internal/cacheUtils.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/internal/constants.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/internal/downloadUtils.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/internal/requestUtils.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/internal/tar.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/lib/options.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/uuid/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/uuid/lib/bytesToUuid.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/uuid/lib/rng.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/uuid/v1.js","../webpack:/docker-setup-buildx/node_modules/@actions/cache/node_modules/uuid/v4.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/command.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/core.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/file-command.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/path-utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/summary.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/md5.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/nil.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/parse.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/regex.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/rng.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/sha1.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/stringify.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v1.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v3.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v35.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v4.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v5.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/validate.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/version.js","../webpack:/docker-setup-buildx/node_modules/@actions/exec/lib/exec.js","../webpack:/docker-setup-buildx/node_modules/@actions/exec/lib/toolrunner.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/context.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/github.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/glob.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-glob-options-helper.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-globber.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-match-kind.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-path-helper.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-path.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-pattern-helper.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-pattern.js","../webpack:/docker-setup-buildx/node_modules/@actions/glob/lib/internal-search-state.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/lib/auth.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/lib/index.js","../webpack:/docker-setup-buildx/node_modules/Line truncated
|
||||
{"version":3,"file":"index.js","names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","Object","defineProperty","exports","ClientStreamingCall","constructor","method","requestHeaders","request","headers","response","status","trailers","requests","onfulfilled","onrejected","promiseFinished","reason","all","Deferred","DeferredState","preventUnhandledRejectionWarning","_state","PENDING","_promise","_resolve","_reject","catch","_","state","promise","Error","toLowerCase","RESOLVED","REJECTED","resolvePending","val","rejectPending","DuplexStreamingCall","responses","__webpack_unused_export__","service_type_1","__webpack_require__","enumerable","get","ServiceType","reflection_info_1","readMethodOptions","readMethodOption","readServiceOption","rpc_error_1","RpcError","rpc_options_1","mergeRpcOptions","rpc_output_stream_1","RpcOutputStreamController","test_transport_1","TestTransport","deferred_1","duplex_streaming_call_1","client_streaming_call_1","server_streaming_call_1","ServerStreamingCall","unary_call_1","UnaryCall","rpc_interceptor_1","stackIntercept","stackDuplexStreamingInterceptors","stackClientStreamingInterceptors","stackServerStreamingInterceptors","stackUnaryInterceptors","server_call_context_1","ServerCallContextController","normalizeMethodInfo","runtime_1","service","_a","_b","_c","m","localName","lowerCamelCase","name","serverStreaming","clientStreaming","options","idempotency","undefined","methodName","extensionName","extensionType","methods","find","i","fromJson","optionVal","message","code","meta","super","setPrototypeOf","prototype","toString","l","push","serviceName","entries","length","k","v","join","kind","transport","input","_d","tail","mtd","inp","opt","unary","curr","interceptors","filter","interceptUnary","reverse","interceptServerStreaming","interceptClientStreaming","duplex","interceptDuplex","assertNever","defaults","o","copy","key","keys","jsonOptions","mergeJsonOptions","binaryOptions","mergeBinaryOptions","concat","a","into","c","Date","getTime","Array","isArray","_lis","nxt","msg","err","cmp","_closed","_itState","q","onNext","callback","addLis","onMessage","onError","onComplete","list","indexOf","splice","clearLis","values","closed","notifyNext","error","complete","assert","notifyMessage","notifyError","notifyComplete","pushIt","forEach","Symbol","asyncIterator","p","first","shift","deadline","sendResponseHeadersFn","defaultStatus","detail","_cancelled","_listeners","_sendRH","notifyCancelled","sendResponseHeaders","data","cancelled","onCancel","typeName","map","suppressUncaughtRejections","headerDelay","responseDelay","betweenResponseDelay","afterResponseDelay","sentMessages","lastInput","TestInputStream","sent","single","sendComplete","completed","promiseHeaders","defaultHeaders","promiseSingleResponse","r","O","create","is","streamResponses","stream","abort","messages","delay","promiseStatus","promiseTrailers","defaultTrailers","maybeSuppressUncaught","mergeOptions","headersPromise","responsePromise","statusPromise","trailersPromise","outputStream","responseStreamClosedPromise","responseHeader","responseTrailer","ms","aborted","id","setTimeout","addEventListener","ev","clearTimeout","_completed","_sent","send","inputMessage","delayMs","inputComplete","assertFloat32","assertUInt32","assertInt32","condition","FLOAT32_MAX","FLOAT32_MIN","UINT32_MAX","INT32_MAX","INT32_MIN","arg","Number","isInteger","isFinite","base64encode","base64decode","encTable","split","decTable","charCodeAt","base64Str","es","bytes","Uint8Array","bytePos","groupPos","b","subarray","base64","WireType","UnknownFieldHandler","symbol","for","onRead","fieldNo","wireType","container","no","onWrite","writer","tag","raw","uf","last","slice","assign","BinaryReader","binaryReadOptions","binary_format_contract_1","pb_long_1","goog_varint_1","defaultsRead","readUnknownField","readerFactory","buf","textDecoder","varint64","varint64read","uint32","varint32read","len","pos","view","DataView","buffer","byteOffset","byteLength","TextDecoder","fatal","ignoreBOM","skip","start","Varint","Bit64","Bit32","LengthDelimited","StartGroup","t","EndGroup","assertBounds","RangeError","int32","sint32","zze","int64","PbLong","uint64","PbULong","sint64","lo","hi","s","bool","fixed32","getUint32","sfixed32","getInt32","fixed64","sfixed64","float","getFloat32","double","getFloat64","string","decode","BinaryWriter","binaryWriteOptions","assert_1","defaultsWrite","writeUnknownFields","writerFactory","textEncoder","stack","TextEncoder","chunks","finish","offset","set","fork","chunk","prev","pop","type","varint32write","encode","setFloat32","setFloat64","setUint32","setInt32","long","from","varint64write","sign","listEnumNumbers","listEnumNames","listEnumValues","isEnumObject","hasOwnProperty","num","parseInt","isNaN","nam","enumObject","number","index","arr","int64toString","int64fromString","lowBits","highBits","mLine truncated
|
||||
+2
-1970
File diff suppressed because it is too large.
Load diff
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
(()=>{var e={296:e=>{var r=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},599:(e,r,n)=>{e=n.nmd(e);var t=n(927).SourceMapConsumer;var o=n(928);var i;try{i=n(896);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(296);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var d=[];var h=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n<e.length;n++){var t=e[n](r);if(t){return t}}return null}}var m=handlerExec(d);d.push((function(e){e=e.trim();if(/^file:/.test(e)){e=e.replace(/file:\/\/\/(\w:)?/,(function(e,r){return r?"":"/"}))}if(e in p){return p[e]}var r="";try{if(!i){var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);if(n.readyState===4&&n.status===200){r=n.responseText}}else if(i.existsSync(e)){r=i.readFileSync(e,"utf8")}}catch(e){}return p[e]=r}));function supportRelativeURL(e,r){if(!e)return r;var n=o.dirname(e);var t=/^\w+:\/\/[^\/]*/.exec(n);var i=t?t[0]:"";var a=n.slice(i.length);if(i&&/^\/\w\:/.test(a)){i+="/";return i+o.resolve(n.slice(i.length),r).replace(/\\/g,"/")}return i+o.resolve(n.slice(i.length),r)}function retrieveSourceMapURL(e){var r;if(isInBrowser()){try{var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);r=n.readyState===4?n.responseText:null;var t=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(t){return t}}catch(e){}}r=m(e);var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;var i,a;while(a=o.exec(r))i=a;if(!i)return null;return i[1]}var v=handlerExec(h);h.push((function(e){var r=retrieveSourceMapURL(e);if(!r)return null;var n;if(g.test(r)){var t=r.slice(r.indexOf(",")+1);n=a(t,"base64").toString();r=e}else{r=supportRelativeURL(e,r);n=m(r)}if(!n){return null}return{url:r,map:n}}));function mapSourcePosition(e){var r=f[e.source];if(!r){var n=v(e.source);if(n){r=f[e.source]={url:n.url,map:new t(n.map)};if(r.map.sourcesContent){r.map.sources.forEach((function(e,n){var t=r.map.sourcesContent[n];if(t){var o=supportRelativeURL(r.url,e);p[o]=t}}))}}else{r=f[e.source]={url:null,map:null}}}if(r&&r.map&&typeof r.map.originalPositionFor==="function"){var o=r.map.originalPositionFor(e);if(o.source!==null){o.source=supportRelativeURL(r.url,o.source);return o}}return e}function mapEvalOrigin(e){var r=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);if(r){var n=mapSourcePosition({source:r[2],line:+r[3],column:r[4]-1});return"eval at "+r[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}r=/^eval at ([^(]+) \((.+)\)$/.exec(e);if(r){return"eval at "+r[1]+" ("+mapEvalOrigin(r[2])+")"}return e}function CallSiteToString(){var e;var r="";if(this.isNative()){r="native"}else{e=this.getScriptNameOrSourceURL();if(!e&&this.isEval()){r=this.getEvalOrigin();r+=", "}if(e){r+=e}else{r+="<anonymous>"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"<anonymous>")}}else if(u){o+="new "+(i||"<aLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},274:(e,r,n)=>{var t=n(339);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t<o;t++){n.add(e[t],r)}return n};ArraySet.prototype.size=function ArraySet_size(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length};ArraySet.prototype.add=function ArraySet_add(e,r){var n=i?e:t.toSetString(e);var a=i?this.has(e):o.call(this._set,n);var u=this._array.length;if(!a||r){this._array.push(e)}if(!a){if(i){this._set.set(e,u)}else{this._set[n]=u}}};ArraySet.prototype.has=function ArraySet_has(e){if(i){return this._set.has(e)}else{var r=t.toSetString(e);return o.call(this._set,r)}};ArraySet.prototype.indexOf=function ArraySet_indexOf(e){if(i){var r=this._set.get(e);if(r>=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e<this._array.length){return this._array[e]}throw new Error("No element indexed by "+e)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};r.I=ArraySet},449:(e,r,n)=>{var t=n(190);var o=5;var i=1<<o;var a=i-1;var u=i;function toVLQSigned(e){return e<0?(-e<<1)+1:(e<<1)+0}function fromVLQSigned(e){var r=(e&1)===1;var n=e>>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<<l);l+=o}while(c);n.value=fromVLQSigned(s);n.rest=r}},190:(e,r)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e<n.length){return n[e]}throw new TypeError("Must be between 0 and 63: "+e)};r.decode=function(e){var r=65;var n=90;var t=97;var o=122;var i=48;var a=57;var u=43;var s=47;var l=26;var c=52;if(r<=e&&e<=n){return e-r}if(t<=e&&e<=o){return e-t+l}if(i<=e&&e<=a){return e-i+c}if(e==u){return 62}if(e==s){return 63}return-1}},345:(e,r)=>{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n<o.length?n:-1}else{return u}}else{if(u-e>1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},680:(e,r,n)=>{var t=n(339);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},758:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n<t){var o=randomIntInRange(n,t);var i=n-1;swap(e,o,t);var a=e[t];for(var u=n;u<t;u++){if(r(e[u],Line truncated
|
||||
+15
-2
@@ -1,9 +1,15 @@
|
||||
target "_common" {
|
||||
args = {
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
|
||||
group "pre-checkin" {
|
||||
targets = ["vendor-update", "format", "build"]
|
||||
targets = ["vendor", "format", "build"]
|
||||
}
|
||||
|
||||
group "validate" {
|
||||
@@ -11,42 +17,49 @@ group "validate" {
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "build-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor-update" {
|
||||
target "vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Append additional nodes to the builder
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder)
|
||||
@@ -1,3 +0,0 @@
|
||||
# Authentication support
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#authentication-for-remote-builders)
|
||||
@@ -1,3 +0,0 @@
|
||||
# BuildKit daemon configuration
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-daemon-configuration)
|
||||
@@ -1,3 +0,0 @@
|
||||
# Standalone mode
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#standalone-mode)
|
||||
@@ -0,0 +1,52 @@
|
||||
import {defineConfig} from 'eslint/config';
|
||||
import js from '@eslint/js';
|
||||
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||
import vitest from '@vitest/eslint-plugin';
|
||||
import globals from 'globals';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
||||
import eslintPluginPrettier from 'eslint-plugin-prettier';
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
ignores: ['.yarn/**/*', 'coverage/**/*', 'dist/**/*']
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs['flat/recommended'],
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['__tests__/**'],
|
||||
...vitest.configs.recommended,
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...vitest.environments.env.globals
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
...vitest.configs.recommended.rules,
|
||||
'vitest/no-conditional-expect': 'error',
|
||||
'vitest/no-disabled-tests': 0
|
||||
}
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
prettier: eslintPluginPrettier
|
||||
},
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'@typescript-eslint/no-require-imports': [
|
||||
'error',
|
||||
{
|
||||
allowAsImport: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]);
|
||||
@@ -1,29 +0,0 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-action-')).split(path.sep).join(path.posix.sep);
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/setup-buildx-action',
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp').split(path.sep).join(path.posix.sep),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache').split(path.sep).join(path.posix.sep)
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
||||
},
|
||||
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
|
||||
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__tests__/'],
|
||||
verbose: true
|
||||
};
|
||||
+26
-31
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "docker-setup-buildx",
|
||||
"description": "Set up Docker Buildx",
|
||||
"main": "lib/main.js",
|
||||
"type": "module",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
||||
"test": "jest --coverage",
|
||||
"all": "yarn run build && yarn run format && yarn test"
|
||||
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint --max-warnings=0 .",
|
||||
"format": "eslint --fix .",
|
||||
"test": "vitest run"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -18,34 +18,29 @@
|
||||
"docker",
|
||||
"buildx"
|
||||
],
|
||||
"author": "Docker",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "CrazyMax",
|
||||
"url": "https://crazymax.dev"
|
||||
}
|
||||
],
|
||||
"author": "Docker Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "yarn@4.9.2",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@docker/actions-toolkit": "^0.10.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"uuid": "^9.0.0"
|
||||
"@actions/core": "^3.0.0",
|
||||
"@docker/actions-toolkit": "^0.79.0",
|
||||
"js-yaml": "^4.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.18.21",
|
||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||
"@typescript-eslint/parser": "^5.56.0",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^2.8.7",
|
||||
"ts-jest": "^29.0.5",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.5"
|
||||
"@eslint/js": "^9.39.3",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^24.11.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||
"@typescript-eslint/parser": "^8.56.1",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@vitest/eslint-plugin": "^1.6.9",
|
||||
"eslint": "^9.39.3",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"globals": "^17.3.0",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
+48
-27
@@ -1,11 +1,14 @@
|
||||
import * as uuid from 'uuid';
|
||||
import * as crypto from 'crypto';
|
||||
import * as core from '@actions/core';
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
||||
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||
|
||||
export const builderNodeEnvPrefix = 'BUILDER_NODE';
|
||||
const defaultBuildkitdFlags = '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host';
|
||||
|
||||
export interface Inputs {
|
||||
version: string;
|
||||
@@ -13,46 +16,50 @@ export interface Inputs {
|
||||
driver: string;
|
||||
driverOpts: string[];
|
||||
buildkitdFlags: string;
|
||||
buildkitdConfig: string;
|
||||
buildkitdConfigInline: string;
|
||||
platforms: string[];
|
||||
install: boolean;
|
||||
use: boolean;
|
||||
endpoint: string;
|
||||
config: string;
|
||||
configInline: string;
|
||||
append: string;
|
||||
cacheBinary: boolean;
|
||||
cleanup: boolean;
|
||||
keepState: boolean;
|
||||
}
|
||||
|
||||
export async function getInputs(): Promise<Inputs> {
|
||||
return {
|
||||
version: core.getInput('version'),
|
||||
name: await getBuilderName(core.getInput('driver') || 'docker-container'),
|
||||
name: await getBuilderName(core.getInput('name'), core.getInput('driver') || 'docker-container'),
|
||||
driver: core.getInput('driver') || 'docker-container',
|
||||
driverOpts: Util.getInputList('driver-opts', {ignoreComma: true, quote: false}),
|
||||
buildkitdFlags: core.getInput('buildkitd-flags') || '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||
buildkitdFlags: core.getInput('buildkitd-flags'),
|
||||
platforms: Util.getInputList('platforms'),
|
||||
install: core.getBooleanInput('install'),
|
||||
use: core.getBooleanInput('use'),
|
||||
endpoint: core.getInput('endpoint'),
|
||||
config: core.getInput('config'),
|
||||
configInline: core.getInput('config-inline'),
|
||||
buildkitdConfig: core.getInput('buildkitd-config'),
|
||||
buildkitdConfigInline: core.getInput('buildkitd-config-inline'),
|
||||
append: core.getInput('append'),
|
||||
keepState: core.getBooleanInput('keep-state'),
|
||||
cacheBinary: core.getBooleanInput('cache-binary'),
|
||||
cleanup: core.getBooleanInput('cleanup')
|
||||
};
|
||||
}
|
||||
|
||||
export async function getBuilderName(driver: string): Promise<string> {
|
||||
return driver == 'docker' ? await Docker.context() : `builder-${uuid.v4()}`;
|
||||
export async function getBuilderName(name: string, driver: string): Promise<string> {
|
||||
return driver == 'docker' ? await Docker.context() : name || `builder-${crypto.randomUUID()}`;
|
||||
}
|
||||
|
||||
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
|
||||
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
|
||||
await Util.asyncForEach(inputs.driverOpts, async driverOpt => {
|
||||
await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => {
|
||||
args.push('--driver-opt', driverOpt);
|
||||
});
|
||||
if (driverSupportsFlags(inputs.driver) && inputs.buildkitdFlags) {
|
||||
if (inputs.buildkitdFlags) {
|
||||
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
||||
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||
}
|
||||
}
|
||||
if (inputs.platforms.length > 0) {
|
||||
@@ -61,12 +68,10 @@ export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<A
|
||||
if (inputs.use) {
|
||||
args.push('--use');
|
||||
}
|
||||
if (driverSupportsFlags(inputs.driver)) {
|
||||
if (inputs.config) {
|
||||
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.config));
|
||||
} else if (inputs.configInline) {
|
||||
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.configInline));
|
||||
}
|
||||
if (inputs.buildkitdConfig) {
|
||||
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.buildkitdConfig));
|
||||
} else if (inputs.buildkitdConfigInline) {
|
||||
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.buildkitdConfigInline));
|
||||
}
|
||||
if (inputs.endpoint) {
|
||||
args.push(inputs.endpoint);
|
||||
@@ -79,14 +84,16 @@ export async function getAppendArgs(inputs: Inputs, node: Node, toolkit: Toolkit
|
||||
if (node.name) {
|
||||
args.push('--node', node.name);
|
||||
} else if (inputs.driver == 'kubernetes' && (await toolkit.buildx.versionSatisfies('<0.11.0'))) {
|
||||
args.push('--node', `node-${uuid.v4()}`);
|
||||
args.push('--node', `node-${crypto.randomUUID()}`);
|
||||
}
|
||||
if (node['driver-opts'] && (await toolkit.buildx.versionSatisfies('>=0.3.0'))) {
|
||||
await Util.asyncForEach(node['driver-opts'], async driverOpt => {
|
||||
await Util.asyncForEach(node['driver-opts'], async (driverOpt: string) => {
|
||||
args.push('--driver-opt', driverOpt);
|
||||
});
|
||||
if (driverSupportsFlags(inputs.driver) && node['buildkitd-flags']) {
|
||||
if (node['buildkitd-flags']) {
|
||||
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
||||
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||
}
|
||||
}
|
||||
if (node.platforms) {
|
||||
@@ -106,6 +113,20 @@ export async function getInspectArgs(inputs: Inputs, toolkit: Toolkit): Promise<
|
||||
return args;
|
||||
}
|
||||
|
||||
function driverSupportsFlags(driver: string): boolean {
|
||||
function driverSupportsBuildkitdFlags(driver: string): boolean {
|
||||
return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes';
|
||||
}
|
||||
|
||||
export function getVersion(inputs: Inputs): string {
|
||||
const version = inputs.version;
|
||||
if (inputs.driver === 'cloud') {
|
||||
if (!version || version === 'latest') {
|
||||
return 'cloud:latest';
|
||||
}
|
||||
if (version.startsWith('cloud:') || version.startsWith('lab:')) {
|
||||
return version;
|
||||
}
|
||||
return `cloud:${version}`;
|
||||
}
|
||||
return version;
|
||||
}
|
||||
+132
-56
@@ -1,28 +1,39 @@
|
||||
import * as crypto from 'crypto';
|
||||
import * as fs from 'fs';
|
||||
import * as yaml from 'js-yaml';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
|
||||
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder';
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/builder';
|
||||
|
||||
import * as context from './context';
|
||||
import * as stateHelper from './state-helper';
|
||||
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder.js';
|
||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||
import {Exec} from '@docker/actions-toolkit/lib/exec.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||
|
||||
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||
import {ContextInfo} from '@docker/actions-toolkit/lib/types/docker/docker.js';
|
||||
|
||||
import * as context from './context.js';
|
||||
import * as stateHelper from './state-helper.js';
|
||||
|
||||
actionsToolkit.run(
|
||||
// main
|
||||
async () => {
|
||||
const inputs: context.Inputs = await context.getInputs();
|
||||
stateHelper.setCleanup(inputs.cleanup);
|
||||
const version = context.getVersion(inputs);
|
||||
|
||||
const toolkit = new Toolkit();
|
||||
const standalone = await toolkit.buildx.isStandalone();
|
||||
stateHelper.setStandalone(standalone);
|
||||
|
||||
if (inputs.keepState && inputs.driver !== 'docker-container') {
|
||||
// https://docs.docker.com/reference/cli/docker/buildx/rm/#keep-state
|
||||
throw new Error(`Cannot use keep-state with ${inputs.driver} driver`);
|
||||
}
|
||||
stateHelper.setKeepState(inputs.keepState);
|
||||
|
||||
await core.group(`Docker info`, async () => {
|
||||
try {
|
||||
await Docker.printVersion();
|
||||
@@ -33,16 +44,19 @@ actionsToolkit.run(
|
||||
});
|
||||
|
||||
let toolPath;
|
||||
if (Util.isValidRef(inputs.version)) {
|
||||
if (Util.isValidRef(version)) {
|
||||
if (standalone) {
|
||||
throw new Error(`Cannot build from source without the Docker CLI`);
|
||||
}
|
||||
await core.group(`Build buildx from source`, async () => {
|
||||
toolPath = await toolkit.buildxInstall.build(inputs.version);
|
||||
toolPath = await toolkit.buildxInstall.build(version, !inputs.cacheBinary);
|
||||
});
|
||||
} else if (!(await toolkit.buildx.isAvailable()) || inputs.version) {
|
||||
} else if (!(await toolkit.buildx.isAvailable()) || version) {
|
||||
await core.group(`Download buildx from GitHub Releases`, async () => {
|
||||
toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest');
|
||||
toolPath = await toolkit.buildxInstall.download({
|
||||
version: version || 'latest',
|
||||
ghaNoCache: !inputs.cacheBinary
|
||||
});
|
||||
});
|
||||
}
|
||||
if (toolPath) {
|
||||
@@ -66,18 +80,73 @@ actionsToolkit.run(
|
||||
fs.mkdirSync(Buildx.certsDir, {recursive: true});
|
||||
stateHelper.setCertsDir(Buildx.certsDir);
|
||||
|
||||
// if the default context has TLS data loaded and endpoint is not set, then
|
||||
// we create a temporary docker context only if driver is docker-container
|
||||
// https://github.com/docker/buildx/blob/b96ad59f64d40873e4959336d294b648bb3937fe/builder/builder.go#L489
|
||||
// https://github.com/docker/setup-buildx-action/issues/105
|
||||
if (!standalone && inputs.driver == 'docker-container' && (await Docker.context()) == 'default' && inputs.endpoint.length == 0) {
|
||||
let defaultContextWithTLS: boolean = false;
|
||||
await core.group(`Inspecting default docker context`, async () => {
|
||||
await Docker.getExecOutput(['context', 'inspect', '--format=json', 'default'], {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.info(`Cannot inspect default docker context: ${res.stderr.trim()}`);
|
||||
} else {
|
||||
try {
|
||||
const contextInfo = (<Array<ContextInfo>>JSON.parse(res.stdout.trim()))[0];
|
||||
core.info(JSON.stringify(JSON.parse(res.stdout.trim()), undefined, 2));
|
||||
const hasTLSData = Object.keys(contextInfo.Endpoints).length > 0 && Object.values(contextInfo.Endpoints)[0].TLSData !== undefined;
|
||||
const hasTLSMaterial = Object.keys(contextInfo.TLSMaterial).length > 0 && Object.values(contextInfo.TLSMaterial)[0].length > 0;
|
||||
defaultContextWithTLS = hasTLSData || hasTLSMaterial;
|
||||
} catch (e) {
|
||||
core.info(`Unable to parse default docker context info: ${e}`);
|
||||
core.info(res.stdout.trim());
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
if (defaultContextWithTLS) {
|
||||
const tmpDockerContext = `buildx-${crypto.randomUUID()}`;
|
||||
await core.group(`Creating temp docker context (TLS data loaded in default one)`, async () => {
|
||||
await Docker.getExecOutput(['context', 'create', tmpDockerContext], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(`Cannot create docker context ${tmpDockerContext}: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||
} else {
|
||||
core.info(`Setting builder endpoint to ${tmpDockerContext} context`);
|
||||
inputs.endpoint = tmpDockerContext;
|
||||
stateHelper.setTmpDockerContext(tmpDockerContext);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (inputs.driver !== 'docker') {
|
||||
await core.group(`Creating a new builder instance`, async () => {
|
||||
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, inputs.endpoint, {
|
||||
cacert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CACERT`],
|
||||
cert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CERT`],
|
||||
key: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_KEY`]
|
||||
});
|
||||
if (certsDriverOpts.length > 0) {
|
||||
inputs.driverOpts = [...inputs.driverOpts, ...certsDriverOpts];
|
||||
if (await toolkit.builder.exists(inputs.name)) {
|
||||
core.info(`Builder ${inputs.name} already exists, skipping creation`);
|
||||
} else {
|
||||
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, inputs.endpoint, {
|
||||
cacert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CACERT`],
|
||||
cert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CERT`],
|
||||
key: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_KEY`]
|
||||
});
|
||||
if (certsDriverOpts.length > 0) {
|
||||
inputs.driverOpts = [...inputs.driverOpts, ...certsDriverOpts];
|
||||
}
|
||||
const createCmd = await toolkit.buildx.getCommand(await context.getCreateArgs(inputs, toolkit));
|
||||
await Exec.getExecOutput(createCmd.command, createCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
}
|
||||
const createCmd = await toolkit.buildx.getCommand(await context.getCreateArgs(inputs, toolkit));
|
||||
await exec.exec(createCmd.command, createCmd.args);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -95,7 +164,13 @@ actionsToolkit.run(
|
||||
node['driver-opts'] = [...(node['driver-opts'] || []), ...certsDriverOpts];
|
||||
}
|
||||
const appendCmd = await toolkit.buildx.getCommand(await context.getAppendArgs(inputs, node, toolkit));
|
||||
await exec.exec(appendCmd.command, appendCmd.args);
|
||||
await Exec.getExecOutput(appendCmd.command, appendCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(`Failed to append node ${node.name}: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||
}
|
||||
});
|
||||
nodeIndex++;
|
||||
}
|
||||
});
|
||||
@@ -103,18 +178,14 @@ actionsToolkit.run(
|
||||
|
||||
await core.group(`Booting builder`, async () => {
|
||||
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
|
||||
await exec.exec(inspectCmd.command, inspectCmd.args);
|
||||
});
|
||||
|
||||
if (inputs.install) {
|
||||
if (standalone) {
|
||||
throw new Error(`Cannot set buildx as default builder without the Docker CLI`);
|
||||
}
|
||||
await core.group(`Setting buildx as default builder`, async () => {
|
||||
const installCmd = await toolkit.buildx.getCommand(['install']);
|
||||
await exec.exec(installCmd.command, installCmd.args);
|
||||
await Exec.getExecOutput(inspectCmd.command, inspectCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const builderInspect = await toolkit.builder.inspect(inputs.name);
|
||||
const firstNode = builderInspect.nodes[0];
|
||||
@@ -133,9 +204,6 @@ actionsToolkit.run(
|
||||
core.setOutput('driver', builderInspect.driver);
|
||||
core.setOutput('platforms', reducedPlatforms.join(','));
|
||||
core.setOutput('nodes', JSON.stringify(builderInspect.nodes, undefined, 2));
|
||||
core.setOutput('endpoint', firstNode.endpoint); // TODO: deprecated, to be removed in a later version
|
||||
core.setOutput('status', firstNode.status); // TODO: deprecated, to be removed in a later version
|
||||
core.setOutput('flags', firstNode['buildkitd-flags']); // TODO: deprecated, to be removed in a later version
|
||||
});
|
||||
|
||||
if (!standalone && builderInspect.driver == 'docker-container') {
|
||||
@@ -155,15 +223,13 @@ actionsToolkit.run(
|
||||
async () => {
|
||||
if (stateHelper.IsDebug && stateHelper.containerName.length > 0) {
|
||||
await core.group(`BuildKit container logs`, async () => {
|
||||
await exec
|
||||
.getExecOutput('docker', ['logs', `${stateHelper.containerName}`], {
|
||||
ignoreReturnCode: true
|
||||
})
|
||||
.then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(res.stderr.trim());
|
||||
}
|
||||
});
|
||||
await Docker.getExecOutput(['logs', `${stateHelper.containerName}`], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -176,22 +242,32 @@ actionsToolkit.run(
|
||||
const buildx = new Buildx({standalone: stateHelper.standalone});
|
||||
const builder = new Builder({buildx: buildx});
|
||||
if (await builder.exists(stateHelper.builderName)) {
|
||||
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
|
||||
await exec
|
||||
.getExecOutput(rmCmd.command, rmCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
})
|
||||
.then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(res.stderr.trim());
|
||||
}
|
||||
});
|
||||
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName, ...(stateHelper.keepState ? ['--keep-state'] : [])]);
|
||||
await Exec.getExecOutput(rmCmd.command, rmCmd.args, {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
core.info(`${stateHelper.builderName} does not exist`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (stateHelper.tmpDockerContext) {
|
||||
await core.group(`Removing temp docker context`, async () => {
|
||||
await Exec.getExecOutput('docker', ['context', 'rm', '-f', stateHelper.tmpDockerContext], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
core.warning(`${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (stateHelper.certsDir.length > 0 && fs.existsSync(stateHelper.certsDir)) {
|
||||
await core.group(`Cleaning up certificates`, async () => {
|
||||
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
||||
|
||||
@@ -6,7 +6,9 @@ export const builderName = process.env['STATE_builderName'] || '';
|
||||
export const builderDriver = process.env['STATE_builderDriver'] || '';
|
||||
export const containerName = process.env['STATE_containerName'] || '';
|
||||
export const certsDir = process.env['STATE_certsDir'] || '';
|
||||
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
|
||||
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
||||
export const keepState = /true/i.test(process.env['STATE_keepState'] || '');
|
||||
|
||||
export function setDebug(debug: string) {
|
||||
core.saveState('isDebug', debug);
|
||||
@@ -32,6 +34,14 @@ export function setCertsDir(certsDir: string) {
|
||||
core.saveState('certsDir', certsDir);
|
||||
}
|
||||
|
||||
export function setTmpDockerContext(tmpDockerContext: string) {
|
||||
core.saveState('tmpDockerContext', tmpDockerContext);
|
||||
}
|
||||
|
||||
export function setCleanup(cleanup: boolean) {
|
||||
core.saveState('cleanup', cleanup);
|
||||
}
|
||||
|
||||
export function setKeepState(keepState: boolean) {
|
||||
core.saveState('keepState', keepState);
|
||||
}
|
||||
+4
-8
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"newLine": "lf",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
@@ -12,10 +11,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"exclude": [
|
||||
"./__tests__/**/*",
|
||||
"./lib/**/*",
|
||||
"node_modules",
|
||||
"jest.config.ts"
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import {defineConfig} from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
clearMocks: true,
|
||||
environment: 'node',
|
||||
setupFiles: ['./__tests__/setup.unit.ts'],
|
||||
include: ['**/*.test.ts'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['clover'],
|
||||
include: ['src/**/*.ts'],
|
||||
exclude: ['src/**/main.ts']
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user