From 8f0f6623865f50ccc8a246940a21f0642c79b2fe Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 13 Aug 2020 10:42:57 +0200 Subject: [PATCH] Rename buildx-version input to version Signed-off-by: CrazyMax --- .github/workflows/setup-buildx-ci.yml | 4 ++-- setup-buildx/README.md | 6 +++--- setup-buildx/action.yml | 2 +- setup-buildx/src/main.ts | 24 ++++++++++++------------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/setup-buildx-ci.yml b/.github/workflows/setup-buildx-ci.yml index ffa6971..790f2ad 100644 --- a/.github/workflows/setup-buildx-ci.yml +++ b/.github/workflows/setup-buildx-ci.yml @@ -39,7 +39,7 @@ jobs: id: buildx uses: ./setup-buildx/ with: - buildx-version: ${{ matrix.buildx-version }} + version: ${{ matrix.buildx-version }} - name: Builder instance name run: echo ${{ steps.buildx.outputs.name }} @@ -155,7 +155,7 @@ jobs: id: buildx uses: ./setup-buildx/ with: - buildx-version: ${{ matrix.buildx-version }} + version: ${{ matrix.buildx-version }} - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} diff --git a/setup-buildx/README.md b/setup-buildx/README.md index 910e37a..63d1b67 100644 --- a/setup-buildx/README.md +++ b/setup-buildx/README.md @@ -39,7 +39,7 @@ jobs: id: buildx uses: docker/actions/setup-buildx@v1 with: - buildx-version: latest + version: latest - name: Builder instance name run: echo ${{ steps.buildx.outputs.name }} @@ -79,7 +79,7 @@ jobs: id: buildx uses: docker/actions/setup-buildx@v1 with: - buildx-version: latest + version: latest - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} @@ -93,7 +93,7 @@ Following inputs can be used as `step.with` keys | 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-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` | diff --git a/setup-buildx/action.yml b/setup-buildx/action.yml index 73485dd..dd5b155 100644 --- a/setup-buildx/action.yml +++ b/setup-buildx/action.yml @@ -7,7 +7,7 @@ branding: icon: 'truck' inputs: - buildx-version: + version: description: 'Buildx version. e.g. v0.3.0' required: false driver: diff --git a/setup-buildx/src/main.ts b/setup-buildx/src/main.ts index ce7312d..77f8cd4 100644 --- a/setup-buildx/src/main.ts +++ b/setup-buildx/src/main.ts @@ -12,16 +12,16 @@ async function run(): Promise { return; } - const buildxVer: string = core.getInput('buildx-version'); - const driver: string = core.getInput('driver') || 'docker-container'; - const driverOpt: string = core.getInput('driver-opt'); - const install: boolean = /true/i.test(core.getInput('install')); - const use: boolean = /true/i.test(core.getInput('use')); + const bxVersion: string = core.getInput('version'); + const bxDriver: string = core.getInput('driver') || 'docker-container'; + const bxDriverOpt: string = core.getInput('driver-opt'); + const bxInstall: boolean = /true/i.test(core.getInput('install')); + const bxUse: boolean = /true/i.test(core.getInput('use')); const dockerConfigHome: string = process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker'); - if (!(await buildx.isAvailable()) || buildxVer) { - await buildx.install(buildxVer || 'latest', dockerConfigHome); + if (!(await buildx.isAvailable()) || bxVersion) { + await buildx.install(bxVersion || 'latest', dockerConfigHome); } core.info('📣 Buildx info'); @@ -32,11 +32,11 @@ async function run(): Promise { stateHelper.setBuilderName(builderName); core.info('🔨 Creating a new builder instance...'); - let createArgs: Array = ['buildx', 'create', '--name', builderName, '--driver', driver]; - if (driverOpt) { - createArgs.push('--driver-opt', driverOpt); + let createArgs: Array = ['buildx', 'create', '--name', builderName, '--driver', bxDriver]; + if (bxDriverOpt) { + createArgs.push('--driver-opt', bxDriverOpt); } - if (use) { + if (bxUse) { createArgs.push('--use'); } @@ -45,7 +45,7 @@ async function run(): Promise { core.info('🏃 Booting builder...'); await exec.exec('docker', ['buildx', 'inspect', '--bootstrap'], false); - if (install) { + if (bxInstall) { core.info('🤝 Setting buildx as default builder...'); await exec.exec('docker', ['buildx', 'install'], false); }