mirror of
https://gitea.com/docker/build-push-action.git
synced 2024-11-22 01:19:40 +01:00
Rename buildx-version input to version
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
c3b8f61f90
commit
8f0f662386
4 changed files with 18 additions and 18 deletions
4
.github/workflows/setup-buildx-ci.yml
vendored
4
.github/workflows/setup-buildx-ci.yml
vendored
|
@ -39,7 +39,7 @@ jobs:
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: ./setup-buildx/
|
uses: ./setup-buildx/
|
||||||
with:
|
with:
|
||||||
buildx-version: ${{ matrix.buildx-version }}
|
version: ${{ matrix.buildx-version }}
|
||||||
-
|
-
|
||||||
name: Builder instance name
|
name: Builder instance name
|
||||||
run: echo ${{ steps.buildx.outputs.name }}
|
run: echo ${{ steps.buildx.outputs.name }}
|
||||||
|
@ -155,7 +155,7 @@ jobs:
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: ./setup-buildx/
|
uses: ./setup-buildx/
|
||||||
with:
|
with:
|
||||||
buildx-version: ${{ matrix.buildx-version }}
|
version: ${{ matrix.buildx-version }}
|
||||||
-
|
-
|
||||||
name: Available platforms
|
name: Available platforms
|
||||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
|
|
@ -39,7 +39,7 @@ jobs:
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/actions/setup-buildx@v1
|
uses: docker/actions/setup-buildx@v1
|
||||||
with:
|
with:
|
||||||
buildx-version: latest
|
version: latest
|
||||||
-
|
-
|
||||||
name: Builder instance name
|
name: Builder instance name
|
||||||
run: echo ${{ steps.buildx.outputs.name }}
|
run: echo ${{ steps.buildx.outputs.name }}
|
||||||
|
@ -79,7 +79,7 @@ jobs:
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/actions/setup-buildx@v1
|
uses: docker/actions/setup-buildx@v1
|
||||||
with:
|
with:
|
||||||
buildx-version: latest
|
version: latest
|
||||||
-
|
-
|
||||||
name: Available platforms
|
name: Available platforms
|
||||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||||
|
@ -93,7 +93,7 @@ Following inputs can be used as `step.with` keys
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|------------------|---------|-----------------------------------|------------------------------------|
|
|------------------|---------|-----------------------------------|------------------------------------|
|
||||||
| `buildx-version` | String | _the one installed on the runner_ | [Buildx](https://github.com/docker/buildx) version. e.g. `v0.3.0`, `latest` |
|
| `version` | String | _the one installed on the runner_ | [Buildx](https://github.com/docker/buildx) version. e.g. `v0.3.0`, `latest` |
|
||||||
| `driver` | String | `docker-container` | Sets the [builder driver](https://github.com/docker/buildx#--driver-driver) to be used. |
|
| `driver` | String | `docker-container` | Sets the [builder driver](https://github.com/docker/buildx#--driver-driver) to be used. |
|
||||||
| `driver-opt` | String | | Passes additional [driver-specific options](https://github.com/docker/buildx#--driver-opt-options). e.g. `image=moby/buildkit:master` |
|
| `driver-opt` | String | | Passes additional [driver-specific options](https://github.com/docker/buildx#--driver-opt-options). e.g. `image=moby/buildkit:master` |
|
||||||
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
|
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
|
||||||
|
|
|
@ -7,7 +7,7 @@ branding:
|
||||||
icon: 'truck'
|
icon: 'truck'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
buildx-version:
|
version:
|
||||||
description: 'Buildx version. e.g. v0.3.0'
|
description: 'Buildx version. e.g. v0.3.0'
|
||||||
required: false
|
required: false
|
||||||
driver:
|
driver:
|
||||||
|
|
|
@ -12,16 +12,16 @@ async function run(): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildxVer: string = core.getInput('buildx-version');
|
const bxVersion: string = core.getInput('version');
|
||||||
const driver: string = core.getInput('driver') || 'docker-container';
|
const bxDriver: string = core.getInput('driver') || 'docker-container';
|
||||||
const driverOpt: string = core.getInput('driver-opt');
|
const bxDriverOpt: string = core.getInput('driver-opt');
|
||||||
const install: boolean = /true/i.test(core.getInput('install'));
|
const bxInstall: boolean = /true/i.test(core.getInput('install'));
|
||||||
const use: boolean = /true/i.test(core.getInput('use'));
|
const bxUse: boolean = /true/i.test(core.getInput('use'));
|
||||||
|
|
||||||
const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');
|
const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker');
|
||||||
|
|
||||||
if (!(await buildx.isAvailable()) || buildxVer) {
|
if (!(await buildx.isAvailable()) || bxVersion) {
|
||||||
await buildx.install(buildxVer || 'latest', dockerConfigHome);
|
await buildx.install(bxVersion || 'latest', dockerConfigHome);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info('📣 Buildx info');
|
core.info('📣 Buildx info');
|
||||||
|
@ -32,11 +32,11 @@ async function run(): Promise<void> {
|
||||||
stateHelper.setBuilderName(builderName);
|
stateHelper.setBuilderName(builderName);
|
||||||
|
|
||||||
core.info('🔨 Creating a new builder instance...');
|
core.info('🔨 Creating a new builder instance...');
|
||||||
let createArgs: Array<string> = ['buildx', 'create', '--name', builderName, '--driver', driver];
|
let createArgs: Array<string> = ['buildx', 'create', '--name', builderName, '--driver', bxDriver];
|
||||||
if (driverOpt) {
|
if (bxDriverOpt) {
|
||||||
createArgs.push('--driver-opt', driverOpt);
|
createArgs.push('--driver-opt', bxDriverOpt);
|
||||||
}
|
}
|
||||||
if (use) {
|
if (bxUse) {
|
||||||
createArgs.push('--use');
|
createArgs.push('--use');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ async function run(): Promise<void> {
|
||||||
core.info('🏃 Booting builder...');
|
core.info('🏃 Booting builder...');
|
||||||
await exec.exec('docker', ['buildx', 'inspect', '--bootstrap'], false);
|
await exec.exec('docker', ['buildx', 'inspect', '--bootstrap'], false);
|
||||||
|
|
||||||
if (install) {
|
if (bxInstall) {
|
||||||
core.info('🤝 Setting buildx as default builder...');
|
core.info('🤝 Setting buildx as default builder...');
|
||||||
await exec.exec('docker', ['buildx', 'install'], false);
|
await exec.exec('docker', ['buildx', 'install'], false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue