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 |
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.
|
|
||||||
@@ -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 |
+216
-80
@@ -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,13 +23,16 @@ 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
|
id: buildx
|
||||||
@@ -46,7 +51,7 @@ jobs:
|
|||||||
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: ./
|
||||||
@@ -59,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
|
||||||
@@ -80,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: |
|
||||||
@@ -97,7 +102,7 @@ jobs:
|
|||||||
EOL
|
EOL
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -105,27 +110,11 @@ jobs:
|
|||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v3
|
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:
|
||||||
@@ -137,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: ./
|
||||||
@@ -160,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: ./
|
||||||
@@ -173,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: ./
|
||||||
@@ -206,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: |
|
||||||
@@ -223,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: |
|
||||||
@@ -248,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@v3
|
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: |
|
||||||
@@ -272,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@v3
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
@@ -288,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
|
||||||
@@ -297,10 +285,10 @@ 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@v2
|
uses: docker/setup-qemu-action@v4
|
||||||
with:
|
with:
|
||||||
platforms: ${{ matrix.qemu-platforms }}
|
platforms: ${{ matrix.qemu-platforms }}
|
||||||
-
|
-
|
||||||
@@ -326,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: ./
|
||||||
@@ -349,11 +337,15 @@ jobs:
|
|||||||
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
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -373,11 +365,15 @@ jobs:
|
|||||||
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
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -395,38 +391,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
|
||||||
standalone-install-error:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
-
|
|
||||||
name: Uninstall docker cli
|
|
||||||
run: |
|
|
||||||
sudo apt-get purge -y moby-cli moby-buildx
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
id: buildx
|
|
||||||
continue-on-error: true
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
-
|
|
||||||
name: Check
|
|
||||||
run: |
|
|
||||||
echo "${{ toJson(steps.buildx) }}"
|
|
||||||
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
|
||||||
echo "::error::Should have failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
append:
|
append:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
-
|
||||||
name: Create dummy contexts
|
name: Create dummy contexts
|
||||||
run: |
|
run: |
|
||||||
@@ -455,12 +425,178 @@ 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@v2
|
uses: docker/setup-qemu-action@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64
|
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
|
||||||
|
id: buildx
|
||||||
|
continue-on-error: true
|
||||||
|
uses: ./
|
||||||
|
-
|
||||||
|
name: Check
|
||||||
|
run: |
|
||||||
|
echo "${{ toJson(steps.buildx) }}"
|
||||||
|
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||||
|
echo "::error::Should have failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
keep-state:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: foo
|
||||||
|
keep-state: true
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
name: foo
|
||||||
|
keep-state: true
|
||||||
|
|
||||||
|
keep-state-error:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
continue-on-error: true
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
driver: docker
|
||||||
|
keep-state: true
|
||||||
|
-
|
||||||
|
name: Check
|
||||||
|
run: |
|
||||||
|
echo "${{ toJson(steps.buildx) }}"
|
||||||
|
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||||
|
echo "::error::Should have failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: pr-assign-author
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
name: publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: Publish
|
||||||
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
@@ -1,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,24 +17,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
|
||||||
name: Validate
|
|
||||||
uses: docker/bake-action@v2
|
|
||||||
with:
|
|
||||||
targets: validate
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v2
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
targets: test
|
targets: test
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
-
|
-
|
||||||
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
|
||||||
@@ -20,15 +20,12 @@ ___
|
|||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Configuring your builder](#configuring-your-builder)
|
* [Configuring your builder](#configuring-your-builder)
|
||||||
* [Version pinning](#version-pinning)
|
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [outputs](#outputs)
|
* [outputs](#outputs)
|
||||||
* [environment variables](#environment-variables)
|
* [environment variables](#environment-variables)
|
||||||
* [Notes](#notes)
|
* [Notes](#notes)
|
||||||
* [`nodes` output](#nodes-output)
|
* [`nodes` output](#nodes-output)
|
||||||
* [BuildKit container logs](#buildkit-container-logs)
|
|
||||||
* [Using on GHES](#using-on-ghes)
|
|
||||||
* [Contributing](#contributing)
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -45,53 +42,36 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
# Add support for more platforms with QEMU (optional)
|
# Add support for more platforms with QEMU (optional)
|
||||||
# https://github.com/docker/setup-qemu-action
|
# https://github.com/docker/setup-qemu-action
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuring your builder
|
## Configuring your builder
|
||||||
|
|
||||||
See https://docs.docker.com/build/ci/github-actions/configure-builder/
|
* [Version pinning](https://docs.docker.com/build/ci/github-actions/configure-builder/#version-pinning): Pin to a specific Buildx or BuildKit version
|
||||||
|
* [BuildKit container logs](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs): Enable BuildKit container logs for debugging purposes
|
||||||
## Version pinning
|
* [BuildKit Daemon configuration](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-daemon-configuration)
|
||||||
|
* [Registry mirror](https://docs.docker.com/build/ci/github-actions/configure-builder/#registry-mirror): Configure a registry mirror for your builds
|
||||||
This action builds images using [Buildx](https://github.com/docker/buildx) and
|
* [Max parallelism](https://docs.docker.com/build/ci/github-actions/configure-builder/#max-parallelism): Configure the maximum parallelism for your builds
|
||||||
[BuildKit](https://github.com/moby/buildkit). By default, the action will
|
* [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
|
||||||
attempt to use the latest version of Buildx available on the GitHub Runner
|
* [Authentication for remote builders](https://docs.docker.com/build/ci/github-actions/configure-builder/#authentication-for-remote-builders)
|
||||||
(the build client) and the latest release of BuildKit (the build server).
|
* [SSH authentication](https://docs.docker.com/build/ci/github-actions/configure-builder/#ssh-authentication): Authenticate to a remote builder using SSH
|
||||||
|
* [TLS authentication](https://docs.docker.com/build/ci/github-actions/configure-builder/#tls-authentication): Authenticate to a remote builder using TLS
|
||||||
To pin to a specific version of Buildx, use the `version` input. For example,
|
* [Standalone mode](https://docs.docker.com/build/ci/github-actions/configure-builder/#standalone-mode): Use Buildx as a standalone binary (without the Docker CLI)
|
||||||
to pin to Buildx v0.10.0:
|
* [Isolated builders](https://docs.docker.com/build/ci/github-actions/configure-builder/#isolated-builders): Create isolated builders for your builds
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
version: v0.10.0
|
|
||||||
```
|
|
||||||
|
|
||||||
To pin to a specific version of BuildKit, use the `image` option in the
|
|
||||||
`driver-opts` input. For example, to pin to BuildKit v0.11.0:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver-opts: image=moby/buildkit:v0.11.0
|
|
||||||
```
|
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
||||||
Following inputs can be used as `step.with` keys:
|
The following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
> `List` type is a newline-delimited string
|
> `List` type is a newline-delimited string
|
||||||
> ```yaml
|
> ```yaml
|
||||||
@@ -100,37 +80,46 @@ Following inputs can be used as `step.with` keys:
|
|||||||
> network=host
|
> network=host
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
> `CSV` type must be a newline-delimited string
|
> `CSV` type must be a comma-delimited string
|
||||||
> ```yaml
|
> ```yaml
|
||||||
> platforms: linux/amd64,linux/arm64
|
> platforms: linux/amd64,linux/arm64
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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`) |
|
| `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://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used (default `docker-container`) |
|
| `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-opts` | List | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
|
||||||
| `buildkitd-flags` | String | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon (since [buildx v0.3.0](https://github.com/docker/buildx/releases/tag/v0.3.0)) |
|
| `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`) |
|
||||||
| `install` | Bool | Sets up `docker build` command as an alias to `docker buildx` (default `false`) |
|
| `buildkitd-flags` | String | | [BuildKit daemon flags](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) |
|
||||||
| `use` | Bool | Switch to this builder instance (default `true`) |
|
| `buildkitd-config` \* | String | | [BuildKit daemon config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
||||||
| `endpoint` | String | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
| `buildkitd-config-inline` \* | String | | Same as `buildkitd-config` but inline |
|
||||||
| `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. |
|
| `use` | Bool | `true` | Switch to this builder instance |
|
||||||
| `config`¹ | String | [BuildKit config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
||||||
| `config-inline`¹ | String | Same as `config` but inline |
|
| `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](docs/advanced/append-nodes.md) to the builder |
|
| `append` | YAML | | [Append additional nodes](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder) to the builder |
|
||||||
|
| `keep-state` | Bool | `false` | Keep BuildKit state on `cleanup`. This is only useful on persistent self-hosted runners |
|
||||||
|
| `cache-binary` | Bool | `true` | Cache buildx binary to GitHub Actions cache backend |
|
||||||
|
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |
|
||||||
|
|
||||||
> * ¹ `config` and `config-inline` are mutually exclusive
|
> [!IMPORTANT]
|
||||||
|
> If you set the `buildkitd-flags` input, the default flags (`--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host`)
|
||||||
|
> will be reset. If you want to retain the default behavior, make sure to
|
||||||
|
> include these flags in your custom `buildkitd-flags` value.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> `buildkitd-config` and `buildkitd-config-inline` are mutually exclusive.
|
||||||
|
|
||||||
### outputs
|
### 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 |
|
||||||
| `platforms` | String | Builder node platforms (preferred or available) |
|
| `platforms` | String | Builder node platforms (preferred and/or available) |
|
||||||
| `nodes` | JSON | Builder [nodes metadata](#nodes-output) |
|
| `nodes` | JSON | Builder [nodes metadata](#nodes-output) |
|
||||||
|
|
||||||
### environment variables
|
### environment variables
|
||||||
|
|
||||||
@@ -171,39 +160,6 @@ The following [official docker environment variables](https://docs.docker.com/en
|
|||||||
| `buildkit` | String | BuildKit version |
|
| `buildkit` | String | BuildKit version |
|
||||||
| `platforms` | String | Platforms available |
|
| `platforms` | String | Platforms available |
|
||||||
|
|
||||||
### BuildKit container logs
|
|
||||||
|
|
||||||
See https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs
|
|
||||||
|
|
||||||
## Using on GHES
|
|
||||||
|
|
||||||
GitHub Runners come [pre-installed with Docker Buildx](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md)
|
|
||||||
following your virtual environment. If you specify a version or `latest` of
|
|
||||||
Docker Buildx in your workflow, the version will be downloaded from [GitHub Releases in `docker/buildx`](https://github.com/docker/buildx/releases)
|
|
||||||
repository. These calls to `docker/buildx` are made via unauthenticated requests,
|
|
||||||
which are limited to [60 requests per hour per IP](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting).
|
|
||||||
|
|
||||||
If more requests are made within the time frame, then you will start to see
|
|
||||||
rate-limit errors during downloading that looks like:
|
|
||||||
|
|
||||||
```
|
|
||||||
##[error]API rate limit exceeded for...
|
|
||||||
```
|
|
||||||
|
|
||||||
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new)
|
|
||||||
and pass it as the `github_token` input for the action:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GH_DOTCOM_TOKEN }}
|
|
||||||
version: v0.10.1
|
|
||||||
```
|
|
||||||
|
|
||||||
If the runner is not able to access `github.com`, it will take the default one
|
|
||||||
available on the GitHub Runner or runner's tool cache. See "[Setting up the tool cache on self-hosted runners without internet access](https://docs.github.com/en/enterprise-server@3.2/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)"
|
|
||||||
for more information.
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Want to contribute? Awesome! You can find information about contributing to
|
Want to contribute? Awesome! You can find information about contributing to
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
import {describe, expect, test, beforeEach} from '@jest/globals';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as os from 'os';
|
|
||||||
import * as path from 'path';
|
|
||||||
import * as auth from '../src/auth';
|
|
||||||
|
|
||||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-jest')).split(path.sep).join(path.posix.sep);
|
|
||||||
const dockerConfigHome = path.join(tmpdir, '.docker');
|
|
||||||
const credsdir = path.join(dockerConfigHome, 'buildx', 'creds');
|
|
||||||
|
|
||||||
describe('setCredentials', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
process.env = Object.keys(process.env).reduce((object, key) => {
|
|
||||||
if (!key.startsWith(auth.envPrefix)) {
|
|
||||||
object[key] = process.env[key];
|
|
||||||
}
|
|
||||||
return object;
|
|
||||||
}, {});
|
|
||||||
});
|
|
||||||
|
|
||||||
// prettier-ignore
|
|
||||||
test.each([
|
|
||||||
[
|
|
||||||
'mycontext',
|
|
||||||
'docker-container',
|
|
||||||
{},
|
|
||||||
[],
|
|
||||||
[]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'docker-container://mycontainer',
|
|
||||||
'docker-container',
|
|
||||||
{},
|
|
||||||
[],
|
|
||||||
[]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'tcp://graviton2:1234',
|
|
||||||
'remote',
|
|
||||||
{},
|
|
||||||
[],
|
|
||||||
[]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'tcp://graviton2:1234',
|
|
||||||
'remote',
|
|
||||||
{
|
|
||||||
'BUILDER_NODE_0_AUTH_TLS_CACERT': 'foo',
|
|
||||||
'BUILDER_NODE_0_AUTH_TLS_CERT': 'foo',
|
|
||||||
'BUILDER_NODE_0_AUTH_TLS_KEY': 'foo'
|
|
||||||
},
|
|
||||||
[
|
|
||||||
path.join(credsdir, 'cacert_graviton2-1234.pem'),
|
|
||||||
path.join(credsdir, 'cert_graviton2-1234.pem'),
|
|
||||||
path.join(credsdir, 'key_graviton2-1234.pem')
|
|
||||||
],
|
|
||||||
[
|
|
||||||
`cacert=${path.join(credsdir, 'cacert_graviton2-1234.pem')}`,
|
|
||||||
`cert=${path.join(credsdir, 'cert_graviton2-1234.pem')}`,
|
|
||||||
`key=${path.join(credsdir, 'key_graviton2-1234.pem')}`
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'tcp://graviton2:1234',
|
|
||||||
'docker-container',
|
|
||||||
{
|
|
||||||
'BUILDER_NODE_0_AUTH_TLS_CACERT': 'foo',
|
|
||||||
'BUILDER_NODE_0_AUTH_TLS_CERT': 'foo',
|
|
||||||
'BUILDER_NODE_0_AUTH_TLS_KEY': 'foo'
|
|
||||||
},
|
|
||||||
[
|
|
||||||
path.join(credsdir, 'cacert_graviton2-1234.pem'),
|
|
||||||
path.join(credsdir, 'cert_graviton2-1234.pem'),
|
|
||||||
path.join(credsdir, 'key_graviton2-1234.pem')
|
|
||||||
],
|
|
||||||
[]
|
|
||||||
],
|
|
||||||
])('given %p endpoint', async (endpoint: string, driver: string, envs: Record<string, string>, expectedFiles: Array<string>, expectedOpts: Array<string>) => {
|
|
||||||
fs.mkdirSync(credsdir, {recursive: true});
|
|
||||||
for (const [key, value] of Object.entries(envs)) {
|
|
||||||
process.env[key] = value;
|
|
||||||
}
|
|
||||||
expect(auth.setCredentials(credsdir, 0, driver, endpoint)).toEqual(expectedOpts);
|
|
||||||
expectedFiles.forEach( (file) => {
|
|
||||||
expect(fs.existsSync(file)).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,261 +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 tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-')).split(path.sep).join(path.posix.sep);
|
|
||||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
|
||||||
return tmpdir;
|
|
||||||
});
|
|
||||||
|
|
||||||
const tmpname = path.join(tmpdir, '.tmpname').split(path.sep).join(path.posix.sep);
|
|
||||||
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
|
|
||||||
return tmpname;
|
|
||||||
});
|
|
||||||
|
|
||||||
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.nodes).not.toEqual({});
|
|
||||||
}, 100000);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('parseInspect', () => {
|
|
||||||
// prettier-ignore
|
|
||||||
test.each([
|
|
||||||
[
|
|
||||||
'inspect1.txt',
|
|
||||||
{
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"name": "builder-5cb467f7-0940-47e1-b94b-d51f54054d620",
|
|
||||||
"endpoint": "unix:///var/run/docker.sock",
|
|
||||||
"status": "running",
|
|
||||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
|
||||||
"buildkit": "v0.10.4",
|
|
||||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/arm64,linux/riscv64,linux/386,linux/arm/v7,linux/arm/v6"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "builder-5cb467f7-0940-47e1-b94b-d51f54054d62",
|
|
||||||
"driver": "docker-container"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'inspect2.txt',
|
|
||||||
{
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"name": "builder-5f449644-ff29-48af-8344-abb0292d06730",
|
|
||||||
"endpoint": "unix:///var/run/docker.sock",
|
|
||||||
"driver-opts": [
|
|
||||||
"image=moby/buildkit:latest"
|
|
||||||
],
|
|
||||||
"status": "running",
|
|
||||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
|
||||||
"buildkit": "v0.10.4",
|
|
||||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4,linux/386"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "builder-5f449644-ff29-48af-8344-abb0292d0673",
|
|
||||||
"driver": "docker-container"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'inspect3.txt',
|
|
||||||
{
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"name": "builder-9929e463-7954-4dc3-89cd-514cca29ff800",
|
|
||||||
"endpoint": "unix:///var/run/docker.sock",
|
|
||||||
"driver-opts": [
|
|
||||||
"image=moby/buildkit:master",
|
|
||||||
"network=host"
|
|
||||||
],
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "builder-9929e463-7954-4dc3-89cd-514cca29ff80",
|
|
||||||
"driver": "docker-container"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'inspect4.txt',
|
|
||||||
{
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"name": "default",
|
|
||||||
"endpoint": "default",
|
|
||||||
"status": "running",
|
|
||||||
"buildkit": "20.10.17",
|
|
||||||
"platforms": "linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "default",
|
|
||||||
"driver": "docker"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'inspect5.txt',
|
|
||||||
{
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"name": "aws_graviton2",
|
|
||||||
"endpoint": "tcp://1.23.45.67:1234",
|
|
||||||
"driver-opts": [
|
|
||||||
"cert=/home/user/.certs/aws_graviton2/cert.pem",
|
|
||||||
"key=/home/user/.certs/aws_graviton2/key.pem",
|
|
||||||
"cacert=/home/user/.certs/aws_graviton2/ca.pem"
|
|
||||||
],
|
|
||||||
"status": "running",
|
|
||||||
"platforms": "darwin/arm64,linux/arm64,linux/arm/v5,linux/arm/v6,linux/arm/v7,windows/arm64"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "remote-builder",
|
|
||||||
"driver": "remote"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'inspect6.txt',
|
|
||||||
{
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"name": "builder-17cfff01-48d9-4c3d-9332-9992e308a5100",
|
|
||||||
"endpoint": "unix:///var/run/docker.sock",
|
|
||||||
"status": "running",
|
|
||||||
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
|
||||||
"platforms": "linux/amd64,linux/amd64/v2,linux/amd64/v3,linux/386"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"name": "builder-17cfff01-48d9-4c3d-9332-9992e308a510",
|
|
||||||
"driver": "docker-container"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
])('given %p', async (inspectFile, expected) => {
|
|
||||||
expect(await buildx.parseInspect(fs.readFileSync(path.join(__dirname, 'fixtures', inspectFile)).toString())).toEqual(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
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, process.env.GITHUB_TOKEN || '', 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(tmpname);
|
|
||||||
const configValue = fs.readFileSync(tmpname, 'utf-8');
|
|
||||||
expect(configValue).toEqual(exValue);
|
|
||||||
} catch (err) {
|
|
||||||
// eslint-disable-next-line jest/no-conditional-expect
|
|
||||||
expect(true).toBe(invalid);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
+313
-90
@@ -1,22 +1,42 @@
|
|||||||
import {beforeEach, describe, expect, it, jest, test} 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 uuid from 'uuid';
|
|
||||||
import * as context from '../src/context';
|
|
||||||
import * as nodes from '../src/nodes';
|
|
||||||
|
|
||||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-')).split(path.sep).join(path.posix.sep);
|
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx.js';
|
||||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
import {Context} from '@docker/actions-toolkit/lib/context.js';
|
||||||
return tmpdir;
|
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)) {
|
||||||
|
fs.mkdirSync(tmpDir, {recursive: true});
|
||||||
|
}
|
||||||
|
return tmpDir;
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
|
vi.spyOn(Context, 'tmpName').mockImplementation((): string => {
|
||||||
return path.join(tmpdir, '.tmpname').split(path.sep).join(path.posix.sep);
|
return tmpName;
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('uuid');
|
vi.mock('crypto', async () => {
|
||||||
jest.spyOn(uuid, 'v4').mockReturnValue('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');
|
return {
|
||||||
|
...(await vi.importActual('crypto')),
|
||||||
|
randomUUID: vi.fn(() => '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d')
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
vi.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
|
||||||
|
return Promise.resolve('default');
|
||||||
|
});
|
||||||
|
|
||||||
describe('getCreateArgs', () => {
|
describe('getCreateArgs', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -32,9 +52,12 @@ describe('getCreateArgs', () => {
|
|||||||
test.each([
|
test.each([
|
||||||
[
|
[
|
||||||
0,
|
0,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -46,10 +69,13 @@ describe('getCreateArgs', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
1,
|
1,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['driver', 'docker'],
|
['driver', 'docker'],
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -61,10 +87,13 @@ describe('getCreateArgs', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
2,
|
2,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['driver-opts', 'image=moby/buildkit:master\nnetwork=host'],
|
['driver-opts', 'image=moby/buildkit:master\nnetwork=host'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -77,11 +106,14 @@ describe('getCreateArgs', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
3,
|
3,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['driver', 'remote'],
|
['driver', 'remote'],
|
||||||
['endpoint', 'tls://foo:1234'],
|
['endpoint', 'tls://foo:1234'],
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -93,12 +125,15 @@ describe('getCreateArgs', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
4,
|
4,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['driver', 'remote'],
|
['driver', 'remote'],
|
||||||
['platforms', 'linux/arm64,linux/arm/v7'],
|
['platforms', 'linux/arm64,linux/arm/v7'],
|
||||||
['endpoint', 'tls://foo:1234'],
|
['endpoint', 'tls://foo:1234'],
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -111,10 +146,13 @@ describe('getCreateArgs', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
5,
|
5,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['driver-opts', `"env.no_proxy=localhost,127.0.0.1,.mydomain"`],
|
['driver-opts', `"env.no_proxy=localhost,127.0.0.1,.mydomain"`],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -126,10 +164,13 @@ describe('getCreateArgs', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
6,
|
6,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'false'],
|
['use', 'false'],
|
||||||
['platforms', 'linux/amd64\n"linux/arm64,linux/arm/v7"'],
|
['platforms', 'linux/amd64\n"linux/arm64,linux/arm/v7"'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false'],
|
||||||
]),
|
]),
|
||||||
[
|
[
|
||||||
'create',
|
'create',
|
||||||
@@ -139,14 +180,124 @@ describe('getCreateArgs', () => {
|
|||||||
'--platform', 'linux/amd64,linux/arm64,linux/arm/v7'
|
'--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 %p as inputs, returns %p',
|
'[%d] given buildx %o and %o as inputs, returns %o',
|
||||||
async (num: number, inputs: Map<string, string>, expected: Array<string>) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
||||||
inputs.forEach((value: string, name: string) => {
|
inputs.forEach((value: string, name: string) => {
|
||||||
setInput(name, value);
|
setInput(name, value);
|
||||||
});
|
});
|
||||||
|
const toolkit = new Toolkit();
|
||||||
|
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||||
|
return buildxVersion;
|
||||||
|
});
|
||||||
const inp = await context.getInputs();
|
const inp = await context.getInputs();
|
||||||
const res = await context.getCreateArgs(inp, '0.9.0');
|
const res = await context.getCreateArgs(inp, toolkit);
|
||||||
expect(res).toEqual(expected);
|
expect(res).toEqual(expected);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -166,9 +317,12 @@ describe('getAppendArgs', () => {
|
|||||||
test.each([
|
test.each([
|
||||||
[
|
[
|
||||||
0,
|
0,
|
||||||
|
'v0.10.3',
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['install', 'false'],
|
|
||||||
['use', 'true'],
|
['use', 'true'],
|
||||||
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
|
['keep-state', 'false']
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
"name": "aws_graviton2",
|
"name": "aws_graviton2",
|
||||||
@@ -191,85 +345,154 @@ describe('getAppendArgs', () => {
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
'[%d] given %p as inputs, returns %p',
|
'[%d] given buildx %o and %o as inputs, returns %o',
|
||||||
async (num: number, inputs: Map<string, string>, node: nodes.Node, expected: Array<string>) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, node: Node, expected: Array<string>) => {
|
||||||
inputs.forEach((value: string, name: string) => {
|
inputs.forEach((value: string, name: string) => {
|
||||||
setInput(name, value);
|
setInput(name, value);
|
||||||
});
|
});
|
||||||
|
const toolkit = new Toolkit();
|
||||||
|
vi.spyOn(Buildx.prototype, 'version').mockImplementation(async (): Promise<string> => {
|
||||||
|
return buildxVersion;
|
||||||
|
});
|
||||||
const inp = await context.getInputs();
|
const inp = await context.getInputs();
|
||||||
const res = await context.getAppendArgs(inp, node, '0.9.0');
|
const res = await context.getAppendArgs(inp, node, toolkit);
|
||||||
expect(res).toEqual(expected);
|
expect(res).toEqual(expected);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('getInputList', () => {
|
describe('getVersion', () => {
|
||||||
it('handles single line correctly', async () => {
|
beforeEach(() => {
|
||||||
await setInput('foo', 'bar');
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
const res = await context.getInputList('foo');
|
if (!key.startsWith('INPUT_')) {
|
||||||
expect(res).toEqual(['bar']);
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handles multiple lines correctly', async () => {
|
// prettier-ignore
|
||||||
setInput('foo', 'bar\nbaz');
|
test.each([
|
||||||
const res = await context.getInputList('foo');
|
[
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
0,
|
||||||
});
|
new Map<string, string>([
|
||||||
|
// defaults
|
||||||
it('remove empty lines correctly', async () => {
|
['use', 'true'],
|
||||||
setInput('foo', 'bar\n\nbaz');
|
['cache-binary', 'true'],
|
||||||
const res = await context.getInputList('foo');
|
['cleanup', 'true'],
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
['keep-state', 'false']
|
||||||
});
|
]),
|
||||||
|
''
|
||||||
it('handles comma correctly', async () => {
|
],
|
||||||
setInput('foo', 'bar,baz');
|
[
|
||||||
const res = await context.getInputList('foo');
|
1,
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
new Map<string, string>([
|
||||||
});
|
['version', 'latest'],
|
||||||
|
// defaults
|
||||||
it('remove empty result correctly', async () => {
|
['use', 'true'],
|
||||||
setInput('foo', 'bar,baz,');
|
['cache-binary', 'true'],
|
||||||
const res = await context.getInputList('foo');
|
['cleanup', 'true'],
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
['keep-state', 'false']
|
||||||
});
|
]),
|
||||||
|
'latest'
|
||||||
it('handles different new lines correctly', async () => {
|
],
|
||||||
setInput('foo', 'bar\r\nbaz');
|
[
|
||||||
const res = await context.getInputList('foo');
|
2,
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
new Map<string, string>([
|
||||||
});
|
['version', 'edge'],
|
||||||
|
// defaults
|
||||||
it('handles different new lines and comma correctly', async () => {
|
['use', 'true'],
|
||||||
setInput('foo', 'bar\r\nbaz,bat');
|
['cache-binary', 'true'],
|
||||||
const res = await context.getInputList('foo');
|
['cleanup', 'true'],
|
||||||
expect(res).toEqual(['bar', 'baz', 'bat']);
|
['keep-state', 'false']
|
||||||
});
|
]),
|
||||||
|
'edge'
|
||||||
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);
|
3,
|
||||||
expect(res).toEqual(['image=moby/buildkit:master', 'network=host']);
|
new Map<string, string>([
|
||||||
});
|
['version', 'v0.19.2'],
|
||||||
|
// defaults
|
||||||
it('handles different new lines and ignoring comma correctly', async () => {
|
['use', 'true'],
|
||||||
setInput('driver-opts', 'image=moby/buildkit:master\r\nnetwork=host');
|
['cache-binary', 'true'],
|
||||||
const res = await context.getInputList('driver-opts', true);
|
['cleanup', 'true'],
|
||||||
expect(res).toEqual(['image=moby/buildkit:master', 'network=host']);
|
['keep-state', 'false']
|
||||||
});
|
]),
|
||||||
});
|
'v0.19.2'
|
||||||
|
],
|
||||||
describe('asyncForEach', () => {
|
[
|
||||||
it('executes async tasks sequentially', async () => {
|
4,
|
||||||
const testValues = [1, 2, 3, 4, 5];
|
new Map<string, string>([
|
||||||
const results: number[] = [];
|
['version', 'latest'],
|
||||||
|
['driver', 'cloud'],
|
||||||
await context.asyncForEach(testValues, async value => {
|
// defaults
|
||||||
results.push(value);
|
['use', 'true'],
|
||||||
});
|
['cache-binary', 'true'],
|
||||||
|
['cleanup', 'true'],
|
||||||
expect(results).toEqual(testValues);
|
['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
|
||||||
|
|||||||
@@ -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,10 +0,0 @@
|
|||||||
Name: builder-5cb467f7-0940-47e1-b94b-d51f54054d62
|
|
||||||
Driver: docker-container
|
|
||||||
|
|
||||||
Nodes:
|
|
||||||
Name: builder-5cb467f7-0940-47e1-b94b-d51f54054d620
|
|
||||||
Endpoint: unix:///var/run/docker.sock
|
|
||||||
Status: running
|
|
||||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
|
||||||
Buildkit: v0.10.4
|
|
||||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/arm64, linux/riscv64, linux/386, linux/arm/v7, linux/arm/v6
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
Name: builder-5f449644-ff29-48af-8344-abb0292d0673
|
|
||||||
Driver: docker-container
|
|
||||||
|
|
||||||
Nodes:
|
|
||||||
Name: builder-5f449644-ff29-48af-8344-abb0292d06730
|
|
||||||
Endpoint: unix:///var/run/docker.sock
|
|
||||||
Driver Options: image="moby/buildkit:latest"
|
|
||||||
Status: running
|
|
||||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
|
||||||
Buildkit: v0.10.4
|
|
||||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
Name: builder-9929e463-7954-4dc3-89cd-514cca29ff80
|
|
||||||
Driver: docker-container
|
|
||||||
|
|
||||||
Nodes:
|
|
||||||
Name: builder-9929e463-7954-4dc3-89cd-514cca29ff800
|
|
||||||
Endpoint: unix:///var/run/docker.sock
|
|
||||||
Driver Options: image="moby/buildkit:master" network="host"
|
|
||||||
Status: running
|
|
||||||
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
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
Name: default
|
|
||||||
Driver: docker
|
|
||||||
|
|
||||||
Nodes:
|
|
||||||
Name: default
|
|
||||||
Endpoint: default
|
|
||||||
Status: running
|
|
||||||
Buildkit: 20.10.17
|
|
||||||
Platforms: linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
Name: remote-builder
|
|
||||||
Driver: remote
|
|
||||||
|
|
||||||
Nodes:
|
|
||||||
Name: aws_graviton2
|
|
||||||
Endpoint: tcp://1.23.45.67:1234
|
|
||||||
Driver Options: cert="/home/user/.certs/aws_graviton2/cert.pem" key="/home/user/.certs/aws_graviton2/key.pem" cacert="/home/user/.certs/aws_graviton2/ca.pem"
|
|
||||||
Status: running
|
|
||||||
Platforms: darwin/arm64*, linux/arm64*, linux/arm/v5*, linux/arm/v6*, linux/arm/v7*, windows/arm64*, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
Name: builder-17cfff01-48d9-4c3d-9332-9992e308a510
|
|
||||||
Driver: docker-container
|
|
||||||
|
|
||||||
Nodes:
|
|
||||||
Name: builder-17cfff01-48d9-4c3d-9332-9992e308a5100
|
|
||||||
Endpoint: unix:///var/run/docker.sock
|
|
||||||
Status: running
|
|
||||||
Flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
|
|
||||||
Platforms: linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
|
|
||||||
@@ -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,20 +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.getLatestRelease(process.env.GITHUB_TOKEN || '');
|
|
||||||
expect(release).not.toBeNull();
|
|
||||||
expect(release?.tag_name).not.toEqual('');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('returns v0.2.2 buildx GitHub release', async () => {
|
|
||||||
const release = await github.getReleaseTag('v0.2.2', process.env.GITHUB_TOKEN || '');
|
|
||||||
expect(release).not.toBeNull();
|
|
||||||
expect(release?.tag_name).toEqual('v0.2.2');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('unknown release', async () => {
|
|
||||||
await expect(github.getReleaseTag('foo', process.env.GITHUB_TOKEN || '')).rejects.toThrowError(new Error('Cannot get release foo: HttpError: Not Found'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -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);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
+22
-21
@@ -18,41 +18,42 @@ 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 build'
|
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
|
||||||
platforms:
|
platforms:
|
||||||
description: 'Fixed platforms for current node. If not empty, values take priority over the detected ones'
|
description: 'Fixed platforms for current node. If not empty, values take priority over the detected ones'
|
||||||
required: false
|
required: false
|
||||||
config:
|
|
||||||
description: 'BuildKit config file'
|
|
||||||
required: false
|
|
||||||
config-inline:
|
|
||||||
description: 'Inline BuildKit config'
|
|
||||||
required: false
|
|
||||||
append:
|
append:
|
||||||
description: 'Append additional nodes to the builder'
|
description: 'Append additional nodes to the builder'
|
||||||
required: false
|
required: false
|
||||||
github_token:
|
keep-state:
|
||||||
# https://github.com/actions/setup-go/blob/21459d0b7b1d63741429b748885bf5a4974593b4/action.yml#L12-L14
|
description: 'Keep BuildKit state on cleanup. This is only useful on persistent self-hosted runners.'
|
||||||
description: >
|
default: 'false'
|
||||||
Used to verifiy the Git tag exists on docker/buildx repo. Since there's a
|
required: false
|
||||||
default, this is typically not supplied by the user. When running this
|
cache-binary:
|
||||||
action on github.com, the default value is sufficient. When running on
|
description: 'Cache buildx binary to GitHub Actions cache backend'
|
||||||
GHES, you can pass a personal access token for github.com if you are
|
default: 'true'
|
||||||
experiencing rate limiting.
|
required: false
|
||||||
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
cleanup:
|
||||||
|
description: 'Cleanup temp files and remove builder at the end of a job'
|
||||||
|
default: 'true'
|
||||||
|
required: false
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
name:
|
name:
|
||||||
@@ -71,6 +72,6 @@ outputs:
|
|||||||
description: 'Builder node flags (deprecated, use nodes output instead)'
|
description: 'Builder node flags (deprecated, use nodes output instead)'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node24'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
post: 'dist/index.js'
|
post: 'dist/index.js'
|
||||||
+45
-35
@@ -1,15 +1,21 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG NODE_VERSION=16
|
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,62 +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 \
|
|
||||||
--mount=type=secret,id=GITHUB_TOKEN \
|
|
||||||
GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) 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
|
||||||
+43
-8
@@ -1,16 +1,51 @@
|
|||||||
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7351:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,a){if(a===undefined)a=r;e[a]=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))a(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const n=s(r(2037));const p=r(5278);function issueCommand(e,t,r){const a=new Command(e,t,r);process.stdout.write(a.toString()+n.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const o="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=o+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 a=this.properties[r];if(a){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(a)}`}}}}e+=`${o}${escapeData(this.message)}`;return e}}function escapeData(e){return p.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return p.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 a=this&&this.__createBinding||(Object.create?function(e,t,r,a){if(a===undefined)a=r;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,a){if(a===undefined)a=r;e[a]=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))a(t,e,r);i(t,e);return t};var n=this&&this.__awaiter||function(e,t,r,a){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(a.next(e))}catch(e){i(e)}}function rejected(e){try{step(a["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((a=a.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 p=r(7351);const o=r(717);const d=r(5278);const l=s(r(2037));const u=s(r(1017));const c=r(8041);var m;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(m=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=d.toCommandValue(t);process.env[e]=r;const a=process.env["GITHUB_ENV"]||"";if(a){return o.issueFileCommand("ENV",o.prepareKeyValueMessage(e,t))}p.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){p.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){o.issueFileCommand("PATH",e)}else{p.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${u.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!==""));if(t&&t.trimWhitespace===false){return r}return r.map((e=>e.trim()))}t.getMultilineInput=getMultilineInput;function getBooleanInput(e,t){const r=["true","True","TRUE"];const a=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(a.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){const r=process.env["GITHUB_OUTPUT"]||"";if(r){return o.issueFileCommand("OUTPUT",o.prepareKeyValueMessage(e,t))}process.stdout.write(l.EOL);p.issueCommand("set-output",{name:e},d.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){p.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=m.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDeLine 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
|
||||||
/*!
|
/**
|
||||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
* @preserve
|
||||||
|
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
||||||
* Released under the MIT License.
|
* @see http://github.com/homebrewing/brauhaus-diff
|
||||||
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,r;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;r=t.prototype;if(isObject(r)===false)return false;if(r.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},1917:(e,t,r)=>{"use strict";var a=r(1161);var i=r(8866);function renamed(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. "+"Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=r(6073);e.exports.Schema=r(1082);e.exports.FAILSAFE_SCHEMA=r(8562);e.exports.JSON_SCHEMA=r(1035);e.exports.CORE_SCHEMA=r(2011);e.exports.DEFAULT_SCHEMA=r(8759);e.exports.load=a.load;e.exports.loadAll=a.loadAll;e.exports.dump=i.dump;e.exports.YAMLException=r(8179);e.exports.types={binary:r(7900),float:r(2705),map:r(6150),null:r(721),pairs:r(6860),set:r(9548),timestamp:r(9212),bool:r(4993),int:r(1615),merge:r(6104),omap:r(9046),seq:r(7283),str:r(3619)};e.exports.safeLoad=renamed("safeLoad","load");e.exports.safeLoadAll=renamed("safeLoadAll","loadAll");e.exports.safeDump=renamed("safeDump","dump")},6829:e=>{"use strict";function isNothing(e){return typeof e==="undefined"||e===null}function isObject(e){return typeof e==="object"&&e!==null}function toArray(e){if(Array.isArray(e))return e;else if(isNothing(e))return[];return[e]}function extend(e,t){var r,a,i,s;if(t){s=Object.keys(t);for(r=0,a=s.length;r<a;r+=1){i=s[r];e[i]=t[i]}}return e}function repeat(e,t){var r="",a;for(a=0;a<t;a+=1){r+=e}return r}function isNegativeZero(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}e.exports.isNothing=isNothing;e.exports.isObject=isObject;e.exports.toArray=toArray;e.exports.repeat=repeat;e.exports.isNegativeZero=isNegativeZero;e.exports.extend=extend},8866:(e,t,r)=>{"use strict";var a=r(6829);var i=r(8179);var s=r(8759);var n=Object.prototype.toString;var p=Object.prototype.hasOwnProperty;var o=65279;var d=9;var l=10;var u=13;var c=32;var m=33;var h=34;var v=35;var g=37;var w=38;var _=39;var E=42;var b=44;var y=45;var T=58;var S=61;var O=62;var A=63;var N=64;var R=91;var D=93;var P=96;var k=123;var C=124;var I=125;var x={};x[0]="\\0";x[7]="\\a";x[8]="\\b";x[9]="\\t";x[10]="\\n";x[11]="\\v";x[12]="\\f";x[13]="\\r";x[27]="\\e";x[34]='\\"';x[92]="\\\\";x[133]="\\N";x[160]="\\_";x[8232]="\\L";x[8233]="\\P";var L=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];var G=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(e,t){var r,a,i,s,n,o,d;if(t===null)return{};r={};a=Object.keys(t);for(i=0,s=a.length;i<s;i+=1){n=a[i];o=String(t[n]);if(n.slice(0,2)==="!!"){n="tag:yaml.org,2002:"+n.slice(2)}d=e.compiledTypeMap["fallback"][n];if(d&&p.call(d.styleAliases,o)){o=d.styleAliases[o]}r[n]=o}return r}function encodeHex(e){var t,r,s;t=e.toString(16).toUpperCase();if(e<=255){r="x";s=2}else if(e<=65535){r="u";s=4}else if(e<=4294967295){r="U";s=8}else{throw new i("code point within a string may not be greater than 0xFFFFFFFF")}return"\\"+r+a.repeat("0",s-t.length)+t}var F=1,j=2;function State(e){this.schema=e["schema"]||s;this.indent=Math.max(1,e["indent"]||2);this.noArrayIndent=e["noArrayIndent"]||false;this.skipInvalid=e["skipInvalid"]||false;this.flowLevel=a.isNothing(e["flowLevel"])?-1:e["flowLevel"];this.styleMap=compileStyleMap(this.schema,e["styles"]||null);this.sortKeys=e["sortKeys"]||false;this.lineWidth=e["lineWidth"]||80;this.noRefs=e["noRefs"]||false;this.noCompatMode=e["noCompatMode"]||false;this.condenseFlow=e["condenseFlow"]||false;this.quotingType=e["quotingType"]==='"'?j:F;this.forceQuotes=e["forceQuotes"]||false;this.replacer=typeof e["replacer"]==="function"?e["replacer"]:null;this.implicitTypes=this.schema.compiledImplicit;this.explicitTypes=this.schema.compiledExplicit;this.tag=null;this.result="";this.duplicates=[];this.usedDuplicates=null}function indentString(e,t){var r=a.repeat(" ",t),i=0,s=-1,n="",p,o=e.length;while(i<o){s=e.indexOf("\n",i);if(s===-1){p=e.slice(i);i=o}else{p=e.slice(i,s+1);i=s+1}if(p.length&&p!=="\n")n+=r;n+=p}return n}function generateNextLine(e,t){return"\n"+a.repeat(" ",e.indent*t)}function testImplicitResolving(e,t){var r,a,i;for(r=0,a=e.implicitTypes.length;r<a;r+=1){i=e.implicitTypes[r];if(i.resolve(t)){return true}}return false}function isWhitespace(e){return e===c||e===d}function isPrintable(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==o||65536<=e&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==o&&e!==u&&e!==l}function isPlainSafe(e,t,r){var a=isNsCharOrWhitespace(e);var i=a&&!isWhitespace(e);return(r?a:a&&e!==b&&e!==R&&e!==D&&e!==k&&e!==I)&&e!==v&&!(t===T&&!i)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===v||t===T&&i}function isPlainSafeFirst(e){return isPrintable(e)&&e!==o&&!isWhitespace(e)&&e!==y&&e!==A&&e!==T&&e!==b&&e!==R&&e!==D&&e!==k&&e!==I&&e!==v&&e!==w&&e!==E&&e!==m&&e!==C&&e!==S&&e!==O&&e!=Line truncated
|
* @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 a=r(7147);const i=r(2037);const s=r(1017);const n=r(6113);const p={fs:a.constants,os:i.constants};const o=r(4959);const d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,u=3,c=(p.O_CREAT||p.fs.O_CREAT)|(p.O_EXCL||p.fs.O_EXCL)|(p.O_RDWR||p.fs.O_RDWR),m=i.platform()==="win32",h=p.EBADF||p.os.errno.EBADF,v=p.ENOENT||p.os.errno.ENOENT,g=448,w=384,_="exit",E=[],b=a.rmdirSync.bind(a),y=o.sync;let T=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 n=i.tries;(function _getUniqueName(){try{const e=_generateTmpName(i);a.stat(e,(function(t){if(!t){if(n-- >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{a.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);a.open(t,c,i.mode||w,(function _fileCreated(e,r){if(e)return s(e);if(i.discardDescriptor){return a.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 n=a.openSync(s,c,r.mode||w);if(r.discardDescriptor){a.closeSync(n);n=undefined}return{name:s,fd:n,removeCallback:_prepareTmpFileRemoveCallback(s,i?-1:n,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);a.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);a.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])a.close(e[0],(function(){a.unlink(e[1],_handler)}));else a.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])a.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{a.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,a){const i=_prepareRemoveCallback(_removeFileSync,[t,e],a);const s=_prepareRemoveCallback(_removeFileAsync,[t,e],a,i);if(!r.keep)E.unshift(i);return a?i:s}function _prepareTmpDirRemoveCallback(e,t,r){const i=t.unsafeCleanup?o:a.rmdir.bind(a);const s=t.unsafeCleanup?y:b;const n=_prepareRemoveCallback(s,e,r);const p=_prepareRemoveCallback(i,e,r,n);if(!t.keep)E.unshift(n);return r?n:p}function _prepareRemoveCallback(e,t,r,a){let i=false;return function _cleanupCallback(s){if(!i){const n=a||_cleanupCallback;const p=E.indexOf(n);if(p>=0)E.splice(p,1);i=true;if(r||e===b||e===y){return e(t)}else{return e(t,s||function(){})}}}}function _garbageCollector(){if(!T)return;while(E.length){try{E[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=n.randomBytes(e)}catch(t){r=n.pseudoRandomBytes(e)}for(var a=0;a<e;a++){t.push(d[r[a]%d.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(l,_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(l))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||u: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/path-utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/summary.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/lib/utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/md5.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/nil.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/parse.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/regex.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/rng.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/sha1.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/stringify.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v1.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v3.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v35.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v4.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/v5.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/validate.js","../webpack:/docker-setup-buildx/node_modules/@actions/core/node_modules/uuid/dist/version.js","../webpack:/docker-setup-buildx/node_modules/@actions/exec/lib/exec.js","../webpack:/docker-setup-buildx/node_modules/@actions/exec/lib/toolrunner.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/context.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/github.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/github/lib/utils.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/lib/auth.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/lib/index.js","../webpack:/docker-setup-buildx/node_modules/@actions/http-client/lib/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/@octokit/auth-token/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/core/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/endpoint/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/graphql/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/request-error/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/@octokit/request/dist-node/index.js","../webpack:/docker-setup-buildx/node_modules/balanced-match/index.js","../webpack:/docker-setup-buildx/node_modules/before-after-hook/index.js","../webpack:/docker-setup-buildx/node_modules/before-after-hook/lib/add.js","../webpack:/docker-setup-buildx/node_modules/before-after-hook/lib/register.js","../webpack:/docker-setup-buildx/node_modules/before-after-hook/lib/remove.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/deprecation/dist-node/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"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
-1040
File diff suppressed because it is too large.
Load diff
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
(()=>{var e={296:e=>{var r=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},599:(e,r,n)=>{e=n.nmd(e);var t=n(927).SourceMapConsumer;var o=n(928);var i;try{i=n(896);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(296);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var d=[];var h=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n<e.length;n++){var t=e[n](r);if(t){return t}}return null}}var m=handlerExec(d);d.push((function(e){e=e.trim();if(/^file:/.test(e)){e=e.replace(/file:\/\/\/(\w:)?/,(function(e,r){return r?"":"/"}))}if(e in p){return p[e]}var r="";try{if(!i){var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);if(n.readyState===4&&n.status===200){r=n.responseText}}else if(i.existsSync(e)){r=i.readFileSync(e,"utf8")}}catch(e){}return p[e]=r}));function supportRelativeURL(e,r){if(!e)return r;var n=o.dirname(e);var t=/^\w+:\/\/[^\/]*/.exec(n);var i=t?t[0]:"";var a=n.slice(i.length);if(i&&/^\/\w\:/.test(a)){i+="/";return i+o.resolve(n.slice(i.length),r).replace(/\\/g,"/")}return i+o.resolve(n.slice(i.length),r)}function retrieveSourceMapURL(e){var r;if(isInBrowser()){try{var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);r=n.readyState===4?n.responseText:null;var t=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(t){return t}}catch(e){}}r=m(e);var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;var i,a;while(a=o.exec(r))i=a;if(!i)return null;return i[1]}var v=handlerExec(h);h.push((function(e){var r=retrieveSourceMapURL(e);if(!r)return null;var n;if(g.test(r)){var t=r.slice(r.indexOf(",")+1);n=a(t,"base64").toString();r=e}else{r=supportRelativeURL(e,r);n=m(r)}if(!n){return null}return{url:r,map:n}}));function mapSourcePosition(e){var r=f[e.source];if(!r){var n=v(e.source);if(n){r=f[e.source]={url:n.url,map:new t(n.map)};if(r.map.sourcesContent){r.map.sources.forEach((function(e,n){var t=r.map.sourcesContent[n];if(t){var o=supportRelativeURL(r.url,e);p[o]=t}}))}}else{r=f[e.source]={url:null,map:null}}}if(r&&r.map&&typeof r.map.originalPositionFor==="function"){var o=r.map.originalPositionFor(e);if(o.source!==null){o.source=supportRelativeURL(r.url,o.source);return o}}return e}function mapEvalOrigin(e){var r=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);if(r){var n=mapSourcePosition({source:r[2],line:+r[3],column:r[4]-1});return"eval at "+r[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}r=/^eval at ([^(]+) \((.+)\)$/.exec(e);if(r){return"eval at "+r[1]+" ("+mapEvalOrigin(r[2])+")"}return e}function CallSiteToString(){var e;var r="";if(this.isNative()){r="native"}else{e=this.getScriptNameOrSourceURL();if(!e&&this.isEval()){r=this.getEvalOrigin();r+=", "}if(e){r+=e}else{r+="<anonymous>"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"<anonymous>")}}else if(u){o+="new "+(i||"<aLine truncated
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},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
-3
@@ -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,44 +17,50 @@ 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"]
|
||||||
secret = ["id=GITHUB_TOKEN,env=GITHUB_TOKEN"]
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Append additional nodes to the builder
|
|
||||||
|
|
||||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder)
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Authentication support
|
|
||||||
|
|
||||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#authentication-for-remote-builders)
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# BuildKit daemon configuration
|
|
||||||
|
|
||||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#daemon-configuration)
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# Standalone mode
|
|
||||||
|
|
||||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/github-actions/configure-builder/#standalone-mode)
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import {defineConfig} from 'eslint/config';
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||||
|
import vitest from '@vitest/eslint-plugin';
|
||||||
|
import globals from 'globals';
|
||||||
|
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
||||||
|
import eslintPluginPrettier from 'eslint-plugin-prettier';
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{
|
||||||
|
ignores: ['.yarn/**/*', 'coverage/**/*', 'dist/**/*']
|
||||||
|
},
|
||||||
|
js.configs.recommended,
|
||||||
|
...tseslint.configs['flat/recommended'],
|
||||||
|
eslintConfigPrettier,
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['__tests__/**'],
|
||||||
|
...vitest.configs.recommended,
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.node,
|
||||||
|
...vitest.environments.env.globals
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...vitest.configs.recommended.rules,
|
||||||
|
'vitest/no-conditional-expect': 'error',
|
||||||
|
'vitest/no-disabled-tests': 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
prettier: eslintPluginPrettier
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'prettier/prettier': 'error',
|
||||||
|
'@typescript-eslint/no-require-imports': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowAsImport: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
clearMocks: true,
|
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
|
||||||
setupFiles: ['dotenv/config'],
|
|
||||||
testMatch: ['**/*.test.ts'],
|
|
||||||
transform: {
|
|
||||||
'^.+\\.ts$': 'ts-jest'
|
|
||||||
},
|
|
||||||
moduleNameMapper: {
|
|
||||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
|
||||||
},
|
|
||||||
verbose: true
|
|
||||||
};
|
|
||||||
+26
-38
@@ -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,41 +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.10.0",
|
"@actions/core": "^3.0.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@docker/actions-toolkit": "^0.79.0",
|
||||||
"@actions/github": "^5.1.1",
|
"js-yaml": "^4.1.1"
|
||||||
"@actions/tool-cache": "^2.0.1",
|
|
||||||
"csv-parse": "^5.3.3",
|
|
||||||
"js-yaml": "^4.1.0",
|
|
||||||
"semver": "^7.3.7",
|
|
||||||
"tmp": "^0.2.1",
|
|
||||||
"uuid": "^9.0.0"
|
|
||||||
},
|
},
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-51
@@ -1,51 +0,0 @@
|
|||||||
import * as fs from 'fs';
|
|
||||||
|
|
||||||
export const envPrefix = 'BUILDER_NODE';
|
|
||||||
|
|
||||||
export function setCredentials(credsdir: string, index: number, driver: string, endpoint: string): Array<string> {
|
|
||||||
let url: URL;
|
|
||||||
try {
|
|
||||||
url = new URL(endpoint);
|
|
||||||
} catch (e) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
switch (url.protocol) {
|
|
||||||
case 'tcp:': {
|
|
||||||
return setBuildKitClientCerts(credsdir, index, driver, url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
function setBuildKitClientCerts(credsdir: string, index: number, driver: string, endpoint: URL): Array<string> {
|
|
||||||
const driverOpts: Array<string> = [];
|
|
||||||
const buildkitCacert = process.env[`${envPrefix}_${index}_AUTH_TLS_CACERT`] || '';
|
|
||||||
const buildkitCert = process.env[`${envPrefix}_${index}_AUTH_TLS_CERT`] || '';
|
|
||||||
const buildkitKey = process.env[`${envPrefix}_${index}_AUTH_TLS_KEY`] || '';
|
|
||||||
if (buildkitCacert.length == 0 && buildkitCert.length == 0 && buildkitKey.length == 0) {
|
|
||||||
return driverOpts;
|
|
||||||
}
|
|
||||||
let host = endpoint.hostname;
|
|
||||||
if (endpoint.port.length > 0) {
|
|
||||||
host += `-${endpoint.port}`;
|
|
||||||
}
|
|
||||||
if (buildkitCacert.length > 0) {
|
|
||||||
const cacertpath = `${credsdir}/cacert_${host}.pem`;
|
|
||||||
fs.writeFileSync(cacertpath, buildkitCacert);
|
|
||||||
driverOpts.push(`cacert=${cacertpath}`);
|
|
||||||
}
|
|
||||||
if (buildkitCert.length > 0) {
|
|
||||||
const certpath = `${credsdir}/cert_${host}.pem`;
|
|
||||||
fs.writeFileSync(certpath, buildkitCert);
|
|
||||||
driverOpts.push(`cert=${certpath}`);
|
|
||||||
}
|
|
||||||
if (buildkitKey.length > 0) {
|
|
||||||
const keypath = `${credsdir}/key_${host}.pem`;
|
|
||||||
fs.writeFileSync(keypath, buildkitKey);
|
|
||||||
driverOpts.push(`key=${keypath}`);
|
|
||||||
}
|
|
||||||
if (driver != 'remote') {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return driverOpts;
|
|
||||||
}
|
|
||||||
-380
@@ -1,380 +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;
|
|
||||||
nodes: Node[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Node = {
|
|
||||||
name?: string;
|
|
||||||
endpoint?: string;
|
|
||||||
'driver-opts'?: Array<string>;
|
|
||||||
status?: string;
|
|
||||||
'buildkitd-flags'?: string;
|
|
||||||
buildkit?: string;
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
return parseInspect(res.stdout);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function parseInspect(data: string): Promise<Builder> {
|
|
||||||
const builder: Builder = {
|
|
||||||
nodes: []
|
|
||||||
};
|
|
||||||
let node: Node = {};
|
|
||||||
for (const line of data.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.toLowerCase()) {
|
|
||||||
case 'name': {
|
|
||||||
if (builder.name == undefined) {
|
|
||||||
builder.name = value;
|
|
||||||
} else {
|
|
||||||
if (Object.keys(node).length > 0) {
|
|
||||||
builder.nodes.push(node);
|
|
||||||
node = {};
|
|
||||||
}
|
|
||||||
node.name = value;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'driver': {
|
|
||||||
builder.driver = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'endpoint': {
|
|
||||||
node.endpoint = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'driver options': {
|
|
||||||
node['driver-opts'] = (value.match(/(\w+)="([^"]*)"/g) || []).map(v => v.replace(/^(.*)="(.*)"$/g, '$1=$2'));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'status': {
|
|
||||||
node.status = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'flags': {
|
|
||||||
node['buildkitd-flags'] = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'buildkit': {
|
|
||||||
node.buildkit = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'platforms': {
|
|
||||||
let platforms: Array<string> = [];
|
|
||||||
// if a preferred platform is being set then use only these
|
|
||||||
// https://docs.docker.com/engine/reference/commandline/buildx_inspect/#get-information-about-a-builder-instance
|
|
||||||
if (value.includes('*')) {
|
|
||||||
for (const platform of value.split(', ')) {
|
|
||||||
if (platform.includes('*')) {
|
|
||||||
platforms.push(platform.replace('*', ''));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// otherwise set all platforms available
|
|
||||||
platforms = value.split(', ');
|
|
||||||
}
|
|
||||||
node.platforms = platforms.join(',');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (Object.keys(node).length > 0) {
|
|
||||||
builder.nodes.push(node);
|
|
||||||
}
|
|
||||||
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, githubToken: string, dest: string, standalone: boolean): Promise<string> {
|
|
||||||
let release: github.Release;
|
|
||||||
if (inputVersion == 'latest') {
|
|
||||||
release = await github.getLatestRelease(githubToken);
|
|
||||||
} else {
|
|
||||||
release = await github.getReleaseTag(inputVersion, githubToken);
|
|
||||||
}
|
|
||||||
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]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
+57
-83
@@ -1,27 +1,14 @@
|
|||||||
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 uuid from 'uuid';
|
|
||||||
import {parse} from 'csv-parse/sync';
|
|
||||||
import * as buildx from './buildx';
|
|
||||||
import * as nodes from './nodes';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
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;
|
||||||
@@ -29,46 +16,50 @@ export interface Inputs {
|
|||||||
driver: string;
|
driver: string;
|
||||||
driverOpts: string[];
|
driverOpts: string[];
|
||||||
buildkitdFlags: string;
|
buildkitdFlags: string;
|
||||||
|
buildkitdConfig: string;
|
||||||
|
buildkitdConfigInline: string;
|
||||||
platforms: string[];
|
platforms: string[];
|
||||||
install: boolean;
|
|
||||||
use: boolean;
|
use: boolean;
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
config: string;
|
|
||||||
configInline: string;
|
|
||||||
append: string;
|
append: string;
|
||||||
githubToken: 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: getBuilderName(core.getInput('driver') || 'docker-container'),
|
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'),
|
||||||
platforms: await getInputList('platforms', false, true),
|
platforms: Util.getInputList('platforms'),
|
||||||
install: core.getBooleanInput('install'),
|
|
||||||
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'),
|
append: core.getInput('append'),
|
||||||
githubToken: core.getInput('github_token')
|
keepState: core.getBooleanInput('keep-state'),
|
||||||
|
cacheBinary: core.getBooleanInput('cache-binary'),
|
||||||
|
cleanup: core.getBooleanInput('cleanup')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBuilderName(driver: string): string {
|
export async function getBuilderName(name: string, driver: string): Promise<string> {
|
||||||
return driver == 'docker' ? 'default' : `builder-${uuid.v4()}`;
|
return driver == 'docker' ? await Docker.context() : name || `builder-${crypto.randomUUID()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getCreateArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
|
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
|
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
|
||||||
if (buildx.satisfies(buildxVersion, '>=0.3.0')) {
|
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
|
||||||
await asyncForEach(inputs.driverOpts, async driverOpt => {
|
await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => {
|
||||||
args.push('--driver-opt', driverOpt);
|
args.push('--driver-opt', driverOpt);
|
||||||
});
|
});
|
||||||
if (inputs.driver != 'remote' && inputs.buildkitdFlags) {
|
if (inputs.buildkitdFlags) {
|
||||||
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
||||||
|
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||||
|
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inputs.platforms.length > 0) {
|
if (inputs.platforms.length > 0) {
|
||||||
@@ -77,12 +68,10 @@ export async function getCreateArgs(inputs: Inputs, buildxVersion: string): Prom
|
|||||||
if (inputs.use) {
|
if (inputs.use) {
|
||||||
args.push('--use');
|
args.push('--use');
|
||||||
}
|
}
|
||||||
if (inputs.driver != 'remote') {
|
if (inputs.buildkitdConfig) {
|
||||||
if (inputs.config) {
|
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.buildkitdConfig));
|
||||||
args.push('--config', await buildx.getConfigFile(inputs.config));
|
} else if (inputs.buildkitdConfigInline) {
|
||||||
} else if (inputs.configInline) {
|
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.buildkitdConfigInline));
|
||||||
args.push('--config', await buildx.getConfigInline(inputs.configInline));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (inputs.endpoint) {
|
if (inputs.endpoint) {
|
||||||
args.push(inputs.endpoint);
|
args.push(inputs.endpoint);
|
||||||
@@ -90,17 +79,21 @@ export async function getCreateArgs(inputs: Inputs, buildxVersion: string): Prom
|
|||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAppendArgs(inputs: Inputs, node: nodes.Node, buildxVersion: string): Promise<Array<string>> {
|
export async function getAppendArgs(inputs: Inputs, node: Node, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
const args: Array<string> = ['create', '--name', inputs.name, '--append'];
|
const args: Array<string> = ['create', '--name', inputs.name, '--append'];
|
||||||
if (node.name) {
|
if (node.name) {
|
||||||
args.push('--node', 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'] && buildx.satisfies(buildxVersion, '>=0.3.0')) {
|
if (node['driver-opts'] && (await toolkit.buildx.versionSatisfies('>=0.3.0'))) {
|
||||||
await asyncForEach(node['driver-opts'], async driverOpt => {
|
await Util.asyncForEach(node['driver-opts'], async (driverOpt: string) => {
|
||||||
args.push('--driver-opt', driverOpt);
|
args.push('--driver-opt', driverOpt);
|
||||||
});
|
});
|
||||||
if (inputs.driver != 'remote' && node['buildkitd-flags']) {
|
if (node['buildkitd-flags']) {
|
||||||
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
||||||
|
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
|
||||||
|
args.push('--buildkitd-flags', defaultBuildkitdFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (node.platforms) {
|
if (node.platforms) {
|
||||||
@@ -112,47 +105,28 @@ export async function getAppendArgs(inputs: Inputs, node: nodes.Node, buildxVers
|
|||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getInspectArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
|
export async function getInspectArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||||
const args: Array<string> = ['inspect', '--bootstrap'];
|
const args: Array<string> = ['inspect', '--bootstrap'];
|
||||||
if (buildx.satisfies(buildxVersion, '>=0.4.0')) {
|
if (await toolkit.buildx.versionSatisfies('>=0.4.0')) {
|
||||||
args.push('--builder', inputs.name);
|
args.push('--builder', inputs.name);
|
||||||
}
|
}
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getInputList(name: string, ignoreComma?: boolean, escapeQuotes?: boolean): Promise<string[]> {
|
function driverSupportsBuildkitdFlags(driver: string): boolean {
|
||||||
const res: Array<string> = [];
|
return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes';
|
||||||
|
|
||||||
const items = core.getInput(name);
|
|
||||||
if (items == '') {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
const records = parse(items, {
|
|
||||||
columns: false,
|
|
||||||
relaxQuotes: true,
|
|
||||||
comment: '#',
|
|
||||||
relaxColumnCount: true,
|
|
||||||
skipEmptyLines: true,
|
|
||||||
quote: escapeQuotes ? `"` : false
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const record of records as Array<string[]>) {
|
|
||||||
if (record.length == 1) {
|
|
||||||
res.push(record[0]);
|
|
||||||
continue;
|
|
||||||
} else if (!ignoreComma) {
|
|
||||||
res.push(...record);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
res.push(record.join(','));
|
|
||||||
}
|
|
||||||
|
|
||||||
return res.filter(item => item).map(pat => pat.trim());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const asyncForEach = async (array, callback) => {
|
export function getVersion(inputs: Inputs): string {
|
||||||
for (let index = 0; index < array.length; index++) {
|
const version = inputs.version;
|
||||||
await callback(array[index], index, array);
|
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,41 +0,0 @@
|
|||||||
import * as github from '@actions/github';
|
|
||||||
|
|
||||||
export interface Release {
|
|
||||||
id: number;
|
|
||||||
tag_name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const [owner, repo] = 'docker/buildx'.split('/');
|
|
||||||
|
|
||||||
export const getReleaseTag = async (tag: string, githubToken: string): Promise<Release> => {
|
|
||||||
return (
|
|
||||||
await github
|
|
||||||
.getOctokit(githubToken, {
|
|
||||||
baseUrl: 'https://api.github.com'
|
|
||||||
})
|
|
||||||
.rest.repos.getReleaseByTag({
|
|
||||||
owner,
|
|
||||||
repo,
|
|
||||||
tag
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
throw new Error(`Cannot get release ${tag}: ${error}`);
|
|
||||||
})
|
|
||||||
).data as Release;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getLatestRelease = async (githubToken: string): Promise<Release> => {
|
|
||||||
return (
|
|
||||||
await github
|
|
||||||
.getOctokit(githubToken, {
|
|
||||||
baseUrl: 'https://api.github.com'
|
|
||||||
})
|
|
||||||
.rest.repos.getLatestRelease({
|
|
||||||
owner,
|
|
||||||
repo
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
throw new Error(`Cannot get latest release: ${error}`);
|
|
||||||
})
|
|
||||||
).data as Release;
|
|
||||||
};
|
|
||||||
+235
-140
@@ -1,182 +1,277 @@
|
|||||||
|
import * as crypto from 'crypto';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as yaml from 'js-yaml';
|
||||||
import * as path from 'path';
|
|
||||||
import * as auth from './auth';
|
|
||||||
import * as buildx from './buildx';
|
|
||||||
import * as context from './context';
|
|
||||||
import * as docker from './docker';
|
|
||||||
import * as nodes from './nodes';
|
|
||||||
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', inputs.githubToken, 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);
|
core.setOutput('name', inputs.name);
|
||||||
stateHelper.setBuilderName(inputs.name);
|
stateHelper.setBuilderName(inputs.name);
|
||||||
|
stateHelper.setBuilderDriver(inputs.driver);
|
||||||
|
|
||||||
const credsdir = path.join(dockerConfigHome, 'buildx', 'creds', inputs.name);
|
fs.mkdirSync(Buildx.certsDir, {recursive: true});
|
||||||
fs.mkdirSync(credsdir, {recursive: true});
|
stateHelper.setCertsDir(Buildx.certsDir);
|
||||||
stateHelper.setCredsDir(credsdir);
|
|
||||||
|
// 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') {
|
if (inputs.driver !== 'docker') {
|
||||||
core.startGroup(`Creating a new builder instance`);
|
await core.group(`Creating a new builder instance`, async () => {
|
||||||
const authOpts = auth.setCredentials(credsdir, 0, inputs.driver, inputs.endpoint);
|
if (await toolkit.builder.exists(inputs.name)) {
|
||||||
if (authOpts.length > 0) {
|
core.info(`Builder ${inputs.name} already exists, skipping creation`);
|
||||||
inputs.driverOpts = [...inputs.driverOpts, ...authOpts];
|
} else {
|
||||||
}
|
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, inputs.endpoint, {
|
||||||
const createCmd = buildx.getCommand(await context.getCreateArgs(inputs, buildxVersion), standalone);
|
cacert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CACERT`],
|
||||||
await exec.exec(createCmd.commandLine, createCmd.args);
|
cert: process.env[`${context.builderNodeEnvPrefix}_0_AUTH_TLS_CERT`],
|
||||||
core.endGroup();
|
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) {
|
if (inputs.append) {
|
||||||
core.startGroup(`Appending node(s) to builder`);
|
await core.group(`Appending node(s) to builder`, async () => {
|
||||||
let nodeIndex = 1;
|
let nodeIndex = 1;
|
||||||
for (const node of nodes.Parse(inputs.append)) {
|
const nodes = yaml.load(inputs.append) as Node[];
|
||||||
const authOpts = auth.setCredentials(credsdir, nodeIndex, inputs.driver, node.endpoint || '');
|
for (const node of nodes) {
|
||||||
if (authOpts.length > 0) {
|
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, `${node.endpoint}`, {
|
||||||
node['driver-opts'] = [...(node['driver-opts'] || []), ...authOpts];
|
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++;
|
||||||
}
|
}
|
||||||
const appendCmd = buildx.getCommand(await context.getAppendArgs(inputs, node, buildxVersion), standalone);
|
});
|
||||||
await exec.exec(appendCmd.commandLine, appendCmd.args);
|
|
||||||
nodeIndex++;
|
|
||||||
}
|
|
||||||
core.endGroup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
core.startGroup(`Booting builder`);
|
await core.group(`Booting builder`, async () => {
|
||||||
const inspectCmd = buildx.getCommand(await context.getInspectArgs(inputs, buildxVersion), standalone);
|
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
|
||||||
await exec.exec(inspectCmd.commandLine, inspectCmd.args);
|
await Exec.getExecOutput(inspectCmd.command, inspectCmd.args, {
|
||||||
core.endGroup();
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
if (inputs.install) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
if (standalone) {
|
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||||
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(inputs.name, standalone);
|
|
||||||
const firstNode = builder.nodes[0];
|
|
||||||
const reducedPlatforms: Array<string> = [];
|
|
||||||
for (const node of builder.nodes) {
|
|
||||||
for (const platform of node.platforms?.split(',') || []) {
|
|
||||||
if (reducedPlatforms.indexOf(platform) > -1) {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
reducedPlatforms.push(platform);
|
});
|
||||||
}
|
});
|
||||||
}
|
|
||||||
core.info(JSON.stringify(builder, undefined, 2));
|
|
||||||
core.setOutput('driver', builder.driver);
|
|
||||||
core.setOutput('platforms', reducedPlatforms.join(','));
|
|
||||||
core.setOutput('nodes', JSON.stringify(builder.nodes, undefined, 2));
|
|
||||||
core.setOutput('endpoint', firstNode.endpoint); // TODO: deprecated, to be removed in a later version
|
|
||||||
core.setOutput('status', firstNode.status); // TODO: deprecated, to be removed in a later version
|
|
||||||
core.setOutput('flags', firstNode['buildkitd-flags']); // TODO: deprecated, to be removed in a later version
|
|
||||||
core.endGroup();
|
|
||||||
|
|
||||||
if (!standalone && builder.driver == 'docker-container') {
|
const builderInspect = await toolkit.builder.inspect(inputs.name);
|
||||||
stateHelper.setContainerName(`buildx_buildkit_${firstNode.name}`);
|
const firstNode = builderInspect.nodes[0];
|
||||||
core.startGroup(`BuildKit version`);
|
|
||||||
for (const node of builder.nodes) {
|
await core.group(`Inspect builder`, async () => {
|
||||||
const bkvers = await buildx.getBuildKitVersion(`buildx_buildkit_${node.name}`);
|
const reducedPlatforms: Array<string> = [];
|
||||||
core.info(`${node.name}: ${bkvers}`);
|
for (const node of builderInspect.nodes) {
|
||||||
|
for (const platform of node.platforms?.split(',') || []) {
|
||||||
|
if (reducedPlatforms.indexOf(platform) > -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
reducedPlatforms.push(platform);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
core.endGroup();
|
core.info(JSON.stringify(builderInspect, undefined, 2));
|
||||||
|
core.setOutput('driver', builderInspect.driver);
|
||||||
|
core.setOutput('platforms', reducedPlatforms.join(','));
|
||||||
|
core.setOutput('nodes', JSON.stringify(builderInspect.nodes, undefined, 2));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!standalone && builderInspect.driver == 'docker-container') {
|
||||||
|
stateHelper.setContainerName(`${Buildx.containerNamePrefix}${firstNode.name}`);
|
||||||
|
await core.group(`BuildKit version`, async () => {
|
||||||
|
for (const node of builderInspect.nodes) {
|
||||||
|
const buildkitVersion = await toolkit.buildkit.getVersion(node);
|
||||||
|
core.info(`${node.name}: ${buildkitVersion}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (core.isDebug() || firstNode['buildkitd-flags']?.includes('--debug')) {
|
if (core.isDebug() || firstNode['buildkitd-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.credsDir.length > 0 && fs.existsSync(stateHelper.credsDir)) {
|
if (stateHelper.certsDir.length > 0 && fs.existsSync(stateHelper.certsDir)) {
|
||||||
core.info(`Cleaning up credentials`);
|
await core.group(`Cleaning up certificates`, async () => {
|
||||||
fs.rmSync(stateHelper.credsDir, {recursive: true});
|
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
);
|
||||||
|
|
||||||
if (!stateHelper.IsPost) {
|
|
||||||
run();
|
|
||||||
} else {
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import * as yaml from 'js-yaml';
|
|
||||||
|
|
||||||
export type Node = {
|
|
||||||
name?: string;
|
|
||||||
endpoint?: string;
|
|
||||||
'driver-opts'?: Array<string>;
|
|
||||||
'buildkitd-flags'?: string;
|
|
||||||
platforms?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function Parse(data: string): Node[] {
|
|
||||||
return yaml.load(data) as Node[];
|
|
||||||
}
|
|
||||||
+22
-7
@@ -1,11 +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 credsDir = process.env['STATE_credsDir'] || '';
|
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);
|
||||||
@@ -19,14 +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);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setCredsDir(credsDir: string) {
|
export function setCertsDir(certsDir: string) {
|
||||||
core.saveState('credsDir', credsDir);
|
core.saveState('certsDir', certsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsPost) {
|
export function setTmpDockerContext(tmpDockerContext: string) {
|
||||||
core.saveState('isPost', 'true');
|
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