mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-05-25 20:21:52 +00:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3f1544eb9e | ||
|
f3204bbfac | ||
|
4ba329ef89 | ||
|
e600775e52 | ||
|
b2b2ffa946 | ||
|
fe905840cd | ||
|
8998bbe94b | ||
|
830833e0c7 | ||
|
941183f0a0 | ||
|
311b62b254 | ||
|
afeb29a6e0 | ||
|
b560416601 | ||
|
516bb780e5 | ||
|
11445527f0 |
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@ -5,6 +5,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *'
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
@ -516,7 +517,7 @@ jobs:
|
|||||||
cleanup: ${{ matrix.cleanup }}
|
cleanup: ${{ matrix.cleanup }}
|
||||||
|
|
||||||
k3s:
|
k3s:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -529,9 +530,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Install k3s
|
name: Install k3s
|
||||||
uses: crazy-max/.github/.github/actions/install-k3s@605d30d5ae97f6680578ace4b56645af79343e60
|
uses: crazy-max/.github/.github/actions/install-k3s@f5cb4a109b7a3b466a2ac293ef4bb13f1571acd7
|
||||||
with:
|
|
||||||
version: "v1.21.2-k3s1"
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
@ -583,3 +582,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: v0.11.2
|
version: v0.11.2
|
||||||
cache-binary: ${{ matrix.cache }}
|
cache-binary: ${{ matrix.cache }}
|
||||||
|
|
||||||
|
windows-error:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
continue-on-error: true
|
||||||
|
uses: ./
|
||||||
|
-
|
||||||
|
name: Check
|
||||||
|
run: |
|
||||||
|
echo "${{ toJson(steps.buildx) }}"
|
||||||
|
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
|
||||||
|
echo "::error::Should have failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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
|
20
dist/index.js
generated
vendored
20
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
@ -26,7 +26,7 @@
|
|||||||
"packageManager": "yarn@3.6.3",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@docker/actions-toolkit": "^0.56.0",
|
"@docker/actions-toolkit": "^0.61.0",
|
||||||
"js-yaml": "^4.1.0"
|
"js-yaml": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
13
src/main.ts
13
src/main.ts
@ -179,6 +179,7 @@ actionsToolkit.run(
|
|||||||
throw new Error(`Cannot set buildx as default builder without the Docker CLI`);
|
throw new Error(`Cannot set buildx as default builder without the Docker CLI`);
|
||||||
}
|
}
|
||||||
await core.group(`Setting buildx as default builder`, async () => {
|
await core.group(`Setting buildx as default builder`, async () => {
|
||||||
|
stateHelper.setBuildxIsDefaultBuilder(true);
|
||||||
const installCmd = await toolkit.buildx.getCommand(['install']);
|
const installCmd = await toolkit.buildx.getCommand(['install']);
|
||||||
await Exec.getExecOutput(installCmd.command, installCmd.args, {
|
await Exec.getExecOutput(installCmd.command, installCmd.args, {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
@ -279,5 +280,17 @@ actionsToolkit.run(
|
|||||||
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
fs.rmSync(stateHelper.certsDir, {recursive: true});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stateHelper.buildxIsDefaultBuilder) {
|
||||||
|
await core.group(`Restoring default builder`, async () => {
|
||||||
|
await Exec.getExecOutput('docker', ['buildx', 'uninstall'], {
|
||||||
|
ignoreReturnCode: true
|
||||||
|
}).then(res => {
|
||||||
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
core.warning(`${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -8,6 +8,7 @@ export const containerName = process.env['STATE_containerName'] || '';
|
|||||||
export const certsDir = process.env['STATE_certsDir'] || '';
|
export const certsDir = process.env['STATE_certsDir'] || '';
|
||||||
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
|
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
|
||||||
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
|
||||||
|
export const buildxIsDefaultBuilder = /true/i.test(process.env['STATE_buildxIsDefaultBuilder'] || '');
|
||||||
|
|
||||||
export function setDebug(debug: string) {
|
export function setDebug(debug: string) {
|
||||||
core.saveState('isDebug', debug);
|
core.saveState('isDebug', debug);
|
||||||
@ -40,3 +41,7 @@ export function setTmpDockerContext(tmpDockerContext: string) {
|
|||||||
export function setCleanup(cleanup: boolean) {
|
export function setCleanup(cleanup: boolean) {
|
||||||
core.saveState('cleanup', cleanup);
|
core.saveState('cleanup', cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setBuildxIsDefaultBuilder(buildxIsDefaultBuilder: boolean) {
|
||||||
|
core.saveState('buildxIsDefaultBuilder', buildxIsDefaultBuilder);
|
||||||
|
}
|
||||||
|
30
yarn.lock
30
yarn.lock
@ -12,9 +12,9 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@actions/artifact@npm:^2.2.2":
|
"@actions/artifact@npm:^2.3.2":
|
||||||
version: 2.2.2
|
version: 2.3.2
|
||||||
resolution: "@actions/artifact@npm:2.2.2"
|
resolution: "@actions/artifact@npm:2.3.2"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.10.0
|
"@actions/core": ^1.10.0
|
||||||
"@actions/github": ^5.1.1
|
"@actions/github": ^5.1.1
|
||||||
@ -28,13 +28,13 @@ __metadata:
|
|||||||
archiver: ^7.0.1
|
archiver: ^7.0.1
|
||||||
jwt-decode: ^3.1.2
|
jwt-decode: ^3.1.2
|
||||||
unzip-stream: ^0.3.1
|
unzip-stream: ^0.3.1
|
||||||
checksum: 1501b3d0ceb671f370786ccf70014de9586c5a78c95d235248fc16c73bf928f8de2aa932a679258f6d9bc2f2e570648d830551af9f063298f05d19f3330b33bc
|
checksum: 78ee41b43800accb2f3527e1733217c43d53693e7f96ce2470b16890fb84f5c2ebaaa6048ccdb6cfe188b54c02779ec99623c6932558e757f6829cfde203cf2c
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@actions/cache@npm:^4.0.2":
|
"@actions/cache@npm:^4.0.3":
|
||||||
version: 4.0.2
|
version: 4.0.3
|
||||||
resolution: "@actions/cache@npm:4.0.2"
|
resolution: "@actions/cache@npm:4.0.3"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.11.1
|
"@actions/core": ^1.11.1
|
||||||
"@actions/exec": ^1.0.1
|
"@actions/exec": ^1.0.1
|
||||||
@ -46,7 +46,7 @@ __metadata:
|
|||||||
"@azure/storage-blob": ^12.13.0
|
"@azure/storage-blob": ^12.13.0
|
||||||
"@protobuf-ts/plugin": ^2.9.4
|
"@protobuf-ts/plugin": ^2.9.4
|
||||||
semver: ^6.3.1
|
semver: ^6.3.1
|
||||||
checksum: 208f11238a26194f331b329bb99d50a87c1a3ccef1dbae181e5c142b3faf41715203e0c5cbc491519d3d97540a68fbd418c25fb6e16caabf76248c40867c02b4
|
checksum: ee9c2a21a70bd3f35c63f302af478e23f135c26deb77ea2e4eed29c62766a4b201fc7435651c0d56fa504c02d203107e3bdfda1dba18a3ee09338e1dfc3f2fe8
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -1088,12 +1088,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@docker/actions-toolkit@npm:^0.56.0":
|
"@docker/actions-toolkit@npm:^0.61.0":
|
||||||
version: 0.56.0
|
version: 0.61.0
|
||||||
resolution: "@docker/actions-toolkit@npm:0.56.0"
|
resolution: "@docker/actions-toolkit@npm:0.61.0"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/artifact": ^2.2.2
|
"@actions/artifact": ^2.3.2
|
||||||
"@actions/cache": ^4.0.2
|
"@actions/cache": ^4.0.3
|
||||||
"@actions/core": ^1.11.1
|
"@actions/core": ^1.11.1
|
||||||
"@actions/exec": ^1.1.1
|
"@actions/exec": ^1.1.1
|
||||||
"@actions/github": ^6.0.0
|
"@actions/github": ^6.0.0
|
||||||
@ -1113,7 +1113,7 @@ __metadata:
|
|||||||
semver: ^7.7.1
|
semver: ^7.7.1
|
||||||
tar-stream: ^3.1.7
|
tar-stream: ^3.1.7
|
||||||
tmp: ^0.2.3
|
tmp: ^0.2.3
|
||||||
checksum: 0f1b569f8bb206399f8c26e566c78e30e4a311bbd64486016e7fa1d35fbbb4c94d4f55afa6b711afa4b41c5835b40b038f48c3d1bfdfdc6f7c6680973e922d9e
|
checksum: 60cc6c8f5bde8221a3d6a40c15258d44a468950353098f1814d8af3a14131df9c41df5b87298cd82f5c77aa4e36e262c15a5bb0cc03ea2857bea18c9e0952d80
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -3161,7 +3161,7 @@ __metadata:
|
|||||||
resolution: "docker-setup-buildx@workspace:."
|
resolution: "docker-setup-buildx@workspace:."
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/core": ^1.11.1
|
"@actions/core": ^1.11.1
|
||||||
"@docker/actions-toolkit": ^0.56.0
|
"@docker/actions-toolkit": ^0.61.0
|
||||||
"@types/js-yaml": ^4.0.9
|
"@types/js-yaml": ^4.0.9
|
||||||
"@types/node": ^20.12.12
|
"@types/node": ^20.12.12
|
||||||
"@types/uuid": ^10.0.0
|
"@types/uuid": ^10.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user