diff --git a/dist/index.js b/dist/index.js index 4643631..5daa24d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -103,9 +103,16 @@ function run() { } const image = core.getInput('image') || 'tonistiigi/binfmt:latest'; const platforms = core.getInput('platforms') || 'all'; - core.info(`💎 Installing QEMU static binaries...`); + core.startGroup(`⬇️ Downloading binfmt Docker image`); + yield exec.exec('docker', ['pull', '-q', image]); + core.endGroup(); + core.startGroup(`🔫 Uninstalling current emulators...`); + yield exec.exec('docker', ['run', '--rm', '--privileged', image, '--uninstall', 'qemu-']); + core.endGroup(); + core.startGroup(`💎 Installing QEMU static binaries...`); yield exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]); - core.info('🛒 Extracting available platforms...'); + core.endGroup(); + core.startGroup('🛒 Extracting available platforms...'); yield mexec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => { if (res.stderr != '' && !res.success) { throw new Error(res.stderr); @@ -114,6 +121,7 @@ function run() { core.info(`${platforms.supported.join(',')}`); core.setOutput('platforms', platforms.supported.join(',')); }); + core.endGroup(); } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index 8530992..0e81975 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,10 +18,19 @@ async function run(): Promise { const image: string = core.getInput('image') || 'tonistiigi/binfmt:latest'; const platforms: string = core.getInput('platforms') || 'all'; - core.info(`💎 Installing QEMU static binaries...`); + core.startGroup(`⬇️ Downloading binfmt Docker image`); + await exec.exec('docker', ['pull', '-q', image]); + core.endGroup(); + + core.startGroup(`🔫 Uninstalling current emulators...`); + await exec.exec('docker', ['run', '--rm', '--privileged', image, '--uninstall', 'qemu-']); + core.endGroup(); + + core.startGroup(`💎 Installing QEMU static binaries...`); await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]); + core.endGroup(); - core.info('🛒 Extracting available platforms...'); + core.startGroup('🛒 Extracting available platforms...'); await mexec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => { if (res.stderr != '' && !res.success) { throw new Error(res.stderr); @@ -30,6 +39,7 @@ async function run(): Promise { core.info(`${platforms.supported.join(',')}`); core.setOutput('platforms', platforms.supported.join(',')); }); + core.endGroup(); } catch (error) { core.setFailed(error.message); }