mirror of
https://github.com/docker/setup-qemu-action.git
synced 2025-07-06 18:38:24 +02:00
Enhance workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
12
src/main.ts
12
src/main.ts
@ -18,10 +18,15 @@ async function run(): Promise<void> {
|
||||
const image: string = core.getInput('image') || 'tonistiigi/binfmt:latest';
|
||||
const platforms: string = core.getInput('platforms') || 'all';
|
||||
|
||||
core.info(`💎 Installing QEMU static binaries...`);
|
||||
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]);
|
||||
core.startGroup(`Pulling binfmt Docker image`);
|
||||
await exec.exec('docker', ['pull', image]);
|
||||
core.endGroup();
|
||||
|
||||
core.info('🛒 Extracting available platforms...');
|
||||
core.startGroup(`Installing QEMU static binaries`);
|
||||
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]);
|
||||
core.endGroup();
|
||||
|
||||
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 +35,7 @@ async function run(): Promise<void> {
|
||||
core.info(`${platforms.supported.join(',')}`);
|
||||
core.setOutput('platforms', platforms.supported.join(','));
|
||||
});
|
||||
core.endGroup();
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user