Skip to content

Commit fc63db2

Browse files
committed
Uninstall current emulators
Signed-off-by: CrazyMax <[email protected]>
1 parent 70e4374 commit fc63db2

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

dist/index.js

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ async function run(): Promise<void> {
1818
const image: string = core.getInput('image') || 'tonistiigi/binfmt:latest';
1919
const platforms: string = core.getInput('platforms') || 'all';
2020

21-
core.info(`💎 Installing QEMU static binaries...`);
21+
core.startGroup(`⬇️ Downloading binfmt Docker image`);
22+
await exec.exec('docker', ['pull', '-q', image]);
23+
core.endGroup();
24+
25+
core.startGroup(`🔫 Uninstalling current emulators...`);
26+
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--uninstall', 'qemu-']);
27+
core.endGroup();
28+
29+
core.startGroup(`💎 Installing QEMU static binaries...`);
2230
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]);
31+
core.endGroup();
2332

24-
core.info('🛒 Extracting available platforms...');
33+
core.startGroup('🛒 Extracting available platforms...');
2534
await mexec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => {
2635
if (res.stderr != '' && !res.success) {
2736
throw new Error(res.stderr);
@@ -30,6 +39,7 @@ async function run(): Promise<void> {
3039
core.info(`${platforms.supported.join(',')}`);
3140
core.setOutput('platforms', platforms.supported.join(','));
3241
});
42+
core.endGroup();
3343
} catch (error) {
3444
core.setFailed(error.message);
3545
}

0 commit comments

Comments
 (0)