Compare 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 | ||
|
|
885d1462b8 | ||
|
|
e5fad018d0 | ||
|
|
45161fd92a | ||
|
|
a4d51f53dd | ||
|
|
93b8ecaa2c | ||
|
|
7703e82fbc | ||
|
|
0005881963 | ||
|
|
b699069f49 | ||
|
|
9bfc5497b8 | ||
|
|
b92d4d8769 | ||
|
|
285be6c835 | ||
|
|
4c0219f9ac | ||
|
|
0db41bf51b | ||
|
|
62fc1a1dd6 | ||
|
|
2a1a44ac4a | ||
|
|
a6c26a99ef | ||
|
|
a5a7f565d9 | ||
|
|
7d7611f95b | ||
|
|
16c0bc4a6e | ||
|
|
ebcacb9c21 | ||
|
|
496a823b8b | ||
|
|
a56031a493 | ||
|
|
922550f064 | ||
|
|
ecf95283f0 | ||
|
|
b2a38ee0c6 | ||
|
|
7f79690cac | ||
|
|
bdd549bec0 | ||
|
|
be4a3855af | ||
|
|
6c4dbb29f6 | ||
|
|
6a58db7e0d | ||
|
|
d56292e348 | ||
|
|
790eb2db47 | ||
|
|
2a81c53912 | ||
|
|
00b2400aad | ||
|
|
484614d7a1 | ||
|
|
d95759405f | ||
|
|
5bb6d36be0 | ||
|
|
a99c5e53ef | ||
|
|
fc1a41d2e5 | ||
|
|
95cefc3c57 | ||
|
|
8ec3610541 | ||
|
|
a946f06b5d | ||
|
|
ce223e774e | ||
|
|
d267e74486 | ||
|
|
d350de3bba | ||
|
|
45a8690f10 | ||
|
|
b167a89702 | ||
|
|
81d4866861 | ||
|
|
07aea5fc9c | ||
|
|
1d91983c26 | ||
|
|
496312bcb8 | ||
|
|
4b4e9c3e2d | ||
|
|
eb27bcbef3 | ||
|
|
b7471d4240 | ||
|
|
e2df91e851 | ||
|
|
85ce96bcbc | ||
|
|
f549413411 | ||
|
|
99988698a5 | ||
|
|
e30725c029 | ||
|
|
f1dc97ee10 | ||
|
|
51ecd0a47f | ||
|
|
830f01a409 | ||
|
|
8b13d483f2 | ||
|
|
03a7a3d9fb | ||
|
|
30389db034 | ||
|
|
05ca2e6f5e | ||
|
|
774ea5c2f1 | ||
|
|
534bd3c5e6 | ||
|
|
0f5a2d6712 | ||
|
|
987520896f | ||
|
|
a19c171088 | ||
|
|
347dac9901 | ||
|
|
2dd22fa31c | ||
|
|
dd904132a2 | ||
|
|
f03ac48505 | ||
|
|
c8c479bb5b | ||
|
|
379311a773 | ||
|
|
6842354d08 | ||
|
|
7ce9a1f69d | ||
|
|
11e8a2e291 | ||
|
|
9407e67a52 | ||
|
|
15c905b16b | ||
|
|
a25d6a0130 | ||
|
|
39322d9057 | ||
|
|
0648fd6fd6 | ||
|
|
30d8a59ee0 | ||
|
|
71320d2e17 | ||
|
|
272f8b84cf | ||
|
|
5e716dcfd6 | ||
|
|
a83788eef0 | ||
|
|
d0d9a72195 | ||
|
|
a8165e7b70 | ||
|
|
a024221c60 | ||
|
|
4c3fce4ab2 | ||
|
|
7c965aebec | ||
|
|
7932f6210d | ||
|
|
70deadb37a | ||
|
|
165fe681b8 | ||
|
|
2d305372c4 | ||
|
|
c252a3bb80 | ||
|
|
4661366cb8 | ||
|
|
03d7e8ebf0 | ||
|
|
22f6533f7c | ||
|
|
b30c61b0de | ||
|
|
51cc8966ea | ||
|
|
db8b80b0d3 | ||
|
|
39a1a82492 | ||
|
|
c77919d12e | ||
|
|
341de1b1a5 | ||
|
|
8c0edbc76e | ||
|
|
1fb9cbdb32 | ||
|
|
693fdd6ca6 | ||
|
|
fe4c1ac86d | ||
|
|
c74574e6c8 | ||
|
|
2d0cf98781 | ||
|
|
5f1d4ea81f | ||
|
|
59b5ed6124 | ||
|
|
bd61d52837 | ||
|
|
f6efb5fcbb | ||
|
|
2dfca373f3 | ||
|
|
95cb08cb26 | ||
|
|
eb5c2a6eea | ||
|
|
83612bea36 | ||
|
|
40fefd8a58 | ||
|
|
90a1e4619e | ||
|
|
5a9fc40575 | ||
|
|
6c48dad5f0 | ||
|
|
16c2ddbfa7 | ||
|
|
0fe8589bf4 | ||
|
|
f3692cbe43 | ||
|
|
51ce2e7281 | ||
|
|
1759384a3b | ||
|
|
d5234d6605 | ||
|
|
ec8fe6a2ec | ||
|
|
c6ec880f34 | ||
|
|
69d3837448 | ||
|
|
aa0df6f73a | ||
|
|
f0ad70c1de | ||
|
|
1a6cf9b6d7 | ||
|
|
1c2ad20e10 | ||
|
|
f5bc16b105 | ||
|
|
86f43c11f1 | ||
|
|
f385c9ed95 | ||
|
|
798ed00eea | ||
|
|
bea6a01aa4 | ||
|
|
3a2cc9a001 | ||
|
|
7a18bafc06 | ||
|
|
312f67c662 | ||
|
|
b8ba4729df | ||
|
|
afe5b71b31 | ||
|
|
6f5431bef1 | ||
|
|
da30c94fcd | ||
|
|
718cf00a00 | ||
|
|
c4fbfe3f62 | ||
|
|
449215757a | ||
|
|
cafcc1d31f | ||
|
|
7560281ec7 | ||
|
|
9102fb725f | ||
|
|
43262924e3 | ||
|
|
455b065be4 | ||
|
|
26f93d2e65 | ||
|
|
91cb32d715 | ||
|
|
7085ac52c5 | ||
|
|
dc7b9719a9 | ||
|
|
f55bc08278 | ||
|
|
aa877a9d36 | ||
|
|
130c56f342 |
No files matched your search
+11
-1
@@ -1,2 +1,12 @@
|
|||||||
/coverage
|
/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/globals": 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
|
/dist/** linguist-generated=true
|
||||||
/lib/** linguist-generated=true
|
/lib/** linguist-generated=true
|
||||||
@@ -1 +0,0 @@
|
|||||||
* @crazy-max
|
|
||||||
@@ -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.
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
@@ -11,6 +11,7 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
versioning-strategy: "increase"
|
||||||
allow:
|
allow:
|
||||||
- dependency-type: "production"
|
- dependency-type: "production"
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 15 KiB |
+269
-98
@@ -1,8 +1,13 @@
|
|||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *' # everyday at 10am
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
@@ -10,9 +15,6 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
@@ -21,25 +23,35 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
buildx-version:
|
buildx-version:
|
||||||
- latest
|
|
||||||
- v0.4.1
|
|
||||||
- ""
|
- ""
|
||||||
|
- "latest"
|
||||||
|
- "v0.4.1"
|
||||||
|
- "cloud:latest"
|
||||||
|
- "cloud:v0.11.2-desktop.2"
|
||||||
|
- "lab:latest"
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx-version }}
|
version: ${{ matrix.buildx-version }}
|
||||||
|
-
|
||||||
|
name: Nodes output
|
||||||
|
run: |
|
||||||
|
cat << EOF
|
||||||
|
${{ steps.buildx.outputs.nodes }}
|
||||||
|
EOF
|
||||||
|
|
||||||
multi:
|
multi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx 1
|
name: Set up Docker Buildx 1
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -52,11 +64,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Stop docker
|
name: Stop docker
|
||||||
run: |
|
run: |
|
||||||
sudo systemctl stop docker
|
sudo systemctl stop docker docker.socket
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@@ -73,14 +85,14 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Dump context
|
name: Dump context
|
||||||
if: always()
|
if: always()
|
||||||
uses: crazy-max/ghaction-dump-context@v1
|
uses: crazy-max/ghaction-dump-context@v2
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create Dockerfile
|
name: Create Dockerfile
|
||||||
run: |
|
run: |
|
||||||
@@ -90,7 +102,7 @@ jobs:
|
|||||||
EOL
|
EOL
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -98,27 +110,11 @@ jobs:
|
|||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
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:
|
use:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -130,7 +126,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -153,7 +149,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -166,7 +162,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -199,7 +195,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create context
|
name: Create context
|
||||||
run: |
|
run: |
|
||||||
@@ -216,12 +212,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
DOCKER_CONTEXT: mycontext
|
DOCKER_CONTEXT: mycontext
|
||||||
|
|
||||||
config:
|
buildkitd-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create buildkitd conf
|
name: Create buildkitd conf
|
||||||
run: |
|
run: |
|
||||||
@@ -241,19 +237,19 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
config: /tmp/buildkitd.toml
|
buildkitd-config: /tmp/buildkitd.toml
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
config-inline:
|
buildkitd-config-inline:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create Dockerfile
|
name: Create Dockerfile
|
||||||
run: |
|
run: |
|
||||||
@@ -265,13 +261,13 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
config-inline: |
|
buildkitd-config-inline: |
|
||||||
debug = true
|
debug = true
|
||||||
[registry."docker.io"]
|
[registry."docker.io"]
|
||||||
mirrors = ["mirror.gcr.io"]
|
mirrors = ["mirror.gcr.io"]
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
@@ -281,8 +277,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
buildx-version:
|
buildx-version:
|
||||||
- latest
|
- v0.9.1
|
||||||
- v0.4.1
|
|
||||||
- ""
|
- ""
|
||||||
qemu-platforms:
|
qemu-platforms:
|
||||||
- all
|
- all
|
||||||
@@ -290,17 +285,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v4
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.qemu-platforms }}
|
platforms: ${{ matrix.qemu-platforms }}
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx-version }}
|
version: ${{ matrix.buildx-version }}
|
||||||
|
-
|
||||||
|
name: List builder platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
build-ref:
|
build-ref:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -315,7 +314,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -333,50 +332,223 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
standalone:
|
standalone-cmd:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
buildx-version:
|
|
||||||
- latest
|
|
||||||
- ""
|
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Uninstall docker cli
|
name: Uninstall docker cli
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get purge -y moby-cli moby-buildx
|
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
|
||||||
|
uses: ./
|
||||||
|
-
|
||||||
|
name: Create Dockerfile
|
||||||
|
run: |
|
||||||
|
cat > ./Dockerfile <<EOL
|
||||||
|
FROM alpine
|
||||||
|
EOL
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
run: |
|
||||||
|
buildx build .
|
||||||
|
|
||||||
|
standalone-action:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
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
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx-version }}
|
version: ${{ matrix.buildx-version }}
|
||||||
-
|
-
|
||||||
name: Check available in path
|
name: Create Dockerfile
|
||||||
if: matrix.standalone
|
|
||||||
run: |
|
run: |
|
||||||
buildx version
|
cat > ./Dockerfile <<EOL
|
||||||
|
FROM alpine
|
||||||
|
EOL
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/build-push-action@master
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
|
||||||
standalone-install-error:
|
append:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Uninstall docker cli
|
name: Create dummy contexts
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get purge -y moby-cli moby-buildx
|
docker context create ctxbuilder2
|
||||||
|
docker context create ctxbuilder3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
append: |
|
||||||
|
- name: builder2
|
||||||
|
endpoint: ctxbuilder2
|
||||||
|
platforms: linux/amd64
|
||||||
|
driver-opts:
|
||||||
|
- image=moby/buildkit:master
|
||||||
|
- network=host
|
||||||
|
- endpoint: ctxbuilder3
|
||||||
|
platforms: linux/arm64
|
||||||
|
-
|
||||||
|
name: List builder platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64
|
||||||
|
|
||||||
|
docker-context:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Create Docker context
|
||||||
|
run: |
|
||||||
|
docker context create foo
|
||||||
|
docker context use foo
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
driver: docker
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
cleanup:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
cleanup: ${{ matrix.cleanup }}
|
||||||
|
|
||||||
|
k3s:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
version:
|
||||||
|
- latest
|
||||||
|
- v0.11.0
|
||||||
|
- v0.10.5
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Install k3s
|
||||||
|
uses: crazy-max/.github/.github/actions/install-k3s@a94383ec9e125b23907fb6fcebf7ff87964595e5
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
version: ${{ matrix.version }}
|
||||||
|
driver: kubernetes
|
||||||
|
platforms: linux/amd64
|
||||||
|
driver-opts: |
|
||||||
|
image=moby/buildkit:buildx-stable-1
|
||||||
|
qemu.install=true
|
||||||
|
append: |
|
||||||
|
- platforms: linux/arm64
|
||||||
|
driver-opts:
|
||||||
|
- image=moby/buildkit:buildx-stable-1
|
||||||
|
- qemu.install=true
|
||||||
|
- platforms: linux/s390x
|
||||||
|
driver-opts:
|
||||||
|
- image=moby/buildkit:buildx-stable-1
|
||||||
|
- qemu.install=true
|
||||||
|
-
|
||||||
|
name: Create Dockerfile
|
||||||
|
run: |
|
||||||
|
cat > ./Dockerfile <<EOL
|
||||||
|
FROM alpine
|
||||||
|
RUN uname -a
|
||||||
|
EOL
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
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
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
-
|
-
|
||||||
name: Check
|
name: Check
|
||||||
run: |
|
run: |
|
||||||
@@ -385,47 +557,46 @@ jobs:
|
|||||||
echo "::error::Should have failed"
|
echo "::error::Should have failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
standalone-kubernetes:
|
keep-state:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
|
||||||
name: Uninstall moby
|
|
||||||
run: |
|
|
||||||
sudo apt-get purge -y moby-engine moby-cli moby-buildx
|
|
||||||
-
|
|
||||||
name: Setup k8s cluster
|
|
||||||
run: |
|
|
||||||
set -x
|
|
||||||
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
|
||||||
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y kubelet kubeadm kubectl
|
|
||||||
sudo swapoff -a
|
|
||||||
sudo kubeadm init --cri-socket /run/containerd/containerd.sock
|
|
||||||
mkdir -p $HOME/.kube/
|
|
||||||
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
|
||||||
sudo chown $USER $HOME/.kube/config
|
|
||||||
kubectl taint nodes --all node-role.kubernetes.io/master-
|
|
||||||
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
|
|
||||||
kubectl wait --for=condition=ready --timeout=30s node --all
|
|
||||||
kubectl get nodes -o wide
|
|
||||||
-
|
|
||||||
name: Create Dockerfile
|
|
||||||
run: |
|
|
||||||
cat > ./Dockerfile <<EOL
|
|
||||||
FROM alpine
|
|
||||||
RUN echo hello
|
|
||||||
EOL
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
driver: kubernetes
|
name: foo
|
||||||
|
keep-state: true
|
||||||
-
|
-
|
||||||
name: Build
|
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: |
|
run: |
|
||||||
buildx build .
|
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,14 +1,15 @@
|
|||||||
name: test
|
name: test
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'releases/v*'
|
- 'releases/v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@@ -16,22 +17,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
|
||||||
name: Validate
|
|
||||||
uses: docker/bake-action@v1
|
|
||||||
with:
|
|
||||||
targets: validate
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v1
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
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
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
name: validate
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'releases/v*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
targets: ${{ steps.generate.outputs.targets }}
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: List targets
|
||||||
|
id: generate
|
||||||
|
uses: docker/bake-action/subaction/list-targets@v6
|
||||||
|
with:
|
||||||
|
target: validate
|
||||||
|
|
||||||
|
validate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- prepare
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Validate
|
||||||
|
uses: docker/bake-action@v6
|
||||||
|
with:
|
||||||
|
targets: ${{ matrix.target }}
|
||||||
+14
-57
@@ -1,12 +1,5 @@
|
|||||||
/.dev
|
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||||
node_modules
|
|
||||||
lib
|
|
||||||
|
|
||||||
# Jetbrains
|
|
||||||
/.idea
|
|
||||||
/*.iml
|
|
||||||
|
|
||||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
@@ -24,34 +18,14 @@ pids
|
|||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
coverage
|
||||||
*.lcov
|
*.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
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
# TypeScript cache
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
@@ -61,36 +35,19 @@ typings/
|
|||||||
# Optional eslint cache
|
# Optional eslint cache
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
# dotenv environment variables file
|
# dotenv environment variable files
|
||||||
.env
|
.env
|
||||||
.env.test
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# yarn v2
|
||||||
.cache
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
# next.js build output
|
.yarn/build-state.yml
|
||||||
.next
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/
|
||||||
+1
-2
@@ -6,6 +6,5 @@
|
|||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": false,
|
"bracketSpacing": false,
|
||||||
"arrowParens": "avoid",
|
"arrowParens": "avoid"
|
||||||
"parser": "typescript"
|
|
||||||
}
|
}
|
||||||
+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
|
||||||
@@ -1,42 +1,35 @@
|
|||||||
[](https://github.com/docker/setup-buildx-action/releases/latest)
|
[](https://github.com/docker/setup-buildx-action/releases/latest)
|
||||||
[](https://github.com/marketplace/actions/docker-setup-buildx)
|
[](https://github.com/marketplace/actions/docker-setup-buildx)
|
||||||
[](https://github.com/docker/setup-buildx-action/actions?workflow=ci)
|
[](https://github.com/docker/setup-buildx-action/actions?workflow=ci)
|
||||||
[](https://github.com/docker/setup-buildx-action/actions?workflow=test)
|
[](https://github.com/docker/setup-buildx-action/actions?workflow=test)
|
||||||
[](https://codecov.io/gh/docker/setup-buildx-action)
|
[](https://codecov.io/gh/docker/setup-buildx-action)
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
GitHub Action to set up Docker [Buildx](https://github.com/docker/buildx).
|
GitHub Action to set up Docker [Buildx](https://github.com/docker/buildx).
|
||||||
|
|
||||||
This action will create and boot a builder that can be used in the following steps of your workflow if you're using
|
This action will create and boot a builder that can be used in the following
|
||||||
[buildx](https://github.com/docker/buildx). By default, the `docker-container` [builder driver](https://github.com/docker/buildx/blob/master/docs/reference/buildx_create.md#driver)
|
steps of your workflow if you're using Buildx or the [`build-push` action](https://github.com/docker/build-push-action/).
|
||||||
will be used to be able to build multi-platform images and export cache thanks to the [BuildKit](https://github.com/moby/buildkit)
|
By default, the [`docker-container` driver](https://docs.docker.com/build/building/drivers/docker-container/)
|
||||||
container.
|
will be used to be able to build multi-platform images and export cache using
|
||||||
|
a [BuildKit](https://github.com/moby/buildkit) container.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Quick start](#quick-start)
|
* [Configuring your builder](#configuring-your-builder)
|
||||||
* [With QEMU](#with-qemu)
|
|
||||||
* [Install by default](#install-by-default)
|
|
||||||
* [BuildKit daemon configuration](#buildkit-daemon-configuration)
|
|
||||||
* [Registry mirror](#registry-mirror)
|
|
||||||
* [Max parallelism](#max-parallelism)
|
|
||||||
* [Standalone mode](#standalone-mode)
|
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [outputs](#outputs)
|
* [outputs](#outputs)
|
||||||
* [environment variables](#environment-variables)
|
* [environment variables](#environment-variables)
|
||||||
* [Notes](#notes)
|
* [Notes](#notes)
|
||||||
* [BuildKit container logs](#buildkit-container-logs)
|
* [`nodes` output](#nodes-output)
|
||||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Quick start
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
@@ -49,247 +42,125 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v5
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
-
|
|
||||||
name: Inspect builder
|
|
||||||
run: |
|
|
||||||
echo "Name: ${{ steps.buildx.outputs.name }}"
|
|
||||||
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
|
|
||||||
echo "Status: ${{ steps.buildx.outputs.status }}"
|
|
||||||
echo "Flags: ${{ steps.buildx.outputs.flags }}"
|
|
||||||
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
|
|
||||||
```
|
|
||||||
|
|
||||||
### With QEMU
|
|
||||||
|
|
||||||
If you want support for more platforms you can use our [setup-qemu](https://github.com/docker/setup-qemu-action) action:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
-
|
-
|
||||||
|
# Add support for more platforms with QEMU (optional)
|
||||||
|
# https://github.com/docker/setup-qemu-action
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
uses: docker/setup-buildx-action@v3
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
-
|
|
||||||
name: Available platforms
|
|
||||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install by default
|
## Configuring your builder
|
||||||
|
|
||||||
```yaml
|
* [Version pinning](https://docs.docker.com/build/ci/github-actions/configure-builder/#version-pinning): Pin to a specific Buildx or BuildKit version
|
||||||
name: ci
|
* [BuildKit container logs](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs): Enable BuildKit container logs for debugging purposes
|
||||||
|
* [BuildKit Daemon configuration](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-daemon-configuration)
|
||||||
on:
|
* [Registry mirror](https://docs.docker.com/build/ci/github-actions/configure-builder/#registry-mirror): Configure a registry mirror for your builds
|
||||||
push:
|
* [Max parallelism](https://docs.docker.com/build/ci/github-actions/configure-builder/#max-parallelism): Configure the maximum parallelism for your builds
|
||||||
|
* [Append additional nodes to the builder](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder): Create additional nodes for your builder
|
||||||
jobs:
|
* [Authentication for remote builders](https://docs.docker.com/build/ci/github-actions/configure-builder/#authentication-for-remote-builders)
|
||||||
buildx:
|
* [SSH authentication](https://docs.docker.com/build/ci/github-actions/configure-builder/#ssh-authentication): Authenticate to a remote builder using SSH
|
||||||
runs-on: ubuntu-latest
|
* [TLS authentication](https://docs.docker.com/build/ci/github-actions/configure-builder/#tls-authentication): Authenticate to a remote builder using TLS
|
||||||
steps:
|
* [Standalone mode](https://docs.docker.com/build/ci/github-actions/configure-builder/#standalone-mode): Use Buildx as a standalone binary (without the Docker CLI)
|
||||||
-
|
* [Isolated builders](https://docs.docker.com/build/ci/github-actions/configure-builder/#isolated-builders): Create isolated builders for your builds
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
-
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
id: buildx
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
run: |
|
|
||||||
docker build . # will run buildx
|
|
||||||
```
|
|
||||||
|
|
||||||
### BuildKit daemon configuration
|
|
||||||
|
|
||||||
You can provide a [BuildKit configuration](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md)
|
|
||||||
to your builder if you're using the [`docker-container` driver](https://github.com/docker/buildx/blob/master/docs/reference/buildx_create.md#driver)
|
|
||||||
(default) with the `config` or `config-inline` inputs:
|
|
||||||
|
|
||||||
#### Registry mirror
|
|
||||||
|
|
||||||
You can configure a registry mirror using an inline block directly in your
|
|
||||||
workflow with the `config-inline` input:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
with:
|
|
||||||
config-inline: |
|
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["mirror.gcr.io"]
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Max parallelism
|
|
||||||
|
|
||||||
You can limit the parallelism of the BuildKit solver which is particularly
|
|
||||||
useful for low-powered machines.
|
|
||||||
|
|
||||||
You can use the `config-inline` input like the
|
|
||||||
previous example, or you can use a dedicated BuildKit config file from your
|
|
||||||
repo if you want with the `config` input:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
# .github/buildkitd.toml
|
|
||||||
[worker.oci]
|
|
||||||
max-parallelism = 4
|
|
||||||
```
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
with:
|
|
||||||
config: .github/buildkitd.toml
|
|
||||||
```
|
|
||||||
|
|
||||||
### Standalone mode
|
|
||||||
|
|
||||||
If you don't have the Docker CLI installed on the GitHub Runner, buildx binary
|
|
||||||
is invoked directly, instead of calling it as a docker plugin. This can be
|
|
||||||
useful if you want to use the `kubernetes` driver in your self-hosted runner:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
name: ci
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
buildx:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
with:
|
|
||||||
driver: kubernetes
|
|
||||||
-
|
|
||||||
name: Build
|
|
||||||
run: |
|
|
||||||
buildx build .
|
|
||||||
```
|
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
||||||
Following inputs can be used as `step.with` keys
|
The following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
| Name | Type | Description |
|
> `List` type is a newline-delimited string
|
||||||
|--------------------|---------|-----------------------------------|
|
|
||||||
| `version` | String | [buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
|
|
||||||
| `driver` | String | Sets the [builder driver](https://github.com/docker/buildx/blob/master/docs/reference/buildx_create.md#driver) to be used (default `docker-container`) |
|
|
||||||
| `driver-opts` | CSV | List of additional [driver-specific options](https://github.com/docker/buildx/blob/master/docs/reference/buildx_create.md#driver-opt) (eg. `image=moby/buildkit:master`) |
|
|
||||||
| `buildkitd-flags` | String | [Flags for buildkitd](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md) daemon (since [buildx v0.3.0](https://github.com/docker/buildx/releases/tag/v0.3.0)) |
|
|
||||||
| `install` | Bool | Sets up `docker build` command as an alias to `docker buildx` (default `false`) |
|
|
||||||
| `use` | Bool | Switch to this builder instance (default `true`) |
|
|
||||||
| `endpoint` | String | [Optional address for docker socket](https://github.com/docker/buildx/blob/master/docs/reference/buildx_create.md#description) or context from `docker context ls` |
|
|
||||||
| `config`¹ | String | [BuildKit config file](https://github.com/docker/buildx/blob/master/docs/reference/buildx_create.md#config) |
|
|
||||||
| `config-inline`¹ | String | Same as `config` but inline |
|
|
||||||
|
|
||||||
> * ¹ `config` and `config-inline` are mutually exclusive
|
|
||||||
|
|
||||||
> `CSV` type must be a newline-delimited string
|
|
||||||
> ```yaml
|
|
||||||
> driver-opts: image=moby/buildkit:master
|
|
||||||
> ```
|
|
||||||
> ```yaml
|
> ```yaml
|
||||||
> driver-opts: |
|
> driver-opts: |
|
||||||
> image=moby/buildkit:master
|
> image=moby/buildkit:master
|
||||||
> network=host
|
> network=host
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
|
> `CSV` type must be a comma-delimited string
|
||||||
|
> ```yaml
|
||||||
|
> 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`) |
|
||||||
|
| `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 |
|
||||||
|
|
||||||
|
> [!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
|
### outputs
|
||||||
|
|
||||||
Following outputs are available
|
The following outputs are available:
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|---------------|---------|---------------------------------------|
|
|-------------|--------|-----------------------------------------------------|
|
||||||
| `name` | String | Builder name |
|
| `name` | String | Builder name |
|
||||||
| `driver` | String | Builder driver |
|
| `driver` | String | Builder driver |
|
||||||
| `endpoint` | String | Builder node endpoint |
|
| `platforms` | String | Builder node platforms (preferred and/or available) |
|
||||||
| `status` | String | Builder node status |
|
| `nodes` | JSON | Builder [nodes metadata](#nodes-output) |
|
||||||
| `flags` | String | Builder node flags (if applicable) |
|
|
||||||
| `platforms` | String | Builder node platforms available (comma separated) |
|
|
||||||
|
|
||||||
### environment variables
|
### environment variables
|
||||||
|
|
||||||
The following [official docker environment variables](https://docs.docker.com/engine/reference/commandline/cli/#environment-variables) are supported:
|
The following [official docker environment variables](https://docs.docker.com/engine/reference/commandline/cli/#environment-variables) are supported:
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|-----------------|---------|-------------|-------------------------------------------------|
|
|-----------------|--------|-------------|-------------------------------------------------|
|
||||||
| `DOCKER_CONFIG` | String | `~/.docker` | The location of your client configuration files |
|
| `DOCKER_CONFIG` | String | `~/.docker` | The location of your client configuration files |
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
### BuildKit container logs
|
### `nodes` output
|
||||||
|
|
||||||
To display BuildKit container logs (when `docker-container` driver is used) you have to [enable step debug logging](https://docs.github.com/en/actions/managing-workflow-runs/enabling-debug-logging#enabling-step-debug-logging)
|
```json
|
||||||
or you can also enable debugging in the [setup-buildx action step](https://github.com/docker/setup-buildx-action):
|
[
|
||||||
|
{
|
||||||
```yaml
|
"name": "builder-3820d274-502c-4498-ae24-d4c32b3023d90",
|
||||||
-
|
"endpoint": "unix:///var/run/docker.sock",
|
||||||
name: Set up Docker Buildx
|
"driver-opts": [
|
||||||
uses: docker/setup-buildx-action@v1
|
"network=host",
|
||||||
with:
|
"image=moby/buildkit:master"
|
||||||
buildkitd-flags: --debug
|
],
|
||||||
|
"status": "running",
|
||||||
|
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||||
|
"buildkit": "3fab389",
|
||||||
|
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/386"
|
||||||
|
}
|
||||||
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
Logs will be available at the end of a job:
|
| Name | Type | Description |
|
||||||
|
|-------------------|--------|----------------------------|
|
||||||
|
| `name` | String | Node name |
|
||||||
|
| `endpoint` | String | Node endpoint |
|
||||||
|
| `driver-opts` | List | Options for the driver |
|
||||||
|
| `status` | String | Node status |
|
||||||
|
| `buildkitd-flags` | String | Flags for buildkitd daemon |
|
||||||
|
| `buildkit` | String | BuildKit version |
|
||||||
|
| `platforms` | String | Platforms available |
|
||||||
|
|
||||||

|
## Contributing
|
||||||
|
|
||||||
## Keep up-to-date with GitHub Dependabot
|
Want to contribute? Awesome! You can find information about contributing to
|
||||||
|
this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)
|
||||||
Since [Dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot)
|
|
||||||
has [native GitHub Actions support](https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem),
|
|
||||||
to enable it on your GitHub repo all you need to do is add the `.github/dependabot.yml` file:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
# Maintain dependencies for GitHub Actions
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
```
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
import {describe, expect, it, jest, test} from '@jest/globals';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as os from 'os';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as buildx from '../src/buildx';
|
|
||||||
import * as context from '../src/context';
|
|
||||||
import * as semver from 'semver';
|
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
|
|
||||||
const tmpNameSync = path.join('/tmp/.docker-setup-buildx-jest', '.tmpname-jest').split(path.sep).join(path.posix.sep);
|
|
||||||
|
|
||||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
|
||||||
const tmpDir = path.join('/tmp/.docker-setup-buildx-jest').split(path.sep).join(path.posix.sep);
|
|
||||||
if (!fs.existsSync(tmpDir)) {
|
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
|
||||||
});
|
|
||||||
|
|
||||||
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
|
|
||||||
return tmpNameSync;
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('isAvailable', () => {
|
|
||||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
|
||||||
buildx.isAvailable();
|
|
||||||
|
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
|
||||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
|
|
||||||
silent: true,
|
|
||||||
ignoreReturnCode: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('isAvailable standalone', () => {
|
|
||||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
|
||||||
buildx.isAvailable(true);
|
|
||||||
|
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
|
||||||
expect(execSpy).toHaveBeenCalledWith(`buildx`, [], {
|
|
||||||
silent: true,
|
|
||||||
ignoreReturnCode: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getVersion', () => {
|
|
||||||
it('valid', async () => {
|
|
||||||
const version = await buildx.getVersion();
|
|
||||||
expect(semver.valid(version)).not.toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('parseVersion', () => {
|
|
||||||
test.each([
|
|
||||||
['github.com/docker/buildx 0.4.1+azure bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
|
|
||||||
['github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
|
|
||||||
['github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2', '0.4.2'],
|
|
||||||
['github.com/docker/buildx f117971 f11797113e5a9b86bd976329c5dbb8a8bfdfadfa', 'f117971']
|
|
||||||
])('given %p', async (stdout, expected) => {
|
|
||||||
expect(buildx.parseVersion(stdout)).toEqual(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('satisfies', () => {
|
|
||||||
test.each([
|
|
||||||
['0.4.1', '>=0.3.2', true],
|
|
||||||
['bda4882a65349ca359216b135896bddc1d92461c', '>0.1.0', false],
|
|
||||||
['f117971', '>0.6.0', true]
|
|
||||||
])('given %p', async (version, range, expected) => {
|
|
||||||
expect(buildx.satisfies(version, range)).toBe(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('inspect', () => {
|
|
||||||
it('valid', async () => {
|
|
||||||
const builder = await buildx.inspect('');
|
|
||||||
expect(builder).not.toBeUndefined();
|
|
||||||
expect(builder.name).not.toEqual('');
|
|
||||||
expect(builder.driver).not.toEqual('');
|
|
||||||
expect(builder.node_platforms).not.toEqual('');
|
|
||||||
}, 100000);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('build', () => {
|
|
||||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
|
|
||||||
|
|
||||||
// eslint-disable-next-line jest/no-disabled-tests
|
|
||||||
it.skip('builds refs/pull/648/head', async () => {
|
|
||||||
const buildxBin = await buildx.build('https://github.com/docker/buildx.git#refs/pull/648/head', tmpDir, false);
|
|
||||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
|
||||||
}, 100000);
|
|
||||||
|
|
||||||
// eslint-disable-next-line jest/no-disabled-tests
|
|
||||||
it.skip('builds 67bd6f4dc82a9cd96f34133dab3f6f7af803bb14', async () => {
|
|
||||||
const buildxBin = await buildx.build('https://github.com/docker/buildx.git#67bd6f4dc82a9cd96f34133dab3f6f7af803bb14', tmpDir, false);
|
|
||||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
|
||||||
}, 100000);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('install', () => {
|
|
||||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
|
|
||||||
test.each([
|
|
||||||
['v0.4.1', false],
|
|
||||||
['latest', false],
|
|
||||||
['v0.4.1', true],
|
|
||||||
['latest', true]
|
|
||||||
])(
|
|
||||||
'acquires %p of buildx (standalone: %p)',
|
|
||||||
async (version, standalone) => {
|
|
||||||
const buildxBin = await buildx.install(version, tmpDir, standalone);
|
|
||||||
expect(fs.existsSync(buildxBin)).toBe(true);
|
|
||||||
},
|
|
||||||
100000
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getConfig', () => {
|
|
||||||
test.each([
|
|
||||||
['debug = true', false, 'debug = true', false],
|
|
||||||
[`notfound.toml`, true, '', true],
|
|
||||||
[
|
|
||||||
`${path.join(__dirname, 'fixtures', 'buildkitd.toml').split(path.sep).join(path.posix.sep)}`,
|
|
||||||
true,
|
|
||||||
`debug = true
|
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["mirror.gcr.io"]
|
|
||||||
`,
|
|
||||||
false
|
|
||||||
]
|
|
||||||
])('given %p config', async (val, file, exValue, invalid) => {
|
|
||||||
try {
|
|
||||||
let config: string;
|
|
||||||
if (file) {
|
|
||||||
config = await buildx.getConfigFile(val);
|
|
||||||
} else {
|
|
||||||
config = await buildx.getConfigInline(val);
|
|
||||||
}
|
|
||||||
expect(true).toBe(!invalid);
|
|
||||||
expect(config).toEqual(`${tmpNameSync}`);
|
|
||||||
const configValue = fs.readFileSync(tmpNameSync, 'utf-8');
|
|
||||||
expect(configValue).toEqual(exValue);
|
|
||||||
} catch (err) {
|
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(true).toBe(invalid);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
+472
-94
@@ -1,112 +1,498 @@
|
|||||||
import {beforeEach, describe, expect, it, jest} from '@jest/globals';
|
import {beforeEach, describe, expect, test, vi} from 'vitest';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as context from '../src/context';
|
|
||||||
|
|
||||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||||
const tmpDir = path.join('/tmp/.docker-setup-buildx-jest').split(path.sep).join(path.posix.sep);
|
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';
|
||||||
|
|
||||||
|
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||||
|
|
||||||
|
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)) {
|
if (!fs.existsSync(tmpDir)) {
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
}
|
}
|
||||||
return tmpDir;
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
|
vi.spyOn(Context, 'tmpName').mockImplementation((): string => {
|
||||||
return path.join('/tmp/.docker-setup-buildx-jest', '.tmpname-jest').split(path.sep).join(path.posix.sep);
|
return tmpName;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getInputList', () => {
|
vi.mock('crypto', async () => {
|
||||||
it('handles single line correctly', async () => {
|
return {
|
||||||
await setInput('foo', 'bar');
|
...(await vi.importActual('crypto')),
|
||||||
const res = await context.getInputList('foo');
|
randomUUID: vi.fn(() => '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d')
|
||||||
expect(res).toEqual(['bar']);
|
};
|
||||||
});
|
|
||||||
|
|
||||||
it('handles multiple lines correctly', async () => {
|
|
||||||
setInput('foo', 'bar\nbaz');
|
|
||||||
const res = await context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('remove empty lines correctly', async () => {
|
|
||||||
setInput('foo', 'bar\n\nbaz');
|
|
||||||
const res = await context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('handles comma correctly', async () => {
|
|
||||||
setInput('foo', 'bar,baz');
|
|
||||||
const res = await context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('remove empty result correctly', async () => {
|
|
||||||
setInput('foo', 'bar,baz,');
|
|
||||||
const res = await context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('handles different new lines correctly', async () => {
|
|
||||||
setInput('foo', 'bar\r\nbaz');
|
|
||||||
const res = await context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('handles different new lines and comma correctly', async () => {
|
|
||||||
setInput('foo', 'bar\r\nbaz,bat');
|
|
||||||
const res = await context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz', 'bat']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('handles multiple lines and ignoring comma correctly', async () => {
|
|
||||||
setInput('driver-opts', 'image=moby/buildkit:master\nnetwork=host');
|
|
||||||
const res = await context.getInputList('driver-opts', true);
|
|
||||||
expect(res).toEqual(['image=moby/buildkit:master', 'network=host']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('handles different new lines and ignoring comma correctly', async () => {
|
|
||||||
setInput('driver-opts', 'image=moby/buildkit:master\r\nnetwork=host');
|
|
||||||
const res = await context.getInputList('driver-opts', true);
|
|
||||||
expect(res).toEqual(['image=moby/buildkit:master', 'network=host']);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('asyncForEach', () => {
|
vi.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
|
||||||
it('executes async tasks sequentially', async () => {
|
return Promise.resolve('default');
|
||||||
const testValues = [1, 2, 3, 4, 5];
|
|
||||||
const results: number[] = [];
|
|
||||||
|
|
||||||
await context.asyncForEach(testValues, async value => {
|
|
||||||
results.push(value);
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(results).toEqual(testValues);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('setOutput', () => {
|
describe('getCreateArgs', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
process.stdout.write = jest.fn() as typeof process.stdout.write;
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
|
if (!key.startsWith('INPUT_')) {
|
||||||
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line jest/expect-expect
|
// prettier-ignore
|
||||||
it('setOutput produces the correct command', () => {
|
test.each([
|
||||||
context.setOutput('some output', 'some value');
|
[
|
||||||
assertWriteCalls([`::set-output name=some output::some value${os.EOL}`]);
|
0,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', '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',
|
||||||
|
'--use'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['driver', 'docker'],
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'default',
|
||||||
|
'--driver', 'docker',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
|
'--use'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'false'],
|
||||||
|
['driver-opts', 'image=moby/buildkit:master\nnetwork=host'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--driver', 'docker-container',
|
||||||
|
'--driver-opt', 'image=moby/buildkit:master',
|
||||||
|
'--driver-opt', 'network=host',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['driver', 'remote'],
|
||||||
|
['endpoint', 'tls://foo:1234'],
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--driver', 'remote',
|
||||||
|
'--use',
|
||||||
|
'tls://foo:1234'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
4,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['driver', 'remote'],
|
||||||
|
['platforms', 'linux/arm64,linux/arm/v7'],
|
||||||
|
['endpoint', 'tls://foo:1234'],
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--driver', 'remote',
|
||||||
|
'--platform', 'linux/arm64,linux/arm/v7',
|
||||||
|
'--use',
|
||||||
|
'tls://foo:1234'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
5,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'false'],
|
||||||
|
['driver-opts', `"env.no_proxy=localhost,127.0.0.1,.mydomain"`],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--driver', 'docker-container',
|
||||||
|
'--driver-opt', '"env.no_proxy=localhost,127.0.0.1,.mydomain"',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
6,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'false'],
|
||||||
|
['platforms', 'linux/amd64\n"linux/arm64,linux/arm/v7"'],
|
||||||
|
['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',
|
||||||
|
'--platform', 'linux/amd64,linux/arm64,linux/arm/v7'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
7,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['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 %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();
|
||||||
|
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||||
|
return buildxVersion;
|
||||||
|
});
|
||||||
|
const inp = await context.getInputs();
|
||||||
|
const res = await context.getCreateArgs(inp, toolkit);
|
||||||
|
expect(res).toEqual(expected);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getAppendArgs', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
|
if (!key.startsWith('INPUT_')) {
|
||||||
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line jest/expect-expect
|
// prettier-ignore
|
||||||
it('setOutput handles bools', () => {
|
test.each([
|
||||||
context.setOutput('some output', false);
|
[
|
||||||
assertWriteCalls([`::set-output name=some output::false${os.EOL}`]);
|
0,
|
||||||
|
'v0.10.3',
|
||||||
|
new Map<string, string>([
|
||||||
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
"name": "aws_graviton2",
|
||||||
|
"endpoint": "ssh://me@graviton2",
|
||||||
|
"driver-opts": [
|
||||||
|
"image=moby/buildkit:latest"
|
||||||
|
],
|
||||||
|
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||||
|
"platforms": "linux/arm64"
|
||||||
|
},
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--append',
|
||||||
|
'--node', 'aws_graviton2',
|
||||||
|
'--driver-opt', 'image=moby/buildkit:latest',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
|
'--platform', 'linux/arm64',
|
||||||
|
'ssh://me@graviton2'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
])(
|
||||||
|
'[%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();
|
||||||
|
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||||
|
return buildxVersion;
|
||||||
|
});
|
||||||
|
const inp = await context.getInputs();
|
||||||
|
const res = await context.getAppendArgs(inp, node, toolkit);
|
||||||
|
expect(res).toEqual(expected);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getVersion', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
|
if (!key.startsWith('INPUT_')) {
|
||||||
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line jest/expect-expect
|
// prettier-ignore
|
||||||
it('setOutput handles numbers', () => {
|
test.each([
|
||||||
context.setOutput('some output', 1.01);
|
[
|
||||||
assertWriteCalls([`::set-output name=some output::1.01${os.EOL}`]);
|
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
|
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
|
||||||
@@ -117,11 +503,3 @@ function getInputName(name: string): string {
|
|||||||
function setInput(name: string, value: string): void {
|
function setInput(name: string, value: string): void {
|
||||||
process.env[getInputName(name)] = value;
|
process.env[getInputName(name)] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert that process.stdout.write calls called only with the given arguments.
|
|
||||||
function assertWriteCalls(calls: string[]): void {
|
|
||||||
expect(process.stdout.write).toHaveBeenCalledTimes(calls.length);
|
|
||||||
for (let i = 0; i < calls.length; i++) {
|
|
||||||
expect(process.stdout.write).toHaveBeenNthCalledWith(i + 1, calls[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import {describe, expect, it, jest} from '@jest/globals';
|
|
||||||
import * as docker from '../src/docker';
|
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
|
|
||||||
describe('isAvailable', () => {
|
|
||||||
it('cli', () => {
|
|
||||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
|
||||||
docker.isAvailable();
|
|
||||||
|
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
|
||||||
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, {
|
|
||||||
silent: true,
|
|
||||||
ignoreReturnCode: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,3 +1 @@
|
|||||||
debug = true
|
debug = true
|
||||||
[registry."docker.io"]
|
|
||||||
mirrors = ["mirror.gcr.io"]
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import {describe, expect, it} from '@jest/globals';
|
|
||||||
import * as git from '../src/git';
|
|
||||||
|
|
||||||
describe('git', () => {
|
|
||||||
it('returns git remote ref', async () => {
|
|
||||||
const ref: string = await git.getRemoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head');
|
|
||||||
expect(ref).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import {describe, expect, it} from '@jest/globals';
|
|
||||||
import * as github from '../src/github';
|
|
||||||
|
|
||||||
describe('github', () => {
|
|
||||||
it('returns latest buildx GitHub release', async () => {
|
|
||||||
const release = await github.getRelease('latest');
|
|
||||||
expect(release).not.toBeNull();
|
|
||||||
expect(release?.tag_name).not.toEqual('');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns v0.2.2 buildx GitHub release', async () => {
|
|
||||||
const release = await github.getRelease('v0.2.2');
|
|
||||||
expect(release).not.toBeNull();
|
|
||||||
expect(release?.tag_name).toEqual('v0.2.2');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -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')
|
||||||
|
});
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import {describe, expect, test} from '@jest/globals';
|
|
||||||
import * as util from '../src/util';
|
|
||||||
|
|
||||||
describe('isValidUrl', () => {
|
|
||||||
test.each([
|
|
||||||
['https://github.com/docker/buildx.git', true],
|
|
||||||
['https://github.com/docker/buildx.git#refs/pull/648/head', true],
|
|
||||||
['v0.4.1', false]
|
|
||||||
])('given %p', async (url, expected) => {
|
|
||||||
expect(util.isValidUrl(url)).toEqual(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
+35
-17
@@ -18,25 +18,41 @@ inputs:
|
|||||||
description: 'List of additional driver-specific options. (eg. image=moby/buildkit:master)'
|
description: 'List of additional driver-specific options. (eg. image=moby/buildkit:master)'
|
||||||
required: false
|
required: false
|
||||||
buildkitd-flags:
|
buildkitd-flags:
|
||||||
description: 'Flags for buildkitd daemon'
|
description: 'BuildKit daemon flags'
|
||||||
default: '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
|
|
||||||
required: false
|
required: false
|
||||||
install:
|
buildkitd-config:
|
||||||
description: 'Sets up docker build command as an alias to docker buildx'
|
description: 'BuildKit daemon config file'
|
||||||
default: 'false'
|
required: false
|
||||||
|
buildkitd-config-inline:
|
||||||
|
description: 'Inline BuildKit daemon config'
|
||||||
required: false
|
required: false
|
||||||
use:
|
use:
|
||||||
description: 'Switch to this builder instance'
|
description: 'Switch to this builder instance'
|
||||||
default: 'true'
|
default: 'true'
|
||||||
required: false
|
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:
|
endpoint:
|
||||||
description: 'Optional address for docker socket or context from `docker context ls`'
|
description: 'Optional address for docker socket or context from `docker context ls`'
|
||||||
required: false
|
required: false
|
||||||
config:
|
platforms:
|
||||||
description: 'BuildKit config file'
|
description: 'Fixed platforms for current node. If not empty, values take priority over the detected ones'
|
||||||
required: false
|
required: false
|
||||||
config-inline:
|
append:
|
||||||
description: 'Inline BuildKit config'
|
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'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
@@ -44,16 +60,18 @@ outputs:
|
|||||||
description: 'Builder name'
|
description: 'Builder name'
|
||||||
driver:
|
driver:
|
||||||
description: 'Builder driver'
|
description: 'Builder driver'
|
||||||
endpoint:
|
|
||||||
description: 'Builder node endpoint'
|
|
||||||
status:
|
|
||||||
description: 'Builder node status'
|
|
||||||
flags:
|
|
||||||
description: 'Builder node flags (if applicable)'
|
|
||||||
platforms:
|
platforms:
|
||||||
description: 'Builder node platforms available (comma separated)'
|
description: 'Builder node platforms (preferred or available)'
|
||||||
|
nodes:
|
||||||
|
description: 'Builder nodes metadata'
|
||||||
|
endpoint:
|
||||||
|
description: 'Builder node endpoint (deprecated, use nodes output instead)'
|
||||||
|
status:
|
||||||
|
description: 'Builder node status (deprecated, use nodes output instead)'
|
||||||
|
flags:
|
||||||
|
description: 'Builder node flags (deprecated, use nodes output instead)'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node24'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
post: 'dist/index.js'
|
post: 'dist/index.js'
|
||||||
+45
-34
@@ -1,15 +1,21 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG NODE_VERSION=12
|
ARG NODE_VERSION=24
|
||||||
ARG DOCKER_VERSION=20.10.13
|
|
||||||
ARG BUILDX_VERSION=0.8.1
|
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS base
|
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
|
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
|
FROM base AS deps
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||||
|
|
||||||
@@ -18,61 +24,66 @@ COPY --from=deps /vendor /
|
|||||||
|
|
||||||
FROM deps AS vendor-validate
|
FROM deps AS vendor-validate
|
||||||
RUN --mount=type=bind,target=.,rw <<EOT
|
RUN --mount=type=bind,target=.,rw <<EOT
|
||||||
set -e
|
set -e
|
||||||
git add -A
|
git add -A
|
||||||
cp -rf /vendor/* .
|
cp -rf /vendor/* .
|
||||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
|
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||||
git status --porcelain -- yarn.lock
|
git status --porcelain -- yarn.lock
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=target=/context \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
--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
|
FROM scratch AS build-update
|
||||||
COPY --from=build /out /
|
COPY --from=build /out /
|
||||||
|
|
||||||
FROM build AS build-validate
|
FROM build AS build-validate
|
||||||
RUN --mount=type=bind,target=.,rw <<EOT
|
RUN --mount=target=/context \
|
||||||
set -e
|
--mount=target=.,type=tmpfs <<EOT
|
||||||
git add -A
|
set -e
|
||||||
cp -rf /out/* .
|
rsync -a /context/. .
|
||||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
git add -A
|
||||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
rm -rf dist
|
||||||
git status --porcelain -- dist
|
cp -rf /out/* .
|
||||||
exit 1
|
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||||
fi
|
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||||
|
git status --porcelain -- dist
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
FROM deps AS format
|
FROM deps AS format
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run format \
|
yarn run format && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
|
||||||
|
|
||||||
FROM scratch AS format-update
|
FROM scratch AS format-update
|
||||||
COPY --from=format /out /
|
COPY --from=format /out /
|
||||||
|
|
||||||
FROM deps AS lint
|
FROM deps AS lint
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run lint
|
yarn run lint
|
||||||
|
|
||||||
FROM docker:${DOCKER_VERSION} as docker
|
|
||||||
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
|
|
||||||
|
|
||||||
FROM deps AS test
|
FROM deps AS test
|
||||||
ENV RUNNER_TEMP=/tmp/github_runner
|
|
||||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
--mount=type=bind,from=docker,source=/usr/local/bin/docker,target=/usr/bin/docker \
|
yarn run test --coverage --coverage.reportsDirectory=/tmp/coverage
|
||||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
|
|
||||||
yarn run test --coverageDirectory=/tmp/coverage
|
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/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
|
||||||
+44
-3
@@ -1,10 +1,51 @@
|
|||||||
require('./sourcemap-register.js');(()=>{var e={7351:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const o=s(r(2037));const a=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+o.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const l="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=l+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${l}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const a=r(7351);const l=r(717);const c=r(5278);const u=s(r(2037));const p=s(r(1017));const h=r(8041);var d;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(d=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){const t="_GitHubActionsFileCommandDelimeter_";const n=`${e}<<${t}${u.EOL}${r}${u.EOL}${t}`;l.issueCommand("ENV",n)}else{a.issueCommand("set-env",{name:e},r)}}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){l.issueCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${p.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}if(t&&t.trimWhitespace===false){return r}return r.trim()}t.getInput=getInput;function getMultilineInput(e,t){const r=getInput(e,t).split("\n").filter((e=>e!==""));return r}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.includes(i))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){process.stdout.write(u.EOL);a.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=d.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){a.issueCommand("debug",{},e)}t.debug=debug;function error(e,t={}){a.issueCommand("error",c.toCommandProperties(t),e instanceoLine truncated
|
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)
|
||||||
|
*
|
||||||
|
* @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/
|
||||||
|
*/
|
||||||
|
(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
|
||||||
|
/*!
|
||||||
|
* negotiator
|
||||||
|
* Copyright(c) 2012 Federico Romero
|
||||||
|
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
||||||
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||||
|
* MIT Licensed
|
||||||
|
*/
|
||||||
|
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
|
* Tmp
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||||
*
|
*
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/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
|
||||||
const n=r(7147);const i=r(2037);const s=r(1017);const o=r(6113);const a={fs:n.constants,os:i.constants};const l=r(4959);const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",u=/XXXXXX/,p=3,h=(a.O_CREAT||a.fs.O_CREAT)|(a.O_EXCL||a.fs.O_EXCL)|(a.O_RDWR||a.fs.O_RDWR),d=i.platform()==="win32",m=a.EBADF||a.os.errno.EBADF,v=a.ENOENT||a.os.errno.ENOENT,g=448,E=384,y="exit",b=[],w=n.rmdirSync.bind(n),_=l.sync;let O=false;function tmpName(e,t){const r=_parseArguments(e,t),i=r[0],s=r[1];try{_assertAndSanitizeOptions(i)}catch(e){return s(e)}let o=i.tries;(function _getUniqueName(){try{const e=_generateTmpName(i);n.stat(e,(function(t){if(!t){if(o-- >0)return _getUniqueName();return s(new Error("Could not get a unique tmp filename, max tries reached "+e))}s(null,e)}))}catch(e){s(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),r=t[0];_assertAndSanitizeOptions(r);let i=r.tries;do{const e=_generateTmpName(r);try{n.statSync(e)}catch(t){return e}}while(i-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const r=_parseArguments(e,t),i=r[0],s=r[1];tmpName(i,(function _tmpNameCreated(e,t){if(e)return s(e);n.open(t,h,i.mode||E,(function _fileCreated(e,r){if(e)return s(e);if(i.discardDescriptor){return n.close(r,(function _discardCallback(e){return s(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,i,false))}))}else{const e=i.discardDescriptor||i.detachDescriptor;s(null,t,r,_prepareTmpFileRemoveCallback(t,e?-1:r,i,false))}}))}))}function fileSync(e){const t=_parseArguments(e),r=t[0];const i=r.discardDescriptor||r.detachDescriptor;const s=tmpNameSync(r);var o=n.openSync(s,h,r.mode||E);if(r.discardDescriptor){n.closeSync(o);o=undefined}return{name:s,fd:o,removeCallback:_prepareTmpFileRemoveCallback(s,i?-1:o,r,true)}}function dir(e,t){const r=_parseArguments(e,t),i=r[0],s=r[1];tmpName(i,(function _tmpNameCreated(e,t){if(e)return s(e);n.mkdir(t,i.mode||g,(function _dirCreated(e){if(e)return s(e);s(null,t,_prepareTmpDirRemoveCallback(t,i,false))}))}))}function dirSync(e){const t=_parseArguments(e),r=t[0];const i=tmpNameSync(r);n.mkdirSync(i,r.mode||g);return{name:i,removeCallback:_prepareTmpDirRemoveCallback(i,r,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])n.close(e[0],(function(){n.unlink(e[1],_handler)}));else n.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])n.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{n.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,n){const i=_prepareRemoveCallback(_removeFileSync,[t,e],n);const s=_prepareRemoveCallback(_removeFileAsync,[t,e],n,i);if(!r.keep)b.unshift(i);return n?i:s}function _prepareTmpDirRemoveCallback(e,t,r){const i=t.unsafeCleanup?l:n.rmdir.bind(n);const s=t.unsafeCleanup?_:w;const o=_prepareRemoveCallback(s,e,r);const a=_prepareRemoveCallback(i,e,r,o);if(!t.keep)b.unshift(o);return r?o:a}function _prepareRemoveCallback(e,t,r,n){let i=false;return function _cleanupCallback(s){if(!i){const o=n||_cleanupCallback;const a=b.indexOf(o);if(a>=0)b.splice(a,1);i=true;if(r||e===w||e===_){return e(t)}else{return e(t,s||function(){})}}}}function _garbageCollector(){if(!O)return;while(b.length){try{b[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=o.randomBytes(e)}catch(t){r=o.pseudoRandomBytes(e)}for(var n=0;n<e;n++){t.push(c[r[n]%c.length])}return t.join("")}function _isBlank(e){return e===null||_isUndefined(e)||!e.trim()}function _isUndefined(e){return typeof e==="undefined"}function _parseArguments(e,t){if(typeof e==="function"){return[{},e]}if(_isUndefined(e)){return[{},t]}const r={};for(const t of Object.getOwnPropertyNames(e)){r[t]=e[t]}return[r,t]}function _generateTmpName(e){const t=e.tmpdir;if(!_isUndefined(e.name))return s.join(t,e.dir,e.name);if(!_isUndefined(e.template))return s.join(t,e.dir,e.template).replace(u,_randomChars(6));const r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",_randomChars(12),e.postfix?"-"+e.postfix:""].join("");return s.join(t,e.dir,r)}function _assertAndSanitizeOptions(e){e.tmpdir=_getTmpDir(e);const t=e.tmpdir;if(!_isUndefined(e.name))_assertIsRelative(e.name,"name",t);if(!_isUndefined(e.dir))_assertIsRelative(e.dir,"dir",t);if(!_isUndefined(e.template)){_assertIsRelative(e.template,"template",t);if(!e.template.match(u))throw new Error(`Invalid template, found "${e.template}".`)}if(!_isUndefined(e.tries)&&isNaN(e.tries)||e.tries<0)throw new Error(`Invalid tries, found "${e.tries}".`);e.tries=_isUndefined(e.name)?e.tries||p:1;e.keep=!!e.keep;e.detachDescriptor=!!e.detachDescriptor;e.discardDescriptor=!!e.discardDescriptor;e.unsafeCleanup=!!e.unsafeCleanup;e.dir=_isUndefined(e.dir)?"":s.relative(t,_resolvePath(e.dir,t));e.template=_isUndefined(e.template)?undefined:s.relative(t,_resolvePath(e.template,t));e.template=_isBlank(e.template)?undefined:s.relative(e.dir,e.template);e.naLine 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
|
//# sourceMappingURL=index.js.map
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["../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/utils.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/http-client/auth.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/proxy.js","../webpack:/docker-setup-buildx/node_modules/@actions/io/lib/io-util.js","../webpack:/docker-setup-buildx/node_modules/@actions/io/lib/io.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/lib/manifest.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/lib/retry-helper.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/lib/tool-cache.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/node_modules/semver/semver.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/node_modules/uuid/lib/bytesToUuid.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/node_modules/uuid/lib/rng.js","../webpack:/docker-setup-buildx/node_modules/@actions/tool-cache/node_modules/uuid/v4.js","../webpack:/docker-setup-buildx/node_modules/balanced-match/index.js","../webpack:/docker-setup-buildx/node_modules/brace-expansion/index.js","../webpack:/docker-setup-buildx/node_modules/concat-map/index.js","../webpack:/docker-setup-buildx/node_modules/fs.realpath/index.js","../webpack:/docker-setup-buildx/node_modules/fs.realpath/old.js","../webpack:/docker-setup-buildx/node_modules/glob/common.js","../webpack:/docker-setup-buildx/node_modules/glob/glob.js","../webpack:/docker-setup-buildx/node_modules/glob/sync.js","../webpack:/docker-setup-buildx/node_modules/inflight/inflight.js","../webpack:/docker-setup-buildx/node_modules/inherits/inherits.js","../webpack:/docker-setup-buildx/node_modules/inherits/inherits_browser.js","../webpack:/docker-setup-buildx/node_modules/lru-cache/index.js","../webpack:/docker-setup-buildx/node_modules/minimatch/minimatch.js","../webpack:/docker-setup-buildx/node_modules/once/once.js","../webpack:/docker-setup-buildx/node_modules/path-is-absolute/index.js","../webpack:/docker-setup-buildx/node_modules/rimraf/rimraf.js","../webpack:/docker-setup-buildx/node_modules/semver/classes/comparator.js","../webpack:/docker-setup-buildx/node_modules/semver/classes/range.js","../webpack:/docker-setup-buildx/node_modules/semver/classes/semver.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/clean.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/cmp.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/coerce.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/compare-build.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/compare-loose.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/compare.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/diff.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/eq.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/gt.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/gte.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/inc.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/lt.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/lte.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/major.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/minor.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/neq.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/parse.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/patch.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/prerelease.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/rcompare.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/rsort.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/satisfies.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/sort.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/valid.js","../webpack:/docker-setup-buildx/node_modules/semver/index.js","../webpack:/docker-setup-buildx/node_modules/semver/internal/constants.js","../webpack:/docker-setup-buildx/node_modules/semver/internal/debug.js","../webpack:/docker-setup-buildx/node_modules/semver/internal/identifiers.js","../webpack:/docker-setup-buildx/node_modules/semver/internal/parse-options.js","..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
-466
@@ -1,475 +1,11 @@
|
|||||||
@actions/core
|
p-map
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@actions/exec
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@actions/http-client
|
|
||||||
MIT
|
|
||||||
Actions Http Client for Node.js
|
|
||||||
|
|
||||||
Copyright (c) GitHub, Inc.
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
||||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
||||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@actions/io
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@actions/tool-cache
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
balanced-match
|
|
||||||
MIT
|
|
||||||
(MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
of the Software, and to permit persons to whom the Software is furnished to do
|
|
||||||
so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
brace-expansion
|
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
concat-map
|
|
||||||
MIT
|
|
||||||
This software is released under the MIT license:
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
fs.realpath
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
This library bundles a version of the `fs.realpath` and `fs.realpathSync`
|
|
||||||
methods from Node.js v0.10 under the terms of the Node.js MIT license.
|
|
||||||
|
|
||||||
Node's license follows, also included at the header of `old.js` which contains
|
|
||||||
the licensed code:
|
|
||||||
|
|
||||||
Copyright Joyent, Inc. and other Node contributors.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
copy of this software and associated documentation files (the "Software"),
|
|
||||||
to deal in the Software without restriction, including without limitation
|
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
glob
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
## Glob Logo
|
|
||||||
|
|
||||||
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
|
|
||||||
under a Creative Commons Attribution-ShareAlike 4.0 International License
|
|
||||||
https://creativecommons.org/licenses/by-sa/4.0/
|
|
||||||
|
|
||||||
|
|
||||||
inflight
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
inherits
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
||||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lru-cache
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
minimatch
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
once
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
path-is-absolute
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
rimraf
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
semver
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
tmp
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014 KARASZI István
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
tunnel
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2012 Koichi Kobayashi
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
uuid
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2010-2020 Robert Kieffer and other contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
wrappy
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
yallist
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
+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},284:(e,r,n)=>{e=n.nmd(e);var t=n(596).SourceMapConsumer;var o=n(17);var i;try{i=n(147);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(650);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 h=[];var d=[];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(h);h.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(d);d.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||"<anonymous>")}else if(i){o+=i}elLine truncated
|
|
||||||
+15
-2
@@ -1,9 +1,15 @@
|
|||||||
|
target "_common" {
|
||||||
|
args = {
|
||||||
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["build"]
|
targets = ["build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "pre-checkin" {
|
group "pre-checkin" {
|
||||||
targets = ["vendor-update", "format", "build"]
|
targets = ["vendor", "format", "build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "validate" {
|
group "validate" {
|
||||||
@@ -11,42 +17,49 @@ group "validate" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target "build" {
|
target "build" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-update"
|
target = "build-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build-validate" {
|
target "build-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-validate"
|
target = "build-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "format" {
|
target "format" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "format-update"
|
target = "format-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "lint" {
|
target "lint" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "lint"
|
target = "lint"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-update" {
|
target "vendor" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-validate" {
|
target "vendor-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-validate"
|
target = "vendor-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "test-coverage"
|
target = "test-coverage"
|
||||||
output = ["./coverage"]
|
output = ["./coverage"]
|
||||||
|
|||||||
@@ -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,10 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
clearMocks: true,
|
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
|
||||||
setupFiles: ["dotenv/config"],
|
|
||||||
testMatch: ['**/*.test.ts'],
|
|
||||||
transform: {
|
|
||||||
'^.+\\.ts$': 'ts-jest'
|
|
||||||
},
|
|
||||||
verbose: true
|
|
||||||
}
|
|
||||||
+26
-36
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "docker-setup-buildx",
|
"name": "docker-setup-buildx",
|
||||||
"description": "Set up Docker Buildx",
|
"description": "Set up Docker Buildx",
|
||||||
"main": "lib/main.js",
|
"type": "module",
|
||||||
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
"lint": "eslint --max-warnings=0 .",
|
||||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
"format": "eslint --fix .",
|
||||||
"test": "jest --coverage",
|
"test": "vitest run"
|
||||||
"all": "yarn run build && yarn run format && yarn test"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -18,39 +18,29 @@
|
|||||||
"docker",
|
"docker",
|
||||||
"buildx"
|
"buildx"
|
||||||
],
|
],
|
||||||
"author": "Docker",
|
"author": "Docker Inc.",
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "CrazyMax",
|
|
||||||
"url": "https://crazymax.dev"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"packageManager": "yarn@4.9.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^3.0.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@docker/actions-toolkit": "^0.79.0",
|
||||||
"@actions/http-client": "^1.0.11",
|
"js-yaml": "^4.1.1"
|
||||||
"@actions/tool-cache": "^1.7.2",
|
|
||||||
"semver": "^7.3.7",
|
|
||||||
"tmp": "^0.2.1",
|
|
||||||
"uuid": "^8.3.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.26",
|
"@eslint/js": "^9.39.3",
|
||||||
"@types/semver": "^7.3.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/tmp": "^0.2.3",
|
"@types/node": "^24.11.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||||
"@typescript-eslint/parser": "^5.14.0",
|
"@typescript-eslint/parser": "^8.56.1",
|
||||||
"@vercel/ncc": "^0.33.3",
|
"@vercel/ncc": "^0.38.4",
|
||||||
"dotenv": "^16.0.0",
|
"@vitest/coverage-v8": "^4.0.18",
|
||||||
"eslint": "^8.11.0",
|
"@vitest/eslint-plugin": "^1.6.9",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint": "^9.39.3",
|
||||||
"eslint-plugin-jest": "^26.1.1",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"jest": "^27.2.5",
|
"globals": "^17.3.0",
|
||||||
"prettier": "^2.3.1",
|
"prettier": "^3.8.1",
|
||||||
"ts-jest": "^27.1.2",
|
"typescript": "^5.9.3",
|
||||||
"ts-node": "^10.7.0",
|
"vitest": "^4.0.18"
|
||||||
"typescript": "^4.4.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-337
@@ -1,337 +0,0 @@
|
|||||||
import * as fs from 'fs';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as semver from 'semver';
|
|
||||||
import * as util from 'util';
|
|
||||||
import * as context from './context';
|
|
||||||
import * as git from './git';
|
|
||||||
import * as github from './github';
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as exec from '@actions/exec';
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
|
|
||||||
export type Builder = {
|
|
||||||
name?: string;
|
|
||||||
driver?: string;
|
|
||||||
node_name?: string;
|
|
||||||
node_endpoint?: string;
|
|
||||||
node_status?: string;
|
|
||||||
node_flags?: string;
|
|
||||||
node_platforms?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export async function getConfigInline(s: string): Promise<string> {
|
|
||||||
return getConfig(s, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getConfigFile(s: string): Promise<string> {
|
|
||||||
return getConfig(s, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getConfig(s: string, file: boolean): Promise<string> {
|
|
||||||
if (file) {
|
|
||||||
if (!fs.existsSync(s)) {
|
|
||||||
throw new Error(`config file ${s} not found`);
|
|
||||||
}
|
|
||||||
s = fs.readFileSync(s, {encoding: 'utf-8'});
|
|
||||||
}
|
|
||||||
const configFile = context.tmpNameSync({
|
|
||||||
tmpdir: context.tmpDir()
|
|
||||||
});
|
|
||||||
fs.writeFileSync(configFile, s);
|
|
||||||
return configFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function isAvailable(standalone?: boolean): Promise<boolean> {
|
|
||||||
const cmd = getCommand([], standalone);
|
|
||||||
return await exec
|
|
||||||
.getExecOutput(cmd.commandLine, cmd.args, {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return res.exitCode == 0;
|
|
||||||
})
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
.catch(error => {
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getVersion(standalone?: boolean): Promise<string> {
|
|
||||||
const cmd = getCommand(['version'], standalone);
|
|
||||||
return await exec
|
|
||||||
.getExecOutput(cmd.commandLine, cmd.args, {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
||||||
throw new Error(res.stderr.trim());
|
|
||||||
}
|
|
||||||
return parseVersion(res.stdout.trim());
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseVersion(stdout: string): string {
|
|
||||||
const matches = /\sv?([0-9a-f]{7}|[0-9.]+)/.exec(stdout);
|
|
||||||
if (!matches) {
|
|
||||||
throw new Error(`Cannot parse buildx version`);
|
|
||||||
}
|
|
||||||
return matches[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function satisfies(version: string, range: string): boolean {
|
|
||||||
return semver.satisfies(version, range) || /^[0-9a-f]{7}$/.exec(version) !== null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function inspect(name: string, standalone?: boolean): Promise<Builder> {
|
|
||||||
const cmd = getCommand(['inspect', name], standalone);
|
|
||||||
return await exec
|
|
||||||
.getExecOutput(cmd.commandLine, cmd.args, {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
||||||
throw new Error(res.stderr.trim());
|
|
||||||
}
|
|
||||||
const builder: Builder = {};
|
|
||||||
itlines: for (const line of res.stdout.trim().split(`\n`)) {
|
|
||||||
const [key, ...rest] = line.split(':');
|
|
||||||
const value = rest.map(v => v.trim()).join(':');
|
|
||||||
if (key.length == 0 || value.length == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
switch (key) {
|
|
||||||
case 'Name': {
|
|
||||||
if (builder.name == undefined) {
|
|
||||||
builder.name = value;
|
|
||||||
} else {
|
|
||||||
builder.node_name = value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'Driver': {
|
|
||||||
builder.driver = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'Endpoint': {
|
|
||||||
builder.node_endpoint = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'Status': {
|
|
||||||
builder.node_status = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'Flags': {
|
|
||||||
builder.node_flags = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'Platforms': {
|
|
||||||
builder.node_platforms = value.replace(/\s/g, '');
|
|
||||||
break itlines;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return builder;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function build(inputBuildRef: string, dest: string, standalone: boolean): Promise<string> {
|
|
||||||
// eslint-disable-next-line prefer-const
|
|
||||||
let [repo, ref] = inputBuildRef.split('#');
|
|
||||||
if (ref.length == 0) {
|
|
||||||
ref = 'master';
|
|
||||||
}
|
|
||||||
|
|
||||||
let vspec: string;
|
|
||||||
if (ref.match(/^[0-9a-fA-F]{40}$/)) {
|
|
||||||
vspec = ref;
|
|
||||||
} else {
|
|
||||||
vspec = await git.getRemoteSha(repo, ref);
|
|
||||||
}
|
|
||||||
core.debug(`Tool version spec ${vspec}`);
|
|
||||||
|
|
||||||
let toolPath: string;
|
|
||||||
toolPath = tc.find('buildx', vspec);
|
|
||||||
if (!toolPath) {
|
|
||||||
const outFolder = path.join(context.tmpDir(), 'out').split(path.sep).join(path.posix.sep);
|
|
||||||
let buildWithStandalone = false;
|
|
||||||
const standaloneFound = await isAvailable(true);
|
|
||||||
const pluginFound = await isAvailable(false);
|
|
||||||
if (standalone && standaloneFound) {
|
|
||||||
core.debug(`Buildx standalone found, build with it`);
|
|
||||||
buildWithStandalone = true;
|
|
||||||
} else if (!standalone && pluginFound) {
|
|
||||||
core.debug(`Buildx plugin found, build with it`);
|
|
||||||
buildWithStandalone = false;
|
|
||||||
} else if (standaloneFound) {
|
|
||||||
core.debug(`Buildx plugin not found, but standalone found so trying to build with it`);
|
|
||||||
buildWithStandalone = true;
|
|
||||||
} else if (pluginFound) {
|
|
||||||
core.debug(`Buildx standalone not found, but plugin found so trying to build with it`);
|
|
||||||
buildWithStandalone = false;
|
|
||||||
} else {
|
|
||||||
throw new Error(`Neither buildx standalone or plugin have been found to build from ref`);
|
|
||||||
}
|
|
||||||
const buildCmd = getCommand(['build', '--target', 'binaries', '--build-arg', 'BUILDKIT_CONTEXT_KEEP_GIT_DIR=1', '--output', `type=local,dest=${outFolder}`, inputBuildRef], buildWithStandalone);
|
|
||||||
toolPath = await exec
|
|
||||||
.getExecOutput(buildCmd.commandLine, buildCmd.args, {
|
|
||||||
ignoreReturnCode: true
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
||||||
core.warning(res.stderr.trim());
|
|
||||||
}
|
|
||||||
return tc.cacheFile(`${outFolder}/buildx`, context.osPlat == 'win32' ? 'docker-buildx.exe' : 'docker-buildx', 'buildx', vspec);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (standalone) {
|
|
||||||
return setStandalone(toolPath, dest);
|
|
||||||
}
|
|
||||||
return setPlugin(toolPath, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function install(inputVersion: string, dest: string, standalone: boolean): Promise<string> {
|
|
||||||
const release: github.GitHubRelease | null = await github.getRelease(inputVersion);
|
|
||||||
if (!release) {
|
|
||||||
throw new Error(`Cannot find buildx ${inputVersion} release`);
|
|
||||||
}
|
|
||||||
core.debug(`Release ${release.tag_name} found`);
|
|
||||||
const version = release.tag_name.replace(/^v+|v+$/g, '');
|
|
||||||
|
|
||||||
let toolPath: string;
|
|
||||||
toolPath = tc.find('buildx', version);
|
|
||||||
if (!toolPath) {
|
|
||||||
const c = semver.clean(version) || '';
|
|
||||||
if (!semver.valid(c)) {
|
|
||||||
throw new Error(`Invalid Buildx version "${version}".`);
|
|
||||||
}
|
|
||||||
toolPath = await download(version);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (standalone) {
|
|
||||||
return setStandalone(toolPath, dest);
|
|
||||||
}
|
|
||||||
return setPlugin(toolPath, dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setStandalone(toolPath: string, dest: string): Promise<string> {
|
|
||||||
core.info('Standalone mode');
|
|
||||||
const toolBinPath = path.join(toolPath, context.osPlat == 'win32' ? 'docker-buildx.exe' : 'docker-buildx');
|
|
||||||
|
|
||||||
const binDir = path.join(dest, 'bin');
|
|
||||||
core.debug(`Bin dir is ${binDir}`);
|
|
||||||
if (!fs.existsSync(binDir)) {
|
|
||||||
fs.mkdirSync(binDir, {recursive: true});
|
|
||||||
}
|
|
||||||
|
|
||||||
const filename: string = context.osPlat == 'win32' ? 'buildx.exe' : 'buildx';
|
|
||||||
const buildxPath: string = path.join(binDir, filename);
|
|
||||||
core.debug(`Bin path is ${buildxPath}`);
|
|
||||||
fs.copyFileSync(toolBinPath, buildxPath);
|
|
||||||
|
|
||||||
core.info('Fixing perms');
|
|
||||||
fs.chmodSync(buildxPath, '0755');
|
|
||||||
|
|
||||||
core.addPath(binDir);
|
|
||||||
core.info('Added buildx to the path');
|
|
||||||
|
|
||||||
return buildxPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function setPlugin(toolPath: string, dockerConfigHome: string): Promise<string> {
|
|
||||||
core.info('Docker plugin mode');
|
|
||||||
const toolBinPath = path.join(toolPath, context.osPlat == 'win32' ? 'docker-buildx.exe' : 'docker-buildx');
|
|
||||||
|
|
||||||
const pluginsDir: string = path.join(dockerConfigHome, 'cli-plugins');
|
|
||||||
core.debug(`Plugins dir is ${pluginsDir}`);
|
|
||||||
if (!fs.existsSync(pluginsDir)) {
|
|
||||||
fs.mkdirSync(pluginsDir, {recursive: true});
|
|
||||||
}
|
|
||||||
|
|
||||||
const filename: string = context.osPlat == 'win32' ? 'docker-buildx.exe' : 'docker-buildx';
|
|
||||||
const pluginPath: string = path.join(pluginsDir, filename);
|
|
||||||
core.debug(`Plugin path is ${pluginPath}`);
|
|
||||||
fs.copyFileSync(toolBinPath, pluginPath);
|
|
||||||
|
|
||||||
core.info('Fixing perms');
|
|
||||||
fs.chmodSync(pluginPath, '0755');
|
|
||||||
|
|
||||||
return pluginPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function download(version: string): Promise<string> {
|
|
||||||
const targetFile: string = context.osPlat == 'win32' ? 'docker-buildx.exe' : 'docker-buildx';
|
|
||||||
const downloadUrl = util.format('https://github.com/docker/buildx/releases/download/v%s/%s', version, await filename(version));
|
|
||||||
core.info(`Downloading ${downloadUrl}`);
|
|
||||||
const downloadPath = await tc.downloadTool(downloadUrl);
|
|
||||||
core.debug(`Downloaded to ${downloadPath}`);
|
|
||||||
return await tc.cacheFile(downloadPath, targetFile, 'buildx', version);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function filename(version: string): Promise<string> {
|
|
||||||
let arch: string;
|
|
||||||
switch (context.osArch) {
|
|
||||||
case 'x64': {
|
|
||||||
arch = 'amd64';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'ppc64': {
|
|
||||||
arch = 'ppc64le';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'arm': {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
const arm_version = (process.config.variables as any).arm_version;
|
|
||||||
arch = arm_version ? 'arm-v' + arm_version : 'arm';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
arch = context.osArch;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const platform: string = context.osPlat == 'win32' ? 'windows' : context.osPlat;
|
|
||||||
const ext: string = context.osPlat == 'win32' ? '.exe' : '';
|
|
||||||
return util.format('buildx-v%s.%s-%s%s', version, platform, arch, ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getBuildKitVersion(containerID: string): Promise<string> {
|
|
||||||
return exec
|
|
||||||
.getExecOutput(`docker`, ['inspect', '--format', '{{.Config.Image}}', containerID], {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(bkitimage => {
|
|
||||||
if (bkitimage.exitCode == 0 && bkitimage.stdout.length > 0) {
|
|
||||||
return exec
|
|
||||||
.getExecOutput(`docker`, ['run', '--rm', bkitimage.stdout.trim(), '--version'], {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(bkitversion => {
|
|
||||||
if (bkitversion.exitCode == 0 && bkitversion.stdout.length > 0) {
|
|
||||||
return `${bkitimage.stdout.trim()} => ${bkitversion.stdout.trim()}`;
|
|
||||||
} else if (bkitversion.stderr.length > 0) {
|
|
||||||
core.warning(bkitversion.stderr.trim());
|
|
||||||
}
|
|
||||||
return bkitversion.stdout.trim();
|
|
||||||
});
|
|
||||||
} else if (bkitimage.stderr.length > 0) {
|
|
||||||
core.warning(bkitimage.stderr.trim());
|
|
||||||
}
|
|
||||||
return bkitimage.stdout.trim();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getCommand(args: Array<string>, standalone?: boolean) {
|
|
||||||
return {
|
|
||||||
commandLine: standalone ? 'buildx' : 'docker',
|
|
||||||
args: standalone ? args : ['buildx', ...args]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
+104
-41
@@ -1,69 +1,132 @@
|
|||||||
import fs from 'fs';
|
import * as crypto from 'crypto';
|
||||||
import * as os from 'os';
|
|
||||||
import path from 'path';
|
|
||||||
import * as tmp from 'tmp';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {issueCommand} from '@actions/core/lib/command';
|
|
||||||
|
|
||||||
let _tmpDir: string;
|
import {Docker} from '@docker/actions-toolkit/lib/docker/docker.js';
|
||||||
export const osPlat: string = os.platform();
|
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||||
export const osArch: string = os.arch();
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||||
|
|
||||||
export function tmpDir(): string {
|
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder.js';
|
||||||
if (!_tmpDir) {
|
|
||||||
_tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-')).split(path.sep).join(path.posix.sep);
|
|
||||||
}
|
|
||||||
return _tmpDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function tmpNameSync(options?: tmp.TmpNameOptions): string {
|
export const builderNodeEnvPrefix = 'BUILDER_NODE';
|
||||||
return tmp.tmpNameSync(options);
|
const defaultBuildkitdFlags = '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host';
|
||||||
}
|
|
||||||
|
|
||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
version: string;
|
version: string;
|
||||||
|
name: string;
|
||||||
driver: string;
|
driver: string;
|
||||||
driverOpts: string[];
|
driverOpts: string[];
|
||||||
buildkitdFlags: string;
|
buildkitdFlags: string;
|
||||||
install: boolean;
|
buildkitdConfig: string;
|
||||||
|
buildkitdConfigInline: string;
|
||||||
|
platforms: string[];
|
||||||
use: boolean;
|
use: boolean;
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
config: string;
|
append: string;
|
||||||
configInline: string;
|
cacheBinary: boolean;
|
||||||
|
cleanup: boolean;
|
||||||
|
keepState: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getInputs(): Promise<Inputs> {
|
export async function getInputs(): Promise<Inputs> {
|
||||||
return {
|
return {
|
||||||
version: core.getInput('version'),
|
version: core.getInput('version'),
|
||||||
|
name: await getBuilderName(core.getInput('name'), core.getInput('driver') || 'docker-container'),
|
||||||
driver: core.getInput('driver') || 'docker-container',
|
driver: core.getInput('driver') || 'docker-container',
|
||||||
driverOpts: await getInputList('driver-opts', true),
|
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'),
|
||||||
install: core.getBooleanInput('install'),
|
platforms: Util.getInputList('platforms'),
|
||||||
use: core.getBooleanInput('use'),
|
use: core.getBooleanInput('use'),
|
||||||
endpoint: core.getInput('endpoint'),
|
endpoint: core.getInput('endpoint'),
|
||||||
config: core.getInput('config'),
|
buildkitdConfig: core.getInput('buildkitd-config'),
|
||||||
configInline: core.getInput('config-inline')
|
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 getInputList(name: string, ignoreComma?: boolean): Promise<string[]> {
|
export async function getBuilderName(name: string, driver: string): Promise<string> {
|
||||||
const items = core.getInput(name);
|
return driver == 'docker' ? await Docker.context() : name || `builder-${crypto.randomUUID()}`;
|
||||||
if (items == '') {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return items
|
|
||||||
.split(/\r?\n/)
|
|
||||||
.filter(x => x)
|
|
||||||
.reduce<string[]>((acc, line) => acc.concat(!ignoreComma ? line.split(',').filter(x => x) : line).map(pat => pat.trim()), []);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const asyncForEach = async (array, callback) => {
|
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
for (let index = 0; index < array.length; index++) {
|
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
|
||||||
await callback(array[index], index, array);
|
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
|
||||||
|
await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => {
|
||||||
|
args.push('--driver-opt', driverOpt);
|
||||||
|
});
|
||||||
|
if (inputs.buildkitdFlags) {
|
||||||
|
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
||||||
|
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||||
|
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
if (inputs.platforms.length > 0) {
|
||||||
|
args.push('--platform', inputs.platforms.join(','));
|
||||||
|
}
|
||||||
|
if (inputs.use) {
|
||||||
|
args.push('--use');
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
|
export async function getAppendArgs(inputs: Inputs, node: Node, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
export function setOutput(name: string, value: unknown): void {
|
const args: Array<string> = ['create', '--name', inputs.name, '--append'];
|
||||||
issueCommand('set-output', {name}, value);
|
if (node.name) {
|
||||||
|
args.push('--node', node.name);
|
||||||
|
} else if (inputs.driver == 'kubernetes' && (await toolkit.buildx.versionSatisfies('<0.11.0'))) {
|
||||||
|
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: string) => {
|
||||||
|
args.push('--driver-opt', driverOpt);
|
||||||
|
});
|
||||||
|
if (node['buildkitd-flags']) {
|
||||||
|
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
||||||
|
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||||
|
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node.platforms) {
|
||||||
|
args.push('--platform', node.platforms);
|
||||||
|
}
|
||||||
|
if (node.endpoint) {
|
||||||
|
args.push(node.endpoint);
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getInspectArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
|
const args: Array<string> = ['inspect', '--bootstrap'];
|
||||||
|
if (await toolkit.buildx.versionSatisfies('>=0.4.0')) {
|
||||||
|
args.push('--builder', inputs.name);
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import * as exec from '@actions/exec';
|
|
||||||
|
|
||||||
export async function isAvailable(): Promise<boolean> {
|
|
||||||
return await exec
|
|
||||||
.getExecOutput('docker', undefined, {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return res.exitCode == 0;
|
|
||||||
})
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
.catch(error => {
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
import * as exec from '@actions/exec';
|
|
||||||
|
|
||||||
export async function getRemoteSha(repo: string, ref: string): Promise<string> {
|
|
||||||
return await exec
|
|
||||||
.getExecOutput(`git`, ['ls-remote', repo, ref], {
|
|
||||||
ignoreReturnCode: true,
|
|
||||||
silent: true
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
|
||||||
throw new Error(res.stderr);
|
|
||||||
}
|
|
||||||
const [rsha] = res.stdout.trim().split(/[\s\t]/);
|
|
||||||
if (rsha.length == 0) {
|
|
||||||
throw new Error(`Cannot find remote ref for ${repo}#${ref}`);
|
|
||||||
}
|
|
||||||
return rsha;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import * as httpm from '@actions/http-client';
|
|
||||||
|
|
||||||
export interface GitHubRelease {
|
|
||||||
id: number;
|
|
||||||
tag_name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
|
|
||||||
const url = `https://github.com/docker/buildx/releases/${version}`;
|
|
||||||
const http: httpm.HttpClient = new httpm.HttpClient('setup-buildx');
|
|
||||||
return (await http.getJson<GitHubRelease>(url)).result;
|
|
||||||
};
|
|
||||||
+247
-133
@@ -1,163 +1,277 @@
|
|||||||
import * as os from 'os';
|
import * as crypto from 'crypto';
|
||||||
import * as path from 'path';
|
import * as fs from 'fs';
|
||||||
import * as uuid from 'uuid';
|
import * as yaml from 'js-yaml';
|
||||||
import * as buildx from './buildx';
|
|
||||||
import * as context from './context';
|
|
||||||
import * as docker from './docker';
|
|
||||||
import * as stateHelper from './state-helper';
|
|
||||||
import * as util from './util';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as exec from '@actions/exec';
|
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||||
try {
|
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();
|
const inputs: context.Inputs = await context.getInputs();
|
||||||
const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');
|
stateHelper.setCleanup(inputs.cleanup);
|
||||||
|
const version = context.getVersion(inputs);
|
||||||
|
|
||||||
// standalone if docker cli not available
|
const toolkit = new Toolkit();
|
||||||
const standalone = !(await docker.isAvailable());
|
const standalone = await toolkit.buildx.isStandalone();
|
||||||
stateHelper.setStandalone(standalone);
|
stateHelper.setStandalone(standalone);
|
||||||
|
|
||||||
core.startGroup(`Docker info`);
|
if (inputs.keepState && inputs.driver !== 'docker-container') {
|
||||||
if (standalone) {
|
// https://docs.docker.com/reference/cli/docker/buildx/rm/#keep-state
|
||||||
core.info(`Docker info skipped in standalone mode`);
|
throw new Error(`Cannot use keep-state with ${inputs.driver} driver`);
|
||||||
} else {
|
|
||||||
await exec.exec('docker', ['version'], {
|
|
||||||
failOnStdErr: false
|
|
||||||
});
|
|
||||||
await exec.exec('docker', ['info'], {
|
|
||||||
failOnStdErr: false
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
core.endGroup();
|
stateHelper.setKeepState(inputs.keepState);
|
||||||
|
|
||||||
if (util.isValidUrl(inputs.version)) {
|
await core.group(`Docker info`, async () => {
|
||||||
|
try {
|
||||||
|
await Docker.printVersion();
|
||||||
|
await Docker.printInfo();
|
||||||
|
} catch (e) {
|
||||||
|
core.info(e.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let toolPath;
|
||||||
|
if (Util.isValidRef(version)) {
|
||||||
if (standalone) {
|
if (standalone) {
|
||||||
throw new Error(`Cannot build from source without the Docker CLI`);
|
throw new Error(`Cannot build from source without the Docker CLI`);
|
||||||
}
|
}
|
||||||
core.startGroup(`Build and install buildx`);
|
await core.group(`Build buildx from source`, async () => {
|
||||||
await buildx.build(inputs.version, dockerConfigHome, standalone);
|
toolPath = await toolkit.buildxInstall.build(version, !inputs.cacheBinary);
|
||||||
core.endGroup();
|
});
|
||||||
} else if (!(await buildx.isAvailable(standalone)) || inputs.version) {
|
} else if (!(await toolkit.buildx.isAvailable()) || version) {
|
||||||
core.startGroup(`Download and install buildx`);
|
await core.group(`Download buildx from GitHub Releases`, async () => {
|
||||||
await buildx.install(inputs.version || 'latest', standalone ? context.tmpDir() : dockerConfigHome, standalone);
|
toolPath = await toolkit.buildxInstall.download({
|
||||||
core.endGroup();
|
version: version || 'latest',
|
||||||
|
ghaNoCache: !inputs.cacheBinary
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (toolPath) {
|
||||||
|
await core.group(`Install buildx`, async () => {
|
||||||
|
if (standalone) {
|
||||||
|
await toolkit.buildxInstall.installStandalone(toolPath);
|
||||||
|
} else {
|
||||||
|
await toolkit.buildxInstall.installPlugin(toolPath);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildxVersion = await buildx.getVersion(standalone);
|
|
||||||
await core.group(`Buildx version`, async () => {
|
await core.group(`Buildx version`, async () => {
|
||||||
const versionCmd = buildx.getCommand(['version'], standalone);
|
await toolkit.buildx.printVersion();
|
||||||
await exec.exec(versionCmd.commandLine, versionCmd.args, {
|
});
|
||||||
failOnStdErr: false
|
|
||||||
|
core.setOutput('name', inputs.name);
|
||||||
|
stateHelper.setBuilderName(inputs.name);
|
||||||
|
stateHelper.setBuilderDriver(inputs.driver);
|
||||||
|
|
||||||
|
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 () => {
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputs.append) {
|
||||||
|
await core.group(`Appending node(s) to builder`, async () => {
|
||||||
|
let nodeIndex = 1;
|
||||||
|
const nodes = yaml.load(inputs.append) as Node[];
|
||||||
|
for (const node of nodes) {
|
||||||
|
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, `${node.endpoint}`, {
|
||||||
|
cacert: process.env[`${context.builderNodeEnvPrefix}_${nodeIndex}_AUTH_TLS_CACERT`],
|
||||||
|
cert: process.env[`${context.builderNodeEnvPrefix}_${nodeIndex}_AUTH_TLS_CERT`],
|
||||||
|
key: process.env[`${context.builderNodeEnvPrefix}_${nodeIndex}_AUTH_TLS_KEY`]
|
||||||
|
});
|
||||||
|
if (certsDriverOpts.length > 0) {
|
||||||
|
node['driver-opts'] = [...(node['driver-opts'] || []), ...certsDriverOpts];
|
||||||
|
}
|
||||||
|
const appendCmd = await toolkit.buildx.getCommand(await context.getAppendArgs(inputs, node, toolkit));
|
||||||
|
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++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await core.group(`Booting builder`, async () => {
|
||||||
|
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
|
||||||
|
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 builderName: string = inputs.driver == 'docker' ? 'default' : `builder-${uuid.v4()}`;
|
const builderInspect = await toolkit.builder.inspect(inputs.name);
|
||||||
context.setOutput('name', builderName);
|
const firstNode = builderInspect.nodes[0];
|
||||||
stateHelper.setBuilderName(builderName);
|
|
||||||
|
|
||||||
if (inputs.driver !== 'docker') {
|
await core.group(`Inspect builder`, async () => {
|
||||||
core.startGroup(`Creating a new builder instance`);
|
const reducedPlatforms: Array<string> = [];
|
||||||
const createArgs: Array<string> = ['create', '--name', builderName, '--driver', inputs.driver];
|
for (const node of builderInspect.nodes) {
|
||||||
if (buildx.satisfies(buildxVersion, '>=0.3.0')) {
|
for (const platform of node.platforms?.split(',') || []) {
|
||||||
await context.asyncForEach(inputs.driverOpts, async driverOpt => {
|
if (reducedPlatforms.indexOf(platform) > -1) {
|
||||||
createArgs.push('--driver-opt', driverOpt);
|
continue;
|
||||||
});
|
}
|
||||||
if (inputs.buildkitdFlags) {
|
reducedPlatforms.push(platform);
|
||||||
createArgs.push('--buildkitd-flags', inputs.buildkitdFlags);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inputs.use) {
|
core.info(JSON.stringify(builderInspect, undefined, 2));
|
||||||
createArgs.push('--use');
|
core.setOutput('driver', builderInspect.driver);
|
||||||
}
|
core.setOutput('platforms', reducedPlatforms.join(','));
|
||||||
if (inputs.endpoint) {
|
core.setOutput('nodes', JSON.stringify(builderInspect.nodes, undefined, 2));
|
||||||
createArgs.push(inputs.endpoint);
|
});
|
||||||
}
|
|
||||||
if (inputs.config) {
|
|
||||||
createArgs.push('--config', await buildx.getConfigFile(inputs.config));
|
|
||||||
} else if (inputs.configInline) {
|
|
||||||
createArgs.push('--config', await buildx.getConfigInline(inputs.configInline));
|
|
||||||
}
|
|
||||||
const createCmd = buildx.getCommand(createArgs, standalone);
|
|
||||||
await exec.exec(createCmd.commandLine, createCmd.args);
|
|
||||||
core.endGroup();
|
|
||||||
|
|
||||||
core.startGroup(`Booting builder`);
|
if (!standalone && builderInspect.driver == 'docker-container') {
|
||||||
const bootstrapArgs: Array<string> = ['inspect', '--bootstrap'];
|
stateHelper.setContainerName(`${Buildx.containerNamePrefix}${firstNode.name}`);
|
||||||
if (buildx.satisfies(buildxVersion, '>=0.4.0')) {
|
await core.group(`BuildKit version`, async () => {
|
||||||
bootstrapArgs.push('--builder', builderName);
|
for (const node of builderInspect.nodes) {
|
||||||
}
|
const buildkitVersion = await toolkit.buildkit.getVersion(node);
|
||||||
const bootstrapCmd = buildx.getCommand(bootstrapArgs, standalone);
|
core.info(`${node.name}: ${buildkitVersion}`);
|
||||||
await exec.exec(bootstrapCmd.commandLine, bootstrapCmd.args);
|
}
|
||||||
core.endGroup();
|
});
|
||||||
}
|
}
|
||||||
|
if (core.isDebug() || firstNode['buildkitd-flags']?.includes('--debug')) {
|
||||||
if (inputs.install) {
|
|
||||||
if (standalone) {
|
|
||||||
throw new Error(`Cannot set buildx as default builder without the Docker CLI`);
|
|
||||||
}
|
|
||||||
core.startGroup(`Setting buildx as default builder`);
|
|
||||||
await exec.exec('docker', ['buildx', 'install']);
|
|
||||||
core.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
core.startGroup(`Inspect builder`);
|
|
||||||
const builder = await buildx.inspect(builderName, standalone);
|
|
||||||
core.info(JSON.stringify(builder, undefined, 2));
|
|
||||||
context.setOutput('driver', builder.driver);
|
|
||||||
context.setOutput('endpoint', builder.node_endpoint);
|
|
||||||
context.setOutput('status', builder.node_status);
|
|
||||||
context.setOutput('flags', builder.node_flags);
|
|
||||||
context.setOutput('platforms', builder.node_platforms);
|
|
||||||
core.endGroup();
|
|
||||||
|
|
||||||
if (!standalone && inputs.driver == 'docker-container') {
|
|
||||||
stateHelper.setContainerName(`buildx_buildkit_${builder.node_name}`);
|
|
||||||
core.startGroup(`BuildKit version`);
|
|
||||||
core.info(await buildx.getBuildKitVersion(`buildx_buildkit_${builder.node_name}`));
|
|
||||||
core.endGroup();
|
|
||||||
}
|
|
||||||
if (core.isDebug() || builder.node_flags?.includes('--debug')) {
|
|
||||||
stateHelper.setDebug('true');
|
stateHelper.setDebug('true');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
},
|
||||||
core.setFailed(error.message);
|
// post
|
||||||
}
|
async () => {
|
||||||
}
|
if (stateHelper.IsDebug && stateHelper.containerName.length > 0) {
|
||||||
|
await core.group(`BuildKit container logs`, async () => {
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function cleanup(): Promise<void> {
|
if (!stateHelper.cleanup) {
|
||||||
if (stateHelper.IsDebug && stateHelper.containerName.length > 0) {
|
return;
|
||||||
core.startGroup(`BuildKit container logs`);
|
}
|
||||||
await exec
|
|
||||||
.getExecOutput('docker', ['logs', `${stateHelper.containerName}`], {
|
if (stateHelper.builderDriver != 'docker' && stateHelper.builderName.length > 0) {
|
||||||
ignoreReturnCode: true
|
await core.group(`Removing builder`, async () => {
|
||||||
})
|
const buildx = new Buildx({standalone: stateHelper.standalone});
|
||||||
.then(res => {
|
const builder = new Builder({buildx: buildx});
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (await builder.exists(stateHelper.builderName)) {
|
||||||
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`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
core.endGroup();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (stateHelper.builderName.length > 0) {
|
if (stateHelper.tmpDockerContext) {
|
||||||
core.startGroup(`Removing builder`);
|
await core.group(`Removing temp docker context`, async () => {
|
||||||
const rmCmd = buildx.getCommand(['rm', stateHelper.builderName], /true/i.test(stateHelper.standalone));
|
await Exec.getExecOutput('docker', ['context', 'rm', '-f', stateHelper.tmpDockerContext], {
|
||||||
await exec
|
ignoreReturnCode: true
|
||||||
.getExecOutput(rmCmd.commandLine, rmCmd.args, {
|
}).then(res => {
|
||||||
ignoreReturnCode: true
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
})
|
core.warning(`${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||||
.then(res => {
|
}
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
});
|
||||||
core.warning(res.stderr.trim());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
core.endGroup();
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!stateHelper.IsPost) {
|
if (stateHelper.certsDir.length > 0 && fs.existsSync(stateHelper.certsDir)) {
|
||||||
run();
|
await core.group(`Cleaning up certificates`, async () => {
|
||||||
} else {
|
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
||||||
cleanup();
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
+24
-4
@@ -1,10 +1,14 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
export const IsPost = !!process.env['STATE_isPost'];
|
|
||||||
export const IsDebug = !!process.env['STATE_isDebug'];
|
export const IsDebug = !!process.env['STATE_isDebug'];
|
||||||
export const standalone = process.env['STATE_standalone'] || '';
|
export const standalone = /true/i.test(process.env['STATE_standalone'] || '');
|
||||||
export const builderName = process.env['STATE_builderName'] || '';
|
export const builderName = process.env['STATE_builderName'] || '';
|
||||||
|
export const builderDriver = process.env['STATE_builderDriver'] || '';
|
||||||
export const containerName = process.env['STATE_containerName'] || '';
|
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) {
|
export function setDebug(debug: string) {
|
||||||
core.saveState('isDebug', debug);
|
core.saveState('isDebug', debug);
|
||||||
@@ -18,10 +22,26 @@ export function setBuilderName(builderName: string) {
|
|||||||
core.saveState('builderName', builderName);
|
core.saveState('builderName', builderName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setBuilderDriver(builderDriver: string) {
|
||||||
|
core.saveState('builderDriver', builderDriver);
|
||||||
|
}
|
||||||
|
|
||||||
export function setContainerName(containerName: string) {
|
export function setContainerName(containerName: string) {
|
||||||
core.saveState('containerName', containerName);
|
core.saveState('containerName', containerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsPost) {
|
export function setCertsDir(certsDir: string) {
|
||||||
core.saveState('isPost', 'true');
|
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);
|
||||||
}
|
}
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export function isValidUrl(url: string): boolean {
|
|
||||||
try {
|
|
||||||
new URL(url);
|
|
||||||
} catch (e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
+6
-8
@@ -1,19 +1,17 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6",
|
"module": "nodenext",
|
||||||
"module": "commonjs",
|
"moduleResolution": "nodenext",
|
||||||
|
"esModuleInterop": true,
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
|
"resolveJsonModule": true,
|
||||||
"useUnknownInCatchVariables": false,
|
"useUnknownInCatchVariables": false,
|
||||||
},
|
},
|
||||||
"exclude": [
|
"include": [
|
||||||
"node_modules",
|
"src/**/*.ts"
|
||||||
"**/*.test.ts",
|
|
||||||
"jest.config.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