Compare commits
6 Commits
46d14e6152
...
18fbdb317a
Author | SHA1 | Date |
---|---|---|
CrazyMax | 18fbdb317a | |
CrazyMax | 4d56188b3d | |
CrazyMax | 1765b1e310 | |
CrazyMax | e2a9378e4f | |
CrazyMax | 3126c2341a | |
dependabot[bot] | 40ab895871 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -26,7 +26,7 @@
|
|||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
"@docker/actions-toolkit": "^0.21.0"
|
||||
"@docker/actions-toolkit": "^0.21.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.5.9",
|
||||
|
|
26
src/main.ts
26
src/main.ts
|
@ -20,15 +20,33 @@ actionsToolkit.run(
|
|||
});
|
||||
|
||||
await core.group(`Pulling binfmt Docker image`, async () => {
|
||||
await Exec.exec('docker', ['pull', input.image]);
|
||||
await Exec.getExecOutput('docker', ['pull', input.image], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
await core.group(`Image info`, async () => {
|
||||
await Exec.exec('docker', ['image', 'inspect', input.image]);
|
||||
await Exec.getExecOutput('docker', ['image', 'inspect', input.image], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
await core.group(`Installing QEMU static binaries`, async () => {
|
||||
await Exec.exec('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms]);
|
||||
await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
await core.group(`Extracting available platforms`, async () => {
|
||||
|
@ -37,7 +55,7 @@ actionsToolkit.run(
|
|||
silent: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.trim());
|
||||
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
|
||||
}
|
||||
const platforms: Platforms = JSON.parse(res.stdout.trim());
|
||||
core.info(`${platforms.supported.join(',')}`);
|
||||
|
|
|
@ -664,10 +664,10 @@
|
|||
dependencies:
|
||||
"@jridgewell/trace-mapping" "0.3.9"
|
||||
|
||||
"@docker/actions-toolkit@^0.21.0":
|
||||
version "0.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.21.0.tgz#f41906032fb3d005733e0858448135b7aab605ee"
|
||||
integrity sha512-m0Mh+tqZAF4uGrtUF7plJbnE6mVowKt/FVHfe/juVeHnFj5kH8yRh/3MC66BjD53sy7UQlI0DlPUBxX+YouCsA==
|
||||
"@docker/actions-toolkit@^0.21.1":
|
||||
version "0.21.1"
|
||||
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.21.1.tgz#d4a4630d117dcb2f040e121e1f918c0b19ceebf8"
|
||||
integrity sha512-JPdPr9AesJQ47kRB+ylGdCxTisEL5ptOtqeGGtpXZjX7zb3S//2EmptiNDV+G5F2LrMvnCz67ZZGipf0LGDPJQ==
|
||||
dependencies:
|
||||
"@actions/cache" "^3.2.4"
|
||||
"@actions/core" "^1.10.1"
|
||||
|
|
Loading…
Reference in New Issue