diff --git a/action.yml.oldbash b/action.yml.oldbash index 793424e..a9c763b 100644 --- a/action.yml.oldbash +++ b/action.yml.oldbash @@ -80,8 +80,8 @@ inputs: description: "" default: "1" - docker_multi_arch: - description: "" + docker_arch_list: + description: "if set to true use linux/amd64,linux/arm64, otherwise specifiy arch list manually" default: "false" dockerfile: diff --git a/dist/index.js b/dist/index.js index d286f74..11b4252 100644 --- a/dist/index.js +++ b/dist/index.js @@ -62251,6 +62251,17 @@ function prepareDockerArgs(destinations) { dockerArgs.unshift(getDockerContextDir()); + if (isNonEmptyStr(core.getInput('docker_arch_list'))) { + if (!core.getBooleanInput('use_buildx')) { + throw new Error('Unsupported configuration: Cannot build multiarch without enabling buildx'); + } + let archList = (core.getInput('docker_arch_list')); + if (archList === 'true' || archList === '1') { + archList = 'linux/amd64,linux/arm64'; + } + dockerArgs.push('--platform ' + archList); + } + if (core.getBooleanInput('squash_layers')) { dockerArgs.push('--squash'); } @@ -62300,7 +62311,6 @@ function executeDockerBuild(dockerArgs, destinations) { throw new Error('docker build failed'); } - console.log('proc error check'); // TODO remove debug if (proc.error != null) { throw proc.error; } diff --git a/src/lib.js b/src/lib.js index 75ab61e..0f024bb 100644 --- a/src/lib.js +++ b/src/lib.js @@ -149,6 +149,17 @@ export function prepareDockerArgs(destinations) { dockerArgs.unshift(getDockerContextDir()); + if (isNonEmptyStr(core.getInput('docker_arch_list'))) { + if (!core.getBooleanInput('use_buildx')) { + throw new Error('Unsupported configuration: Cannot build multiarch without enabling buildx'); + } + let archList = (core.getInput('docker_arch_list')); + if (archList === 'true' || archList === '1') { + archList = 'linux/amd64,linux/arm64'; + } + dockerArgs.push('--platform ' + archList); + } + if (core.getBooleanInput('squash_layers')) { dockerArgs.push('--squash'); } @@ -198,7 +209,6 @@ export function executeDockerBuild(dockerArgs, destinations) { throw new Error('docker build failed'); } - console.log('proc error check'); // TODO remove debug if (proc.error != null) { throw proc.error; }