mirror of
https://github.com/docker/setup-qemu-action.git
synced 2025-11-08 08:26:54 +00:00
Compare commits
No commits in common. "master" and "v3.1.0" have entirely different histories.
20 changed files with 2923 additions and 2855 deletions
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
|
@ -14,7 +14,7 @@ to the public under the [project's open source license](LICENSE).
|
||||||
5. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
|
5. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
|
||||||
6. Validate all code has correctly formatted and built: `docker buildx bake validate`
|
6. Validate all code has correctly formatted and built: `docker buildx bake validate`
|
||||||
7. Push to your fork and [submit a pull request](https://github.com/docker/setup-qemu-action/compare)
|
7. Push to your fork and [submit a pull request](https://github.com/docker/setup-qemu-action/compare)
|
||||||
8. Pat yourself on the back and wait for your pull request to be reviewed and merged.
|
8. Pat your self on the back and wait for your pull request to be reviewed and merged.
|
||||||
|
|
||||||
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
||||||
|
|
||||||
|
|
|
||||||
49
.github/workflows/ci.yml
vendored
49
.github/workflows/ci.yml
vendored
|
|
@ -5,7 +5,6 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *'
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
|
|
@ -22,7 +21,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
id: qemu
|
id: qemu
|
||||||
|
|
@ -45,7 +44,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
id: qemu
|
id: qemu
|
||||||
|
|
@ -62,7 +61,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Stop docker
|
name: Stop docker
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -80,45 +79,3 @@ jobs:
|
||||||
echo "::error::Should have failed"
|
echo "::error::Should have failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cache-image:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
cache:
|
|
||||||
- true
|
|
||||||
- false
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
id: qemu
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
image: tonistiigi/binfmt:master
|
|
||||||
cache-image: ${{ matrix.cache }}
|
|
||||||
-
|
|
||||||
name: Available platforms
|
|
||||||
run: echo ${{ steps.qemu.outputs.platforms }}
|
|
||||||
|
|
||||||
version:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
image:
|
|
||||||
- tonistiigi/binfmt:master
|
|
||||||
- tonistiigi/binfmt:latest
|
|
||||||
- tonistiigi/binfmt:qemu-v7.0.0
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
image: ${{ matrix.image }}
|
|
||||||
|
|
|
||||||
17
.github/workflows/pr-assign-author.yml
vendored
17
.github/workflows/pr-assign-author.yml
vendored
|
|
@ -1,17 +0,0 @@
|
||||||
name: pr-assign-author
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- reopened
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run:
|
|
||||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
21
.github/workflows/publish.yml
vendored
21
.github/workflows/publish.yml
vendored
|
|
@ -1,21 +0,0 @@
|
||||||
name: publish
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types:
|
|
||||||
- published
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
-
|
|
||||||
name: Publish
|
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
|
||||||
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
|
|
@ -17,16 +17,15 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v6
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
source: .
|
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
files: ./coverage/clover.xml
|
file: ./coverage/clover.xml
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
|
||||||
18
.github/workflows/validate.yml
vendored
18
.github/workflows/validate.yml
vendored
|
|
@ -15,17 +15,16 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
targets: ${{ steps.generate.outputs.targets }}
|
targets: ${{ steps.targets.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: List targets
|
name: Targets matrix
|
||||||
id: generate
|
id: targets
|
||||||
uses: docker/bake-action/subaction/list-targets@v6
|
run: |
|
||||||
with:
|
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||||
target: validate
|
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -36,8 +35,11 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||||
steps:
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Validate
|
name: Validate
|
||||||
uses: docker/bake-action@v6
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
|
|
||||||
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
12
.yarnrc.yml
12
.yarnrc.yml
|
|
@ -1,9 +1,3 @@
|
||||||
# https://yarnpkg.com/configuration/yarnrc
|
|
||||||
|
|
||||||
compressionLevel: mixed
|
|
||||||
enableGlobalCache: false
|
|
||||||
enableHardenedMode: true
|
|
||||||
|
|
||||||
logFilters:
|
logFilters:
|
||||||
- code: YN0013
|
- code: YN0013
|
||||||
level: discard
|
level: discard
|
||||||
|
|
@ -11,9 +5,9 @@ logFilters:
|
||||||
level: discard
|
level: discard
|
||||||
- code: YN0076
|
- code: YN0076
|
||||||
level: discard
|
level: discard
|
||||||
- code: YN0086
|
|
||||||
level: discard
|
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
npmAuthToken: "${NODE_AUTH_TOKEN:-fallback}"
|
plugins:
|
||||||
|
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||||
|
spec: "@yarnpkg/plugin-interactive-tools"
|
||||||
|
|
|
||||||
16
README.md
16
README.md
|
|
@ -35,19 +35,6 @@ jobs:
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> If you are using [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action),
|
|
||||||
> this action should come before it:
|
|
||||||
>
|
|
||||||
> ```yaml
|
|
||||||
> -
|
|
||||||
> name: Set up QEMU
|
|
||||||
> uses: docker/setup-qemu-action@v3
|
|
||||||
> -
|
|
||||||
> name: Set up Docker Buildx
|
|
||||||
> uses: docker/setup-buildx-action@v3
|
|
||||||
> ```
|
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
@ -55,10 +42,9 @@ jobs:
|
||||||
The following inputs can be used as `step.with` keys:
|
The following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|---------------|--------|-------------------------------------------------------------------------------|----------------------------------------------------|
|
|-------------|--------|-------------------------------------------------------------------------------|--------------------------------------------------|
|
||||||
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
| `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`) |
|
| `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) |
|
||||||
| `cache-image` | Bool | `true` | Cache binfmt image to GitHub Actions cache backend |
|
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,10 @@ describe('getInputs', () => {
|
||||||
test.each([
|
test.each([
|
||||||
[
|
[
|
||||||
0,
|
0,
|
||||||
new Map<string, string>([
|
new Map<string, string>([]),
|
||||||
['cache-image', 'true'],
|
|
||||||
]),
|
|
||||||
{
|
{
|
||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'all',
|
platforms: 'all',
|
||||||
cacheImage: true,
|
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|
@ -30,24 +27,20 @@ describe('getInputs', () => {
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['image', 'docker/binfmt:latest'],
|
['image', 'docker/binfmt:latest'],
|
||||||
['platforms', 'arm64,riscv64,arm'],
|
['platforms', 'arm64,riscv64,arm'],
|
||||||
['cache-image', 'false'],
|
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
image: 'docker/binfmt:latest',
|
image: 'docker/binfmt:latest',
|
||||||
platforms: 'arm64,riscv64,arm',
|
platforms: 'arm64,riscv64,arm',
|
||||||
cacheImage: false,
|
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
2,
|
2,
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['platforms', 'arm64, riscv64, arm '],
|
['platforms', 'arm64, riscv64, arm '],
|
||||||
['cache-image', 'true'],
|
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'arm64,riscv64,arm',
|
platforms: 'arm64,riscv64,arm',
|
||||||
cacheImage: true,
|
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,6 @@ inputs:
|
||||||
description: 'Platforms to install (e.g. arm64,riscv64,arm)'
|
description: 'Platforms to install (e.g. arm64,riscv64,arm)'
|
||||||
default: 'all'
|
default: 'all'
|
||||||
required: false
|
required: false
|
||||||
cache-image:
|
|
||||||
description: 'Cache binfmt image to GitHub Actions cache backend'
|
|
||||||
default: 'true'
|
|
||||||
required: false
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
platforms:
|
platforms:
|
||||||
|
|
@ -27,4 +23,3 @@ outputs:
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
post: 'dist/index.js'
|
|
||||||
|
|
|
||||||
42
dist/index.js
generated
vendored
42
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
31
dist/licenses.txt
generated
vendored
31
dist/licenses.txt
generated
vendored
|
|
@ -2358,6 +2358,9 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
dot-object
|
||||||
|
MIT
|
||||||
|
|
||||||
encoding
|
encoding
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) 2012-2014 Andris Reinman
|
Copyright (c) 2012-2014 Andris Reinman
|
||||||
|
|
@ -2559,6 +2562,31 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
is-plain-object
|
||||||
|
MIT
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014-2017, Jon Schlinkert.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
is-stream
|
is-stream
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
@ -3608,6 +3636,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
twirp-ts
|
||||||
|
MIT
|
||||||
|
|
||||||
undici
|
undici
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
|
||||||
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,9 +1,3 @@
|
||||||
target "_common" {
|
|
||||||
args = {
|
|
||||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["build"]
|
targets = ["build"]
|
||||||
}
|
}
|
||||||
|
|
@ -17,49 +11,42 @@ group "validate" {
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build" {
|
target "build" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-update"
|
target = "build-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build-validate" {
|
target "build-validate" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-validate"
|
target = "build-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "format" {
|
target "format" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "format-update"
|
target = "format-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "lint" {
|
target "lint" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "lint"
|
target = "lint"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor" {
|
target "vendor" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-validate" {
|
target "vendor-validate" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-validate"
|
target = "vendor-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
inherits = ["_common"]
|
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "test-coverage"
|
target = "test-coverage"
|
||||||
output = ["./coverage"]
|
output = ["./coverage"]
|
||||||
|
|
|
||||||
28
package.json
28
package.json
|
|
@ -23,24 +23,24 @@
|
||||||
],
|
],
|
||||||
"author": "Docker Inc.",
|
"author": "Docker Inc.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.10.1",
|
||||||
"@docker/actions-toolkit": "^0.67.0"
|
"@docker/actions-toolkit": "^0.31.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.19.9",
|
"@types/node": "^20.12.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
||||||
"@typescript-eslint/parser": "^7.18.0",
|
"@typescript-eslint/parser": "^7.9.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"eslint": "^8.57.1",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^9.1.2",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-jest": "^28.14.0",
|
"eslint-plugin-jest": "^28.5.0",
|
||||||
"eslint-plugin-prettier": "^5.5.4",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.2.5",
|
||||||
"ts-jest": "^29.4.1",
|
"ts-jest": "^29.1.2",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.2"
|
"typescript": "^5.4.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,11 @@ import {Util} from '@docker/actions-toolkit/lib/util';
|
||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
image: string;
|
image: string;
|
||||||
platforms: string;
|
platforms: string;
|
||||||
cacheImage: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInputs(): Inputs {
|
export function getInputs(): Inputs {
|
||||||
return {
|
return {
|
||||||
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: Util.getInputList('platforms').join(',') || 'all',
|
platforms: Util.getInputList('platforms').join(',') || 'all'
|
||||||
cacheImage: core.getBooleanInput('cache-image')
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
src/main.ts
16
src/main.ts
|
|
@ -1,8 +1,8 @@
|
||||||
import * as context from './context';
|
import * as context from './context';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as actionsToolkit from '@docker/actions-toolkit';
|
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||||
|
|
||||||
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
|
||||||
|
import {Exec} from '@docker/actions-toolkit/lib/exec';
|
||||||
|
|
||||||
interface Platforms {
|
interface Platforms {
|
||||||
supported: string[];
|
supported: string[];
|
||||||
|
|
@ -20,11 +20,7 @@ actionsToolkit.run(
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Pulling binfmt Docker image`, async () => {
|
await core.group(`Pulling binfmt Docker image`, async () => {
|
||||||
await Docker.pull(input.image, input.cacheImage);
|
await Exec.getExecOutput('docker', ['pull', input.image], {
|
||||||
});
|
|
||||||
|
|
||||||
await core.group(`Image info`, async () => {
|
|
||||||
await Docker.getExecOutput(['image', 'inspect', input.image], {
|
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
|
@ -33,8 +29,8 @@ actionsToolkit.run(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Binfmt version`, async () => {
|
await core.group(`Image info`, async () => {
|
||||||
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--version'], {
|
await Exec.getExecOutput('docker', ['image', 'inspect', input.image], {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
|
@ -44,7 +40,7 @@ actionsToolkit.run(
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Installing QEMU static binaries`, async () => {
|
await core.group(`Installing QEMU static binaries`, async () => {
|
||||||
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
|
await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms], {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
|
@ -54,7 +50,7 @@ actionsToolkit.run(
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Extracting available platforms`, async () => {
|
await core.group(`Extracting available platforms`, async () => {
|
||||||
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image], {
|
await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image], {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true
|
silent: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue