diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41cc06e..c1baf1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: matrix: buildx-version: - latest - - v0.2.2 + - v0.4.1 - "" steps: - @@ -183,7 +183,7 @@ jobs: matrix: buildx-version: - latest - - v0.2.2 + - v0.4.1 - "" qemu-platforms: - all diff --git a/__tests__/buildx.test.ts b/__tests__/buildx.test.ts index 6773bff..d95ae6c 100644 --- a/__tests__/buildx.test.ts +++ b/__tests__/buildx.test.ts @@ -43,8 +43,8 @@ describe('platforms', () => { describe('install', () => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-')); - it('acquires v0.2.2 version of buildx', async () => { - const buildxBin = await buildx.install('v0.2.2', tmpDir); + it('acquires v0.4.1 version of buildx', async () => { + const buildxBin = await buildx.install('v0.4.1', tmpDir); console.log(buildxBin); expect(fs.existsSync(buildxBin)).toBe(true); }, 100000); diff --git a/dist/index.js b/dist/index.js index a415efc..6ec37b1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -557,7 +557,11 @@ function run() { yield exec.exec('docker', createArgs); core.endGroup(); core.startGroup(`🏃 Booting builder`); - yield exec.exec('docker', ['buildx', 'inspect', '--bootstrap']); + let bootstrapArgs = ['buildx', 'inspect', '--bootstrap']; + if (semver.satisfies(buildxVersion, '>=0.4.0')) { + bootstrapArgs.push('--builder', builderName); + } + yield exec.exec('docker', bootstrapArgs); core.endGroup(); } if (inputs.install) { diff --git a/src/main.ts b/src/main.ts index 8a0e7e7..d5eb526 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,7 +52,11 @@ async function run(): Promise { core.endGroup(); core.startGroup(`🏃 Booting builder`); - await exec.exec('docker', ['buildx', 'inspect', '--bootstrap']); + let bootstrapArgs: Array = ['buildx', 'inspect', '--bootstrap']; + if (semver.satisfies(buildxVersion, '>=0.4.0')) { + bootstrapArgs.push('--builder', builderName); + } + await exec.exec('docker', bootstrapArgs); core.endGroup(); }