mirror of
https://github.com/docker/setup-qemu-action.git
synced 2026-05-28 09:08:18 +01:00
Compare commits
79 Commits
v4.0.0
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44cc945d98 | ||
|
|
06116385d9 | ||
|
|
ce59c818a5 | ||
|
|
2ddad4401e | ||
|
|
8c37cd6f34 | ||
|
|
d1a0ff34af | ||
|
|
0a8f3dc125 | ||
|
|
9430f61a76 | ||
|
|
978bd7796c | ||
|
|
3479febc62 | ||
|
|
b113c26414 | ||
|
|
0d62f46692 | ||
|
|
18b22fb6dd | ||
|
|
307ba5d25d | ||
|
|
9477555b6a | ||
|
|
fd73ae4b74 | ||
|
|
022e3ecd29 | ||
|
|
2f5ed24eb7 | ||
|
|
5778735069 | ||
|
|
d0bca56b99 | ||
|
|
996e022184 | ||
|
|
85439f04b3 | ||
|
|
1cc3610aed | ||
|
|
8f8e86af25 | ||
|
|
4048b6c127 | ||
|
|
67d47863c9 | ||
|
|
1fc8e57954 | ||
|
|
ba4e02a62a | ||
|
|
0e29173e9f | ||
|
|
af55a6d2e1 | ||
|
|
cf81fd0aa5 | ||
|
|
bfdfad855e | ||
|
|
176fd9f7b5 | ||
|
|
e87fceeec4 | ||
|
|
99370af9d1 | ||
|
|
5b751102ed | ||
|
|
7f9aaaffa5 | ||
|
|
1393c83302 | ||
|
|
acb469f3e2 | ||
|
|
99b36c7ccc | ||
|
|
fafa4ba9e7 | ||
|
|
a94af66060 | ||
|
|
60c2d931e8 | ||
|
|
5fb3f93f25 | ||
|
|
e9a73d0538 | ||
|
|
39f273e99b | ||
|
|
333c0cf081 | ||
|
|
ede635f9f0 | ||
|
|
f8607cc714 | ||
|
|
12ef543ef5 | ||
|
|
be32618138 | ||
|
|
74eee9ca52 | ||
|
|
76c0984808 | ||
|
|
de93a28d33 | ||
|
|
f4e8deed0c | ||
|
|
5a1a5cc4f8 | ||
|
|
6412e4f975 | ||
|
|
3329a8ce3d | ||
|
|
cf45d1535a | ||
|
|
7b4ca36676 | ||
|
|
9d536b88bb | ||
|
|
11ca1cd666 | ||
|
|
331c3d742d | ||
|
|
6804d31319 | ||
|
|
f03c104308 | ||
|
|
b27a081f65 | ||
|
|
6632d370ea | ||
|
|
ff0bafa2b5 | ||
|
|
fb631e9b1a | ||
|
|
b99055d793 | ||
|
|
f80e0ace51 | ||
|
|
a4bc6cde7e | ||
|
|
83ebb81e64 | ||
|
|
9586bd4603 | ||
|
|
72cd565084 | ||
|
|
b7a46cd9ec | ||
|
|
7430fdb955 | ||
|
|
618b42c7b3 | ||
|
|
3fcc89cfff |
10
.github/dependabot.yml
vendored
10
.github/dependabot.yml
vendored
@@ -4,6 +4,12 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
cooldown:
|
||||
default-days: 2
|
||||
groups:
|
||||
crazy-max-dot-github:
|
||||
patterns:
|
||||
- "crazy-max/.github/*"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "bot"
|
||||
@@ -11,6 +17,10 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
cooldown:
|
||||
default-days: 2
|
||||
exclude:
|
||||
- "@docker/actions-toolkit"
|
||||
versioning-strategy: "increase"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
|
||||
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -1,5 +1,8 @@
|
||||
name: ci
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -22,7 +25,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Set up QEMU
|
||||
id: qemu
|
||||
@@ -45,7 +48,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Set up QEMU
|
||||
id: qemu
|
||||
@@ -62,7 +65,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Stop docker
|
||||
run: |
|
||||
@@ -92,7 +95,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Set up QEMU
|
||||
id: qemu
|
||||
@@ -116,9 +119,29 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: ./
|
||||
with:
|
||||
image: ${{ matrix.image }}
|
||||
|
||||
reset:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Install multiarch/qemu-user-static
|
||||
run: |
|
||||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -c yes
|
||||
-
|
||||
name: Set up QEMU
|
||||
id: qemu
|
||||
uses: ./
|
||||
with:
|
||||
reset: true
|
||||
-
|
||||
name: Available platforms
|
||||
run: echo ${{ steps.qemu.outputs.platforms }}
|
||||
|
||||
46
.github/workflows/codeql.yml
vendored
Normal file
46
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: codeql
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
NODE_VERSION: "24"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Enable corepack
|
||||
run: |
|
||||
corepack enable
|
||||
yarn --version
|
||||
-
|
||||
name: Set up Node
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
-
|
||||
name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
|
||||
with:
|
||||
languages: javascript-typescript
|
||||
build-mode: none
|
||||
-
|
||||
name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
|
||||
with:
|
||||
category: "/language:javascript-typescript"
|
||||
4
.github/workflows/pr-assign-author.yml
vendored
4
.github/workflows/pr-assign-author.yml
vendored
@@ -4,14 +4,14 @@ permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
pull_request_target: # zizmor: ignore[dangerous-triggers] safe to use without checkout
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
run:
|
||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@9ba6e6f9450baf3b1237f8035c1fdc45932510bd # v1.8.0
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
|
||||
11
.github/workflows/publish.yml
vendored
11
.github/workflows/publish.yml
vendored
@@ -1,5 +1,12 @@
|
||||
name: publish
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
@@ -15,7 +22,7 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
uses: actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978 # v0.0.4
|
||||
|
||||
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@@ -1,5 +1,8 @@
|
||||
name: test
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -17,16 +20,16 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
source: .
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v5
|
||||
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
||||
with:
|
||||
files: ./coverage/clover.xml
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
19
.github/workflows/update-dist.yml
vendored
19
.github/workflows/update-dist.yml
vendored
@@ -1,5 +1,12 @@
|
||||
name: update-dist
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
@@ -8,27 +15,29 @@ on:
|
||||
|
||||
jobs:
|
||||
update-dist:
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
if: github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == github.event.pull_request.head.repo.full_name
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: GitHub auth token from GitHub App
|
||||
id: docker-read-app
|
||||
uses: actions/create-github-app-token@v2
|
||||
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
|
||||
with:
|
||||
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||
owner: docker
|
||||
repositories: setup-qemu-action
|
||||
permission-contents: write
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.docker-read-app.outputs.token || github.token }}
|
||||
token: ${{ steps.docker-read-app.outputs.token }}
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
|
||||
15
.github/workflows/validate.yml
vendored
15
.github/workflows/validate.yml
vendored
@@ -1,5 +1,8 @@
|
||||
name: validate
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -15,15 +18,15 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
matrix: ${{ steps.generate.outputs.matrix }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
-
|
||||
name: List targets
|
||||
name: Generate matrix
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
uses: docker/bake-action/subaction/matrix@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
target: validate
|
||||
|
||||
@@ -34,10 +37,10 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||
steps:
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7.2.0
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
29
.github/workflows/zizmor.yml
vendored
Normal file
29
.github/workflows/zizmor.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: zizmor
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
zizmor:
|
||||
uses: crazy-max/.github/.github/workflows/zizmor.yml@9ba6e6f9450baf3b1237f8035c1fdc45932510bd # v1.8.0
|
||||
permissions:
|
||||
contents: read
|
||||
security-events: write
|
||||
with:
|
||||
min-severity: medium
|
||||
min-confidence: medium
|
||||
persona: pedantic
|
||||
35
README.md
35
README.md
@@ -32,9 +32,37 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
```
|
||||
|
||||
This action registers QEMU emulators with `binfmt_misc`, so later steps can run
|
||||
containers built for another architecture on the GitHub-hosted runner.
|
||||
|
||||
```yaml
|
||||
name: run-cross-platform-container
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
qemu-example:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v4
|
||||
-
|
||||
name: Run an arm64 container
|
||||
run: docker run --rm --platform linux/arm64 alpine uname -m
|
||||
```
|
||||
|
||||
The command above prints `aarch64` even though the job itself is running on
|
||||
`ubuntu-latest`.
|
||||
|
||||
> [!TIP]
|
||||
> `setup-qemu-action` enables user-mode emulation for registered platforms. It
|
||||
> does not install `qemu-system-*` tools or add `qemu-*` binaries to your PATH.
|
||||
|
||||
> [!NOTE]
|
||||
> If you are using [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action),
|
||||
> this action should come before it:
|
||||
@@ -42,10 +70,10 @@ jobs:
|
||||
> ```yaml
|
||||
> -
|
||||
> name: Set up QEMU
|
||||
> uses: docker/setup-qemu-action@v3
|
||||
> uses: docker/setup-qemu-action@v4
|
||||
> -
|
||||
> name: Set up Docker Buildx
|
||||
> uses: docker/setup-buildx-action@v3
|
||||
> uses: docker/setup-buildx-action@v4
|
||||
> ```
|
||||
|
||||
## Customizing
|
||||
@@ -58,6 +86,7 @@ The following inputs can be used as `step.with` keys:
|
||||
|---------------|--------|-------------------------------------------------------------------------------|----------------------------------------------------|
|
||||
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
||||
| `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) |
|
||||
| `reset` | Bool | `false` | Uninstall current emulators before installation |
|
||||
| `cache-image` | Bool | `true` | Cache binfmt image to GitHub Actions cache backend |
|
||||
|
||||
### outputs
|
||||
|
||||
@@ -17,11 +17,13 @@ describe('getInputs', () => {
|
||||
[
|
||||
0,
|
||||
new Map<string, string>([
|
||||
['reset', 'false'],
|
||||
['cache-image', 'true'],
|
||||
]),
|
||||
{
|
||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: 'all',
|
||||
reset: false,
|
||||
cacheImage: true,
|
||||
}
|
||||
],
|
||||
@@ -30,11 +32,13 @@ describe('getInputs', () => {
|
||||
new Map<string, string>([
|
||||
['image', 'docker/binfmt:latest'],
|
||||
['platforms', 'arm64,riscv64,arm'],
|
||||
['reset', 'false'],
|
||||
['cache-image', 'false'],
|
||||
]),
|
||||
{
|
||||
image: 'docker/binfmt:latest',
|
||||
platforms: 'arm64,riscv64,arm',
|
||||
reset: false,
|
||||
cacheImage: false,
|
||||
}
|
||||
],
|
||||
@@ -42,11 +46,13 @@ describe('getInputs', () => {
|
||||
2,
|
||||
new Map<string, string>([
|
||||
['platforms', 'arm64, riscv64, arm '],
|
||||
['reset', 'false'],
|
||||
['cache-image', 'true'],
|
||||
]),
|
||||
{
|
||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: 'arm64,riscv64,arm',
|
||||
reset: false,
|
||||
cacheImage: true,
|
||||
}
|
||||
]
|
||||
|
||||
@@ -15,6 +15,10 @@ inputs:
|
||||
description: 'Platforms to install (e.g. arm64,riscv64,arm)'
|
||||
default: 'all'
|
||||
required: false
|
||||
reset:
|
||||
description: 'Uninstall current emulators before installation'
|
||||
default: 'false'
|
||||
required: false
|
||||
cache-image:
|
||||
description: 'Cache binfmt image to GitHub Actions cache backend'
|
||||
default: 'true'
|
||||
@@ -26,5 +30,5 @@ outputs:
|
||||
|
||||
runs:
|
||||
using: 'node24'
|
||||
main: 'dist/index.js'
|
||||
post: 'dist/index.js'
|
||||
main: 'dist/index.cjs'
|
||||
post: 'dist/index.cjs'
|
||||
|
||||
149
dist/index.cjs
generated
vendored
Normal file
149
dist/index.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
dist/index.cjs.map
generated
vendored
Normal file
7
dist/index.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
16
dist/index.js
generated
vendored
16
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
1
dist/index.js.map
generated
vendored
1
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
5780
dist/licenses.txt
generated
vendored
5780
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
3
dist/package.json
generated
vendored
3
dist/package.json
generated
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
1
dist/sourcemap-register.cjs
generated
vendored
1
dist/sourcemap-register.cjs
generated
vendored
File diff suppressed because one or more lines are too long
10
package.json
10
package.json
@@ -4,10 +4,11 @@
|
||||
"type": "module",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"build": "esbuild src/main.ts --bundle --platform=node --target=node24 --format=cjs --outfile=dist/index.cjs --sourcemap --minify && yarn run license",
|
||||
"lint": "eslint --max-warnings=0 .",
|
||||
"format": "eslint --fix .",
|
||||
"test": "vitest run"
|
||||
"test": "vitest run",
|
||||
"license": "generate-license-file --input package.json --output dist/licenses.txt --overwrite --ci --no-spinner --eol lf"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -23,19 +24,20 @@
|
||||
"packageManager": "yarn@4.9.2",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.0",
|
||||
"@docker/actions-toolkit": "^0.77.0"
|
||||
"@docker/actions-toolkit": "^0.91.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.3",
|
||||
"@types/node": "^24.11.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||
"@typescript-eslint/parser": "^8.56.1",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@vitest/eslint-plugin": "^1.6.9",
|
||||
"esbuild": "^0.28.0",
|
||||
"eslint": "^9.39.3",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"generate-license-file": "^4.1.1",
|
||||
"globals": "^17.3.0",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^5.9.3",
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||
export interface Inputs {
|
||||
image: string;
|
||||
platforms: string;
|
||||
reset: boolean;
|
||||
cacheImage: boolean;
|
||||
}
|
||||
|
||||
@@ -11,6 +12,7 @@ export function getInputs(): Inputs {
|
||||
return {
|
||||
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
||||
platforms: Util.getInputList('platforms').join(',') || 'all',
|
||||
reset: core.getBooleanInput('reset'),
|
||||
cacheImage: core.getBooleanInput('cache-image')
|
||||
};
|
||||
}
|
||||
|
||||
12
src/main.ts
12
src/main.ts
@@ -44,6 +44,18 @@ actionsToolkit.run(
|
||||
});
|
||||
});
|
||||
|
||||
if (input.reset) {
|
||||
await core.group(`Uninstalling current emulators`, async () => {
|
||||
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--uninstall', 'qemu-*'], {
|
||||
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 Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
|
||||
ignoreReturnCode: true
|
||||
|
||||
Reference in New Issue
Block a user