Fix and cleanup of v2 setup actions

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-16 04:10:09 +02:00
parent 3f08c86128
commit e9cb922263
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
19 changed files with 66 additions and 3827 deletions

View file

@ -31,7 +31,7 @@ jobs:
-
name: Set up QEMU
id: qemu
uses: docker/actions/setup-qemu@v1
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all

View file

@ -1,10 +1,10 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'Docker - Setup QEMU'
description: 'GitHub Action to install QEMU static binaries'
author: 'crazy-max'
name: 'Docker Setup QEMU'
description: 'Install QEMU static binaries'
author: 'docker'
branding:
icon: 'anchor'
color: 'blue'
icon: 'truck'
inputs:
image:

7
setup-qemu/dist/index.js generated vendored
View file

@ -1002,8 +1002,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87));
const mexec = __importStar(__webpack_require__(807));
const core = __importStar(__webpack_require__(470));
const exec = __importStar(__webpack_require__(807));
const exec = __importStar(__webpack_require__(986));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -1014,9 +1015,9 @@ function run() {
const image = core.getInput('image') || 'tonistiigi/binfmt:latest';
const platforms = core.getInput('platforms') || 'all';
core.info(`💎 Installing QEMU static binaries...`);
yield exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms], false);
yield exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]);
core.info('🛒 Extracting available platforms...');
yield exec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => {
yield mexec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}

View file

@ -1,12 +0,0 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
setupFiles: ["dotenv/config"],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: false
}

View file

@ -1,40 +1,35 @@
{
"name": "docker-setup-qemu",
"description": "GitHub Action to install QEMU static binaries",
"description": "Install QEMU static binaries",
"main": "lib/main.js",
"scripts": {
"build": "tsc && ncc build",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"test": "jest --coverage",
"pre-checkin": "yarn run format && yarn run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/docker/actions.git",
"directory": "setup-qemu"
"url": "git+https://github.com/docker/setup-qemu-action.git"
},
"keywords": [
"actions",
"docker",
"qemu"
],
"author": "CrazyMax",
"author": "Docker",
"contributors": [
"CrazyMax"
],
"license": "Apache-2.0",
"dependencies": {
"@actions/core": "^1.2.4",
"@actions/exec": "^1.0.4"
},
"devDependencies": {
"@types/jest": "^26.0.3",
"@types/node": "^14.0.14",
"@zeit/ncc": "^0.22.3",
"dotenv": "^8.2.0",
"jest": "^26.1.0",
"jest-circus": "^26.1.0",
"jest-runtime": "^26.1.0",
"prettier": "^2.0.5",
"ts-jest": "^26.1.1",
"typescript": "^3.9.5",
"typescript-formatter": "^7.2.2"
}

View file

@ -1,6 +1,7 @@
import * as os from 'os';
import * as mexec from './exec';
import * as core from '@actions/core';
import * as exec from './exec';
import * as exec from '@actions/exec';
interface Platforms {
supported: string[];
@ -18,10 +19,10 @@ async function run(): Promise<void> {
const platforms: string = core.getInput('platforms') || 'all';
core.info(`💎 Installing QEMU static binaries...`);
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms], false);
await exec.exec('docker', ['run', '--rm', '--privileged', image, '--install', platforms]);
core.info('🛒 Extracting available platforms...');
await exec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => {
await mexec.exec(`docker`, ['run', '--rm', '--privileged', image], true).then(res => {
if (res.stderr != '' && !res.success) {
throw new Error(res.stderr);
}

File diff suppressed because it is too large Load diff