Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c74574e6c8 | ||
|
|
2d0cf98781 | ||
|
|
5f1d4ea81f | ||
|
|
59b5ed6124 | ||
|
|
bd61d52837 | ||
|
|
f6efb5fcbb | ||
|
|
2dfca373f3 |
No files matched your search
@@ -305,9 +305,13 @@ jobs:
|
|||||||
platforms: ${{ matrix.qemu-platforms }}
|
platforms: ${{ matrix.qemu-platforms }}
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx-version }}
|
version: ${{ matrix.buildx-version }}
|
||||||
|
-
|
||||||
|
name: List builder platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
build-ref:
|
build-ref:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -416,3 +420,47 @@ jobs:
|
|||||||
echo "::error::Should have failed"
|
echo "::error::Should have failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
append:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Create dummy contexts
|
||||||
|
run: |
|
||||||
|
docker context create ctxbuilder2
|
||||||
|
docker context create ctxbuilder3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
append: |
|
||||||
|
- name: builder2
|
||||||
|
endpoint: ctxbuilder2
|
||||||
|
platforms: linux/amd64
|
||||||
|
driver-opts:
|
||||||
|
- image=moby/buildkit:master
|
||||||
|
- network=host
|
||||||
|
- endpoint: ctxbuilder3
|
||||||
|
platforms: linux/arm64
|
||||||
|
-
|
||||||
|
name: List builder platforms
|
||||||
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64
|
||||||
@@ -21,6 +21,7 @@ ___
|
|||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
* [Advanced usage](#advanced-usage)
|
* [Advanced usage](#advanced-usage)
|
||||||
* [Authentication support](docs/advanced/auth.md)
|
* [Authentication support](docs/advanced/auth.md)
|
||||||
|
* [Append additional nodes to the builder](docs/advanced/append-nodes.md)
|
||||||
* [Install by default](docs/advanced/install-default.md)
|
* [Install by default](docs/advanced/install-default.md)
|
||||||
* [BuildKit daemon configuration](docs/advanced/buildkit-config.md)
|
* [BuildKit daemon configuration](docs/advanced/buildkit-config.md)
|
||||||
* [Standalone mode](docs/advanced/standalone.md)
|
* [Standalone mode](docs/advanced/standalone.md)
|
||||||
@@ -61,6 +62,7 @@ jobs:
|
|||||||
## Advanced usage
|
## Advanced usage
|
||||||
|
|
||||||
* [Authentication support](docs/advanced/auth.md)
|
* [Authentication support](docs/advanced/auth.md)
|
||||||
|
* [Append additional nodes to the builder](docs/advanced/append-nodes.md)
|
||||||
* [Install by default](docs/advanced/install-default.md)
|
* [Install by default](docs/advanced/install-default.md)
|
||||||
* [BuildKit daemon configuration](docs/advanced/buildkit-config.md)
|
* [BuildKit daemon configuration](docs/advanced/buildkit-config.md)
|
||||||
* [Standalone mode](docs/advanced/standalone.md)
|
* [Standalone mode](docs/advanced/standalone.md)
|
||||||
@@ -69,32 +71,36 @@ jobs:
|
|||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
||||||
Following inputs can be used as `step.with` keys
|
Following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
| Name | Type | Description |
|
> `List` type is a newline-delimited string
|
||||||
|-------------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
||||||
| `version` | String | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
|
|
||||||
| `driver` | String | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used (default `docker-container`) |
|
|
||||||
| `driver-opts` | CSV | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
|
||||||
| `buildkitd-flags` | String | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon (since [buildx v0.3.0](https://github.com/docker/buildx/releases/tag/v0.3.0)) |
|
|
||||||
| `install` | Bool | Sets up `docker build` command as an alias to `docker buildx` (default `false`) |
|
|
||||||
| `use` | Bool | Switch to this builder instance (default `true`) |
|
|
||||||
| `endpoint` | String | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
|
||||||
| `config`¹ | String | [BuildKit config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
|
||||||
| `config-inline`¹ | String | Same as `config` but inline |
|
|
||||||
|
|
||||||
> * ¹ `config` and `config-inline` are mutually exclusive
|
|
||||||
|
|
||||||
> `CSV` type must be a newline-delimited string
|
|
||||||
> ```yaml
|
|
||||||
> driver-opts: image=moby/buildkit:master
|
|
||||||
> ```
|
|
||||||
> ```yaml
|
> ```yaml
|
||||||
> driver-opts: |
|
> driver-opts: |
|
||||||
> image=moby/buildkit:master
|
> image=moby/buildkit:master
|
||||||
> network=host
|
> network=host
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
|
> `CSV` type must be a newline-delimited string
|
||||||
|
> ```yaml
|
||||||
|
> platforms: linux/amd64,linux/arm64
|
||||||
|
> ```
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
|-------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `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`) |
|
||||||
|
| `driver-opts` | List | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
|
||||||
|
| `buildkitd-flags` | String | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon (since [buildx v0.3.0](https://github.com/docker/buildx/releases/tag/v0.3.0)) |
|
||||||
|
| `install` | Bool | Sets up `docker build` command as an alias to `docker buildx` (default `false`) |
|
||||||
|
| `use` | Bool | Switch to this builder instance (default `true`) |
|
||||||
|
| `endpoint` | String | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
|
||||||
|
| `platforms` | List/CSV | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones. |
|
||||||
|
| `config`¹ | String | [BuildKit config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
|
||||||
|
| `config-inline`¹ | String | Same as `config` but inline |
|
||||||
|
| `append` | YAML | [Append additional nodes](docs/advanced/append-nodes.md) to the builder |
|
||||||
|
|
||||||
|
> * ¹ `config` and `config-inline` are mutually exclusive
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
Following outputs are available
|
Following outputs are available
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as os from 'os';
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
import * as context from '../src/context';
|
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);
|
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-setup-buildx-')).split(path.sep).join(path.posix.sep);
|
||||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
||||||
@@ -90,6 +91,24 @@ describe('getCreateArgs', () => {
|
|||||||
'tls://foo:1234'
|
'tls://foo:1234'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
4,
|
||||||
|
new Map<string, string>([
|
||||||
|
['driver', 'remote'],
|
||||||
|
['platforms', 'linux/arm64,linux/arm/v7'],
|
||||||
|
['endpoint', 'tls://foo:1234'],
|
||||||
|
['install', 'false'],
|
||||||
|
['use', 'true'],
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--driver', 'remote',
|
||||||
|
'--platform', 'linux/arm64,linux/arm/v7',
|
||||||
|
'--use',
|
||||||
|
'tls://foo:1234'
|
||||||
|
]
|
||||||
|
],
|
||||||
])(
|
])(
|
||||||
'[%d] given %p as inputs, returns %p',
|
'[%d] given %p as inputs, returns %p',
|
||||||
async (num: number, inputs: Map<string, string>, expected: Array<string>) => {
|
async (num: number, inputs: Map<string, string>, expected: Array<string>) => {
|
||||||
@@ -103,6 +122,57 @@ describe('getCreateArgs', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('getAppendArgs', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
|
if (!key.startsWith('INPUT_')) {
|
||||||
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
|
});
|
||||||
|
|
||||||
|
// prettier-ignore
|
||||||
|
test.each([
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
new Map<string, string>([
|
||||||
|
['install', 'false'],
|
||||||
|
['use', 'true'],
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
"name": "aws_graviton2",
|
||||||
|
"endpoint": "ssh://me@graviton2",
|
||||||
|
"driver-opts": [
|
||||||
|
"image=moby/buildkit:latest"
|
||||||
|
],
|
||||||
|
"buildkitd-flags": "--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host",
|
||||||
|
"platforms": "linux/arm64"
|
||||||
|
},
|
||||||
|
[
|
||||||
|
'create',
|
||||||
|
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
||||||
|
'--append',
|
||||||
|
'--node', 'aws_graviton2',
|
||||||
|
'--driver-opt', 'image=moby/buildkit:latest',
|
||||||
|
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
|
'--platform', 'linux/arm64',
|
||||||
|
'ssh://me@graviton2'
|
||||||
|
]
|
||||||
|
]
|
||||||
|
])(
|
||||||
|
'[%d] given %p as inputs, returns %p',
|
||||||
|
async (num: number, inputs: Map<string, string>, node: nodes.Node, expected: Array<string>) => {
|
||||||
|
inputs.forEach((value: string, name: string) => {
|
||||||
|
setInput(name, value);
|
||||||
|
});
|
||||||
|
const inp = await context.getInputs();
|
||||||
|
const res = await context.getAppendArgs(inp, node, '0.9.0');
|
||||||
|
expect(res).toEqual(expected);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
describe('getInputList', () => {
|
describe('getInputList', () => {
|
||||||
it('handles single line correctly', async () => {
|
it('handles single line correctly', async () => {
|
||||||
await setInput('foo', 'bar');
|
await setInput('foo', 'bar');
|
||||||
|
|||||||
@@ -32,12 +32,18 @@ inputs:
|
|||||||
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:
|
||||||
|
description: 'Fixed platforms for current node. If not empty, values take priority over the detected ones'
|
||||||
|
required: false
|
||||||
config:
|
config:
|
||||||
description: 'BuildKit config file'
|
description: 'BuildKit config file'
|
||||||
required: false
|
required: false
|
||||||
config-inline:
|
config-inline:
|
||||||
description: 'Inline BuildKit config'
|
description: 'Inline BuildKit config'
|
||||||
required: false
|
required: false
|
||||||
|
append:
|
||||||
|
description: 'Append additional nodes to the builder'
|
||||||
|
required: false
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
name:
|
name:
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
require('./sourcemap-register.js');(()=>{var e={7351:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=o(r(2037));const a=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const u="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=u+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${u}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const a=r(7351);const u=r(717);const c=r(5278);const l=o(r(2037));const d=o(r(1017));const p=r(8041);var h;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(h=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=c.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){return u.issueFileCommand("ENV",u.prepareKeyValueMessage(e,t))}a.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){u.issueFileCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${d.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 n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.includes(i))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){const r=process.env["GITHUB_OUTPUT"]||"";if(r){return u.issueFileCommand("OUTPUT",u.prepareKeyValueMessage(e,t))}process.stdout.write(l.EOL);a.issueCommand("set-output",{name:e},c.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=h.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;functiLine truncated
|
require('./sourcemap-register.js');(()=>{var e={7351:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const s=o(r(2037));const a=r(5278);function issueCommand(e,t,r){const n=new Command(e,t,r);process.stdout.write(n.toString()+s.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCommand(e,{},t)}t.issue=issue;const l="::";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=l+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";let t=true;for(const r in this.properties){if(this.properties.hasOwnProperty(r)){const n=this.properties[r];if(n){if(t){t=false}else{e+=","}e+=`${r}=${escapeProperty(n)}`}}}}e+=`${l}${escapeData(this.message)}`;return e}}function escapeData(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(e){return a.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var s=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.getIDToken=t.getState=t.saveState=t.group=t.endGroup=t.startGroup=t.info=t.notice=t.warning=t.error=t.debug=t.isDebug=t.setFailed=t.setCommandEcho=t.setOutput=t.getBooleanInput=t.getMultilineInput=t.getInput=t.addPath=t.setSecret=t.exportVariable=t.ExitCode=void 0;const a=r(7351);const l=r(717);const u=r(5278);const c=o(r(2037));const d=o(r(1017));const p=r(8041);var h;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(h=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=u.toCommandValue(t);process.env[e]=r;const n=process.env["GITHUB_ENV"]||"";if(n){return l.issueFileCommand("ENV",l.prepareKeyValueMessage(e,t))}a.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){a.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){const t=process.env["GITHUB_PATH"]||"";if(t){l.issueFileCommand("PATH",e)}else{a.issueCommand("add-path",{},e)}process.env["PATH"]=`${e}${d.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 n=["false","False","FALSE"];const i=getInput(e,t);if(r.includes(i))return true;if(n.includes(i))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}t.getBooleanInput=getBooleanInput;function setOutput(e,t){const r=process.env["GITHUB_OUTPUT"]||"";if(r){return l.issueFileCommand("OUTPUT",l.prepareKeyValueMessage(e,t))}process.stdout.write(c.EOL);a.issueCommand("set-output",{name:e},u.toCommandValue(t))}t.setOutput=setOutput;function setCommandEcho(e){a.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=h.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;functiLine truncated
|
||||||
/*!
|
/*!
|
||||||
* Tmp
|
* Tmp
|
||||||
*
|
*
|
||||||
@@ -6,5 +6,5 @@ require('./sourcemap-register.js');(()=>{var e={7351:function(e,t,r){"use strict
|
|||||||
*
|
*
|
||||||
* MIT Licensed
|
* MIT Licensed
|
||||||
*/
|
*/
|
||||||
const n=r(7147);const i=r(2037);const o=r(1017);const s=r(6113);const a={fs:n.constants,os:i.constants};const u=r(4959);const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,d=3,p=(a.O_CREAT||a.fs.O_CREAT)|(a.O_EXCL||a.fs.O_EXCL)|(a.O_RDWR||a.fs.O_RDWR),h=i.platform()==="win32",m=a.EBADF||a.os.errno.EBADF,v=a.ENOENT||a.os.errno.ENOENT,g=448,y=384,E="exit",b=[],_=n.rmdirSync.bind(n),w=u.sync;let O=false;function tmpName(e,t){const r=_parseArguments(e,t),i=r[0],o=r[1];try{_assertAndSanitizeOptions(i)}catch(e){return o(e)}let s=i.tries;(function _getUniqueName(){try{const e=_generateTmpName(i);n.stat(e,(function(t){if(!t){if(s-- >0)return _getUniqueName();return o(new Error("Could not get a unique tmp filename, max tries reached "+e))}o(null,e)}))}catch(e){o(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),r=t[0];_assertAndSanitizeOptions(r);let i=r.tries;do{const e=_generateTmpName(r);try{n.statSync(e)}catch(t){return e}}while(i-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const r=_parseArguments(e,t),i=r[0],o=r[1];tmpName(i,(function _tmpNameCreated(e,t){if(e)return o(e);n.open(t,p,i.mode||y,(function _fileCreated(e,r){if(e)return o(e);if(i.discardDescriptor){return n.close(r,(function _discardCallback(e){return o(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,i,false))}))}else{const e=i.discardDescriptor||i.detachDescriptor;o(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 o=tmpNameSync(r);var s=n.openSync(o,p,r.mode||y);if(r.discardDescriptor){n.closeSync(s);s=undefined}return{name:o,fd:s,removeCallback:_prepareTmpFileRemoveCallback(o,i?-1:s,r,true)}}function dir(e,t){const r=_parseArguments(e,t),i=r[0],o=r[1];tmpName(i,(function _tmpNameCreated(e,t){if(e)return o(e);n.mkdir(t,i.mode||g,(function _dirCreated(e){if(e)return o(e);o(null,t,_prepareTmpDirRemoveCallback(t,i,false))}))}))}function dirSync(e){const t=_parseArguments(e),r=t[0];const i=tmpNameSync(r);n.mkdirSync(i,r.mode||g);return{name:i,removeCallback:_prepareTmpDirRemoveCallback(i,r,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])n.close(e[0],(function(){n.unlink(e[1],_handler)}));else n.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])n.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{n.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,n){const i=_prepareRemoveCallback(_removeFileSync,[t,e],n);const o=_prepareRemoveCallback(_removeFileAsync,[t,e],n,i);if(!r.keep)b.unshift(i);return n?i:o}function _prepareTmpDirRemoveCallback(e,t,r){const i=t.unsafeCleanup?u:n.rmdir.bind(n);const o=t.unsafeCleanup?w:_;const s=_prepareRemoveCallback(o,e,r);const a=_prepareRemoveCallback(i,e,r,s);if(!t.keep)b.unshift(s);return r?s:a}function _prepareRemoveCallback(e,t,r,n){let i=false;return function _cleanupCallback(o){if(!i){const s=n||_cleanupCallback;const a=b.indexOf(s);if(a>=0)b.splice(a,1);i=true;if(r||e===_||e===w){return e(t)}else{return e(t,o||function(){})}}}}function _garbageCollector(){if(!O)return;while(b.length){try{b[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=s.randomBytes(e)}catch(t){r=s.pseudoRandomBytes(e)}for(var n=0;n<e;n++){t.push(c[r[n]%c.length])}return t.join("")}function _isBlank(e){return e===null||_isUndefined(e)||!e.trim()}function _isUndefined(e){return typeof e==="undefined"}function _parseArguments(e,t){if(typeof e==="function"){return[{},e]}if(_isUndefined(e)){return[{},t]}const r={};for(const t of Object.getOwnPropertyNames(e)){r[t]=e[t]}return[r,t]}function _generateTmpName(e){const t=e.tmpdir;if(!_isUndefined(e.name))return o.join(t,e.dir,e.name);if(!_isUndefined(e.template))return o.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 o.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||d:1;e.keep=!!e.keep;e.detachDescriptor=!!e.detachDescriptor;e.discardDescriptor=!!e.discardDescriptor;e.unsafeCleanup=!!e.unsafeCleanup;e.dir=_isUndefined(e.dir)?"":o.relative(t,_resolvePath(e.dir,t));e.template=_isUndefined(e.template)?undefined:o.relative(t,_resolvePath(e.template,t));e.template=_isBlank(e.template)?undefined:o.relative(e.dir,e.template);e.naLine truncated
|
const n=r(7147);const i=r(2037);const o=r(1017);const s=r(6113);const a={fs:n.constants,os:i.constants};const l=r(4959);const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",c=/XXXXXX/,d=3,p=(a.O_CREAT||a.fs.O_CREAT)|(a.O_EXCL||a.fs.O_EXCL)|(a.O_RDWR||a.fs.O_RDWR),h=i.platform()==="win32",m=a.EBADF||a.os.errno.EBADF,g=a.ENOENT||a.os.errno.ENOENT,v=448,_=384,y="exit",E=[],b=n.rmdirSync.bind(n),w=l.sync;let O=false;function tmpName(e,t){const r=_parseArguments(e,t),i=r[0],o=r[1];try{_assertAndSanitizeOptions(i)}catch(e){return o(e)}let s=i.tries;(function _getUniqueName(){try{const e=_generateTmpName(i);n.stat(e,(function(t){if(!t){if(s-- >0)return _getUniqueName();return o(new Error("Could not get a unique tmp filename, max tries reached "+e))}o(null,e)}))}catch(e){o(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),r=t[0];_assertAndSanitizeOptions(r);let i=r.tries;do{const e=_generateTmpName(r);try{n.statSync(e)}catch(t){return e}}while(i-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const r=_parseArguments(e,t),i=r[0],o=r[1];tmpName(i,(function _tmpNameCreated(e,t){if(e)return o(e);n.open(t,p,i.mode||_,(function _fileCreated(e,r){if(e)return o(e);if(i.discardDescriptor){return n.close(r,(function _discardCallback(e){return o(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,i,false))}))}else{const e=i.discardDescriptor||i.detachDescriptor;o(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 o=tmpNameSync(r);var s=n.openSync(o,p,r.mode||_);if(r.discardDescriptor){n.closeSync(s);s=undefined}return{name:o,fd:s,removeCallback:_prepareTmpFileRemoveCallback(o,i?-1:s,r,true)}}function dir(e,t){const r=_parseArguments(e,t),i=r[0],o=r[1];tmpName(i,(function _tmpNameCreated(e,t){if(e)return o(e);n.mkdir(t,i.mode||v,(function _dirCreated(e){if(e)return o(e);o(null,t,_prepareTmpDirRemoveCallback(t,i,false))}))}))}function dirSync(e){const t=_parseArguments(e),r=t[0];const i=tmpNameSync(r);n.mkdirSync(i,r.mode||v);return{name:i,removeCallback:_prepareTmpDirRemoveCallback(i,r,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])n.close(e[0],(function(){n.unlink(e[1],_handler)}));else n.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])n.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{n.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,n){const i=_prepareRemoveCallback(_removeFileSync,[t,e],n);const o=_prepareRemoveCallback(_removeFileAsync,[t,e],n,i);if(!r.keep)E.unshift(i);return n?i:o}function _prepareTmpDirRemoveCallback(e,t,r){const i=t.unsafeCleanup?l:n.rmdir.bind(n);const o=t.unsafeCleanup?w:b;const s=_prepareRemoveCallback(o,e,r);const a=_prepareRemoveCallback(i,e,r,s);if(!t.keep)E.unshift(s);return r?s:a}function _prepareRemoveCallback(e,t,r,n){let i=false;return function _cleanupCallback(o){if(!i){const s=n||_cleanupCallback;const a=E.indexOf(s);if(a>=0)E.splice(a,1);i=true;if(r||e===b||e===w){return e(t)}else{return e(t,o||function(){})}}}}function _garbageCollector(){if(!O)return;while(E.length){try{E[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=s.randomBytes(e)}catch(t){r=s.pseudoRandomBytes(e)}for(var n=0;n<e;n++){t.push(u[r[n]%u.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 o.join(t,e.dir,e.name);if(!_isUndefined(e.template))return o.join(t,e.dir,e.template).replace(c,_randomChars(6));const r=[e.prefix?e.prefix:"tmp","-",process.pid,"-",_randomChars(12),e.postfix?"-"+e.postfix:""].join("");return o.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(c))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||d:1;e.keep=!!e.keep;e.detachDescriptor=!!e.detachDescriptor;e.discardDescriptor=!!e.discardDescriptor;e.unsafeCleanup=!!e.unsafeCleanup;e.dir=_isUndefined(e.dir)?"":o.relative(t,_resolvePath(e.dir,t));e.template=_isUndefined(e.template)?undefined:o.relative(t,_resolvePath(e.template,t));e.template=_isBlank(e.template)?undefined:o.relative(e.dir,e.template);e.naLine 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/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/balanced-match/index.js","../webpack:/docker-setup-buildx/node_modules/brace-expansion/index.js","../webpack:/docker-setup-buildx/node_modules/concat-map/index.js","../webpack:/docker-setup-buildx/node_modules/fs.realpath/index.js","../webpack:/docker-setup-buildx/node_modules/fs.realpath/old.js","../webpack:/docker-setup-buildx/node_modules/glob/common.js","../webpack:/docker-setup-buildx/node_modules/glob/glob.js","../webpack:/docker-setup-buildx/node_modules/glob/sync.js","../webpack:/docker-setup-buildx/node_modules/inflight/inflight.js","../webpack:/docker-setup-buildx/node_modules/inherits/inherits.js","../webpack:/docker-setup-buildx/node_modules/inherits/inherits_browser.js","../webpack:/docker-setup-buildx/node_modules/lru-cache/index.js","../webpack:/docker-setup-buildx/node_modules/minimatch/minimatch.js","../webpack:/docker-setup-buildx/node_modules/once/once.js","../webpack:/docker-setup-buildx/node_modules/path-is-absolute/index.js","../webpack:/docker-setup-buildx/node_modules/rimraf/rimraf.js","../webpack:/docker-setup-buildx/node_modules/semver/classes/comparator.js","../webpack:/docker-setup-buildx/node_modules/semver/classes/range.js","../webpack:/docker-setup-buildx/node_modules/semver/classes/semver.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/clean.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/cmp.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/coerce.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/compare-build.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/compare-loose.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/compare.js","../webpack:/docker-setup-buildx/node_modules/semver/functions/diff.js","../webpack:/docker-setup-buildx/node_modules/semver/funcLine truncated
|
{"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/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/balanced-match/index.js","../webpack:/docker-setup-buildx/node_modules/brace-expansion/index.js","../webpack:/docker-setup-buildx/node_modules/concat-map/index.js","../webpack:/docker-setup-buildx/node_modules/fs.realpath/index.js","../webpack:/docker-setup-buildx/node_modules/fs.realpath/old.js","../webpack:/docker-setup-buildx/node_modules/glob/common.js","../webpack:/docker-setup-buildx/node_modules/glob/glob.js","../webpack:/docker-setup-buildx/node_modules/glob/sync.js","../webpack:/docker-setup-buildx/node_modules/inflight/inflight.js","../webpack:/docker-setup-buildx/node_modules/inherits/inherits.js","../webpack:/docker-setup-buildx/node_modules/inherits/inherits_browser.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/index.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/common.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/dumper.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/exception.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/loader.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/schema.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/schema/core.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/schema/default.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/schema/failsafe.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/schema/json.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/snippet.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/type.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/type/binary.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/type/bool.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/type/float.js","../webpack:/docker-setup-buildx/node_modules/js-yaml/lib/type/inLine truncated
|
||||||
+50
@@ -143,6 +143,31 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
csv-parse
|
||||||
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2010 Adaltas
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
fs.realpath
|
fs.realpath
|
||||||
ISC
|
ISC
|
||||||
The ISC License
|
The ISC License
|
||||||
@@ -254,6 +279,31 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
js-yaml
|
||||||
|
MIT
|
||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (C) 2011-2015 by Vitaly Puzrin
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
lru-cache
|
lru-cache
|
||||||
ISC
|
ISC
|
||||||
The ISC License
|
The ISC License
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# Append additional nodes to the builder
|
||||||
|
|
||||||
|
Buildx also supports running builds on multiple machines. This is useful for
|
||||||
|
building [multi-platform images](https://docs.docker.com/build/building/multi-platform/)
|
||||||
|
on native nodes for more complicated cases that are not handled by QEMU and
|
||||||
|
generally have better performance or for distributing the build across multiple
|
||||||
|
machines.
|
||||||
|
|
||||||
|
You can append nodes to the builder that is going to be created with the
|
||||||
|
`append` input in the form of a YAML string document to remove limitations
|
||||||
|
intrinsically linked to GitHub Actions (only string format is handled in the
|
||||||
|
input fields):
|
||||||
|
|
||||||
|
| Name | Type | Description |
|
||||||
|
|-------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `name` | String | [Name of the node](https://docs.docker.com/engine/reference/commandline/buildx_create/#node). If empty, it is the name of the builder it belongs to, with an index number suffix. This is useful to set it if you want to modify/remove a node in an underlying step of you workflow. |
|
||||||
|
| `endpoint` | String | [Docker context or endpoint](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) of the node to add to the builder |
|
||||||
|
| `driver-opts` | List | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) |
|
||||||
|
| `buildkitd-flags` | String | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon |
|
||||||
|
| `platforms` | String | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for the node. If not empty, values take priority over the detected ones. |
|
||||||
|
|
||||||
|
Here is an example using remote nodes with the [`remote` driver](https://docs.docker.com/build/building/drivers/remote/)
|
||||||
|
and [TLS authentication](auth.md#tls-authentication):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
buildx:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
driver: remote
|
||||||
|
endpoint: tcp://oneprovider:1234
|
||||||
|
append: |
|
||||||
|
- endpoint: tcp://graviton2:1234
|
||||||
|
platforms: linux/arm64
|
||||||
|
- endpoint: tcp://linuxone:1234
|
||||||
|
platforms: linux/s390x
|
||||||
|
env:
|
||||||
|
BUILDER_NODE_0_AUTH_TLS_CACERT: ${{ secrets.ONEPROVIDER_CA }}
|
||||||
|
BUILDER_NODE_0_AUTH_TLS_CERT: ${{ secrets.ONEPROVIDER_CERT }}
|
||||||
|
BUILDER_NODE_0_AUTH_TLS_KEY: ${{ secrets.ONEPROVIDER_KEY }}
|
||||||
|
BUILDER_NODE_1_AUTH_TLS_CACERT: ${{ secrets.GRAVITON2_CA }}
|
||||||
|
BUILDER_NODE_1_AUTH_TLS_CERT: ${{ secrets.GRAVITON2_CERT }}
|
||||||
|
BUILDER_NODE_1_AUTH_TLS_KEY: ${{ secrets.GRAVITON2_KEY }}
|
||||||
|
BUILDER_NODE_2_AUTH_TLS_CACERT: ${{ secrets.LINUXONE_CA }}
|
||||||
|
BUILDER_NODE_2_AUTH_TLS_CERT: ${{ secrets.LINUXONE_CERT }}
|
||||||
|
BUILDER_NODE_2_AUTH_TLS_KEY: ${{ secrets.LINUXONE_KEY }}
|
||||||
|
```
|
||||||
@@ -41,11 +41,6 @@ the node in the list of nodes:
|
|||||||
* `BUILDER_NODE_<idx>_AUTH_TLS_CERT`
|
* `BUILDER_NODE_<idx>_AUTH_TLS_CERT`
|
||||||
* `BUILDER_NODE_<idx>_AUTH_TLS_KEY`
|
* `BUILDER_NODE_<idx>_AUTH_TLS_KEY`
|
||||||
|
|
||||||
> **Note**
|
|
||||||
>
|
|
||||||
> The index is always `0` at the moment as we don't support (yet) appending new
|
|
||||||
> nodes with this action.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -1,10 +1,13 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
setupFiles: ["dotenv/config"],
|
setupFiles: ['dotenv/config'],
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ['**/*.test.ts'],
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
||||||
},
|
},
|
||||||
|
moduleNameMapper: {
|
||||||
|
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
||||||
|
},
|
||||||
verbose: true
|
verbose: true
|
||||||
}
|
};
|
||||||
@@ -31,6 +31,8 @@
|
|||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/tool-cache": "^2.0.1",
|
"@actions/tool-cache": "^2.0.1",
|
||||||
|
"csv-parse": "^5.3.1",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
"semver": "^7.3.7",
|
"semver": "^7.3.7",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
"uuid": "^9.0.0"
|
"uuid": "^9.0.0"
|
||||||
|
|||||||
+56
-6
@@ -3,7 +3,9 @@ import * as os from 'os';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as tmp from 'tmp';
|
import * as tmp from 'tmp';
|
||||||
import * as uuid from 'uuid';
|
import * as uuid from 'uuid';
|
||||||
|
import {parse} from 'csv-parse/sync';
|
||||||
import * as buildx from './buildx';
|
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;
|
let _tmpDir: string;
|
||||||
@@ -27,11 +29,13 @@ export interface Inputs {
|
|||||||
driver: string;
|
driver: string;
|
||||||
driverOpts: string[];
|
driverOpts: string[];
|
||||||
buildkitdFlags: string;
|
buildkitdFlags: string;
|
||||||
|
platforms: string[];
|
||||||
install: boolean;
|
install: boolean;
|
||||||
use: boolean;
|
use: boolean;
|
||||||
endpoint: string;
|
endpoint: string;
|
||||||
config: string;
|
config: string;
|
||||||
configInline: string;
|
configInline: string;
|
||||||
|
append: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getInputs(): Promise<Inputs> {
|
export async function getInputs(): Promise<Inputs> {
|
||||||
@@ -41,11 +45,13 @@ export async function getInputs(): Promise<Inputs> {
|
|||||||
driver: core.getInput('driver') || 'docker-container',
|
driver: core.getInput('driver') || 'docker-container',
|
||||||
driverOpts: await getInputList('driver-opts', true),
|
driverOpts: await getInputList('driver-opts', true),
|
||||||
buildkitdFlags: core.getInput('buildkitd-flags') || '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
buildkitdFlags: core.getInput('buildkitd-flags') || '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
|
||||||
|
platforms: await getInputList('platforms'),
|
||||||
install: core.getBooleanInput('install'),
|
install: core.getBooleanInput('install'),
|
||||||
use: core.getBooleanInput('use'),
|
use: core.getBooleanInput('use'),
|
||||||
endpoint: core.getInput('endpoint'),
|
endpoint: core.getInput('endpoint'),
|
||||||
config: core.getInput('config'),
|
config: core.getInput('config'),
|
||||||
configInline: core.getInput('config-inline')
|
configInline: core.getInput('config-inline'),
|
||||||
|
append: core.getInput('append')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +69,9 @@ export async function getCreateArgs(inputs: Inputs, buildxVersion: string): Prom
|
|||||||
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
args.push('--buildkitd-flags', inputs.buildkitdFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (inputs.platforms.length > 0) {
|
||||||
|
args.push('--platform', inputs.platforms.join(','));
|
||||||
|
}
|
||||||
if (inputs.use) {
|
if (inputs.use) {
|
||||||
args.push('--use');
|
args.push('--use');
|
||||||
}
|
}
|
||||||
@@ -79,6 +88,28 @@ 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>> {
|
||||||
|
const args: Array<string> = ['create', '--name', inputs.name, '--append'];
|
||||||
|
if (node.name) {
|
||||||
|
args.push('--node', node.name);
|
||||||
|
}
|
||||||
|
if (node['driver-opts'] && buildx.satisfies(buildxVersion, '>=0.3.0')) {
|
||||||
|
await asyncForEach(node['driver-opts'], async driverOpt => {
|
||||||
|
args.push('--driver-opt', driverOpt);
|
||||||
|
});
|
||||||
|
if (inputs.driver != 'remote' && node['buildkitd-flags']) {
|
||||||
|
args.push('--buildkitd-flags', node['buildkitd-flags']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node.platforms) {
|
||||||
|
args.push('--platform', node.platforms);
|
||||||
|
}
|
||||||
|
if (node.endpoint) {
|
||||||
|
args.push(node.endpoint);
|
||||||
|
}
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
export async function getInspectArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
|
export async function getInspectArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
|
||||||
const args: Array<string> = ['inspect', '--bootstrap'];
|
const args: Array<string> = ['inspect', '--bootstrap'];
|
||||||
if (buildx.satisfies(buildxVersion, '>=0.4.0')) {
|
if (buildx.satisfies(buildxVersion, '>=0.4.0')) {
|
||||||
@@ -88,14 +119,33 @@ export async function getInspectArgs(inputs: Inputs, buildxVersion: string): Pro
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getInputList(name: string, ignoreComma?: boolean): Promise<string[]> {
|
export async function getInputList(name: string, ignoreComma?: boolean): Promise<string[]> {
|
||||||
|
const res: Array<string> = [];
|
||||||
|
|
||||||
const items = core.getInput(name);
|
const items = core.getInput(name);
|
||||||
if (items == '') {
|
if (items == '') {
|
||||||
return [];
|
return res;
|
||||||
}
|
}
|
||||||
return items
|
|
||||||
.split(/\r?\n/)
|
const records = parse(items, {
|
||||||
.filter(x => x)
|
columns: false,
|
||||||
.reduce<string[]>((acc, line) => acc.concat(!ignoreComma ? line.split(',').filter(x => x) : line).map(pat => pat.trim()), []);
|
relaxQuotes: true,
|
||||||
|
comment: '#',
|
||||||
|
relaxColumnCount: true,
|
||||||
|
skipEmptyLines: true
|
||||||
|
});
|
||||||
|
|
||||||
|
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 const asyncForEach = async (array, callback) => {
|
||||||
|
|||||||
+26
-1
@@ -5,6 +5,7 @@ import * as auth from './auth';
|
|||||||
import * as buildx from './buildx';
|
import * as buildx from './buildx';
|
||||||
import * as context from './context';
|
import * as context from './context';
|
||||||
import * as docker from './docker';
|
import * as docker from './docker';
|
||||||
|
import * as nodes from './nodes';
|
||||||
import * as stateHelper from './state-helper';
|
import * as stateHelper from './state-helper';
|
||||||
import * as util from './util';
|
import * as util from './util';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
@@ -71,6 +72,21 @@ async function run(): Promise<void> {
|
|||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inputs.append) {
|
||||||
|
core.startGroup(`Appending node(s) to builder`);
|
||||||
|
let nodeIndex = 1;
|
||||||
|
for (const node of nodes.Parse(inputs.append)) {
|
||||||
|
const authOpts = auth.setCredentials(credsdir, nodeIndex, inputs.driver, node.endpoint || '');
|
||||||
|
if (authOpts.length > 0) {
|
||||||
|
node['driver-opts'] = [...(node['driver-opts'] || []), ...authOpts];
|
||||||
|
}
|
||||||
|
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`);
|
core.startGroup(`Booting builder`);
|
||||||
const inspectCmd = buildx.getCommand(await context.getInspectArgs(inputs, buildxVersion), standalone);
|
const inspectCmd = buildx.getCommand(await context.getInspectArgs(inputs, buildxVersion), standalone);
|
||||||
await exec.exec(inspectCmd.commandLine, inspectCmd.args);
|
await exec.exec(inspectCmd.commandLine, inspectCmd.args);
|
||||||
@@ -88,9 +104,18 @@ async function run(): Promise<void> {
|
|||||||
core.startGroup(`Inspect builder`);
|
core.startGroup(`Inspect builder`);
|
||||||
const builder = await buildx.inspect(inputs.name, standalone);
|
const builder = await buildx.inspect(inputs.name, standalone);
|
||||||
const firstNode = builder.nodes[0];
|
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.info(JSON.stringify(builder, undefined, 2));
|
||||||
core.setOutput('driver', builder.driver);
|
core.setOutput('driver', builder.driver);
|
||||||
core.setOutput('platforms', firstNode.platforms);
|
core.setOutput('platforms', reducedPlatforms.join(','));
|
||||||
core.setOutput('nodes', JSON.stringify(builder.nodes, undefined, 2));
|
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('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('status', firstNode.status); // TODO: deprecated, to be removed in a later version
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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[];
|
||||||
|
}
|
||||||
@@ -1450,6 +1450,11 @@ cssstyle@^2.3.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
cssom "~0.3.6"
|
cssom "~0.3.6"
|
||||||
|
|
||||||
|
csv-parse@^5.3.1:
|
||||||
|
version "5.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.3.1.tgz#78b028eb2d2a3e16e62ee8abe710ff7a0b1f8b3b"
|
||||||
|
integrity sha512-R4Hv6eGJNzgcKdThZ6XORbSQ873HVcNke74QIq+LbwpT90LaZ8Xzl7KKiuIP16xq/P7ofzRt0h7S0xm+fVScsw==
|
||||||
|
|
||||||
data-urls@^2.0.0:
|
data-urls@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b"
|
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b"
|
||||||
|
|||||||
Reference in new issue
Block a user