Enhance workflow

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-04-02 11:47:52 +02:00
parent 9d419fda7d
commit 1f1f11dad8
11 changed files with 135 additions and 67 deletions

9
dist/index.js generated vendored
View File

@ -103,9 +103,13 @@ function run() {
}
const image = core.getInput('image') || 'tonistiigi/binfmt:latest';
const platforms = core.getInput('platforms') || 'all';
core.info(`💎 Installing QEMU static binaries...`);
core.startGroup(`Pulling binfmt Docker image`);
yield exec.exec('docker', ['pull', image]);
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 +118,7 @@ function run() {
core.info(`${platforms.supported.join(',')}`);
core.setOutput('platforms', platforms.supported.join(','));
});
core.endGroup();
}
catch (error) {
core.setFailed(error.message);