Add setup-qemu action (#71)

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-07 11:05:37 +02:00
parent 36c90bc3ab
commit 64d53ac2cf
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
14 changed files with 5770 additions and 0 deletions

31
setup-qemu/src/main.ts Normal file
View file

@ -0,0 +1,31 @@
import * as os from 'os';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
async function run(): Promise<void> {
try {
if (os.platform() !== 'linux') {
core.setFailed('Only supported on linux platform');
return;
}
const qemuVer: string = core.getInput('qemu-version') || 'latest';
core.info(`💎 Installing QEMU static binaries...`);
await exec.exec('docker', [
'run',
'--rm',
'--privileged',
`multiarch/qemu-user-static:${qemuVer}`,
'--reset',
'-p',
'yes',
'--credential',
'yes'
]);
} catch (error) {
core.setFailed(error.message);
}
}
run();