Skip to content

Commit

Permalink
Display buildx version
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Dec 17, 2021
1 parent b7937ba commit 9e2adc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Expand Up @@ -38,14 +38,6 @@ jobs:
with:
version: ${{ matrix.buildx-version }}
standalone: ${{ matrix.standalone }}
-
name: Check version
run: |
if [ "${{ matrix.standalone }}" = "true" ]; then
buildx version
else
docker buildx version
fi
-
name: Inspect builder
run: |
Expand Down Expand Up @@ -376,14 +368,6 @@ jobs:
with:
version: https://github.com/docker/buildx.git#${{ matrix.ref }}
standalone: ${{ matrix.standalone }}
-
name: Check version
run: |
if [ "${{ matrix.standalone }}" = "true" ]; then
buildx version
else
docker buildx version
fi
-
name: Create Dockerfile
run: |
Expand Down
6 changes: 6 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/main.ts
Expand Up @@ -6,6 +6,7 @@ import * as stateHelper from './state-helper';
import * as util from './util';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import {parseVersion} from './buildx';

async function run(): Promise<void> {
try {
Expand Down Expand Up @@ -37,6 +38,13 @@ async function run(): Promise<void> {
}

const buildxVersion = await buildx.getVersion(inputs.standalone);
await core.group(`Buildx version`, async () => {
const versionCmd = buildx.getCommand(['version'], inputs.standalone);
await exec.exec(versionCmd.commandLine, versionCmd.args, {
failOnStdErr: false
});
});

const builderName: string = inputs.driver == 'docker' ? 'default' : `builder-${require('uuid').v4()}`;
context.setOutput('name', builderName);
stateHelper.setBuilderName(builderName);
Expand Down

0 comments on commit 9e2adc3

Please sign in to comment.