From 1886d9322f6235da2cd9a736474936d9abcb057f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 12 Aug 2020 02:02:19 +0200 Subject: [PATCH] Fix platforms extraction Signed-off-by: CrazyMax --- setup-qemu/dist/index.js | 5 +++-- setup-qemu/src/main.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/setup-qemu/dist/index.js b/setup-qemu/dist/index.js index 637a234..2ac77ba 100644 --- a/setup-qemu/dist/index.js +++ b/setup-qemu/dist/index.js @@ -1014,11 +1014,12 @@ function run() { const image = core.getInput('image') || 'tonistiigi/binfmt:latest'; const platforms = core.getInput('platforms') || 'all'; core.info(`💎 Installing QEMU static binaries...`); - yield exec.exec(`docker`, ['run', '--rm', '--privileged', image, '--install', platforms], false).then(res => { + yield exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms], false); + core.info('🛒 Extracting available platforms...'); + yield exec.exec(`docker`, ['run', '--rm', '--privileged', image], false).then(res => { if (res.stderr != '' && !res.success) { throw new Error(res.stderr); } - core.info('🛒 Extracting available platforms...'); const platforms = JSON.parse(res.stdout.trim()); core.setOutput('platforms', platforms.supported.join(',')); }); diff --git a/setup-qemu/src/main.ts b/setup-qemu/src/main.ts index 739944d..7c7decc 100644 --- a/setup-qemu/src/main.ts +++ b/setup-qemu/src/main.ts @@ -18,12 +18,13 @@ async function run(): Promise { const platforms: string = core.getInput('platforms') || 'all'; core.info(`💎 Installing QEMU static binaries...`); - await exec.exec(`docker`, ['run', '--rm', '--privileged', image, '--install', platforms], false).then(res => { + await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms], false); + + core.info('🛒 Extracting available platforms...'); + await exec.exec(`docker`, ['run', '--rm', '--privileged', image], false).then(res => { if (res.stderr != '' && !res.success) { throw new Error(res.stderr); } - - core.info('🛒 Extracting available platforms...'); const platforms: Platforms = JSON.parse(res.stdout.trim()); core.setOutput('platforms', platforms.supported.join(',')); });