Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/.test-bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
contents: read
id-token: write
with:
job-name-prefix: bake-dockerhub-single
cache: true
cache-scope: bake-dockerhub-single
context: test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/.test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
contents: read
id-token: write
with:
job-name-prefix: build-dockerhub-single
build-args: |
VERSION={{meta.version}}
cache: true
Expand Down
28 changes: 24 additions & 4 deletions .github/workflows/bake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ on:
description: "Whether to cancel all in-progress and queued jobs in the matrix if any job fails"
required: false
default: false
job-name-prefix:
type: string
description: "Prefix to include in reusable workflow job matrix names in the GitHub Actions UI"
required: false
setup-qemu:
type: boolean
description: "Runs the setup-qemu-action step to install QEMU static binaries"
Expand Down Expand Up @@ -181,6 +185,10 @@ env:
jobs:
prepare:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- name: ${{ inputs.job-name-prefix }}
outputs:
includes: ${{ steps.set.outputs.includes }}
metaImages: ${{ steps.set.outputs.metaImages }}
Expand Down Expand Up @@ -280,6 +288,7 @@ jobs:
INPUT_RUNNER: ${{ inputs.runner }}
INPUT_DISTRIBUTE: ${{ inputs.distribute }}
INPUT_ARTIFACT-UPLOAD: ${{ inputs.artifact-upload }}
INPUT_JOB-NAME-PREFIX: ${{ inputs.job-name-prefix }}
INPUT_CONTEXT: ${{ inputs.context }}
INPUT_FILES: ${{ inputs.files }}
INPUT_OUTPUT: ${{ inputs.output }}
Expand All @@ -306,6 +315,7 @@ jobs:
const inpRunner = core.getMultilineInput('runner');
const inpDistribute = core.getBooleanInput('distribute');
const inpArtifactUpload = core.getBooleanInput('artifact-upload');
const inpJobNamePrefix = core.getInput('job-name-prefix');
const inpContext = core.getInput('context');
const inpVars = Util.getInputList('vars');
const inpFiles = Util.getInputList('files');
Expand Down Expand Up @@ -540,19 +550,25 @@ jobs:
});

await core.group(`Set includes output`, async () => {
const withJobNamePrefix = include => {
if (inpJobNamePrefix) {
return {name: inpJobNamePrefix, ...include};
}
return include;
};
let includes = [];
if (!inpDistribute || platforms.length === 0) {
includes.push({
includes.push(withJobNamePrefix({
index: 0,
runner: resolveRunner(runnerConfig)
});
}));
} else {
platforms.forEach((platform, index) => {
includes.push({
includes.push(withJobNamePrefix({
index: index,
platform: platform,
runner: resolveRunner(runnerConfig, platform)
});
}));
});
}
core.info(JSON.stringify(includes, null, 2));
Expand Down Expand Up @@ -1105,6 +1121,10 @@ jobs:

finalize:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- name: ${{ inputs.job-name-prefix }}
outputs:
meta-json: ${{ steps.meta.outputs.json }}
cosign-version: ${{ env.COSIGN_VERSION }}
Expand Down
28 changes: 24 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ on:
description: "Whether to cancel all in-progress and queued jobs in the matrix if any job fails"
required: false
default: false
job-name-prefix:
type: string
description: "Prefix to include in reusable workflow job matrix names in the GitHub Actions UI"
required: false
setup-qemu:
type: boolean
description: "Runs the setup-qemu-action step to install QEMU static binaries"
Expand Down Expand Up @@ -184,6 +188,10 @@ env:
jobs:
prepare:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- name: ${{ inputs.job-name-prefix }}
outputs:
includes: ${{ steps.set.outputs.includes }}
metaImages: ${{ steps.set.outputs.metaImages }}
Expand Down Expand Up @@ -275,6 +283,7 @@ jobs:
INPUT_RUNNER: ${{ inputs.runner }}
INPUT_DISTRIBUTE: ${{ inputs.distribute }}
INPUT_ARTIFACT-UPLOAD: ${{ inputs.artifact-upload }}
INPUT_JOB-NAME-PREFIX: ${{ inputs.job-name-prefix }}
INPUT_OUTPUT: ${{ inputs.output }}
INPUT_PLATFORMS: ${{ inputs.platforms }}
INPUT_PUSH: ${{ inputs.push }}
Expand All @@ -291,6 +300,7 @@ jobs:
const inpRunner = core.getMultilineInput('runner');
const inpDistribute = core.getBooleanInput('distribute');
const inpArtifactUpload = core.getBooleanInput('artifact-upload');
const inpJobNamePrefix = core.getInput('job-name-prefix');
const inpPlatforms = Util.getInputList('platforms');
const inpOutput = core.getInput('output');
const inpPush = core.getBooleanInput('push');
Expand Down Expand Up @@ -432,19 +442,25 @@ jobs:
});

await core.group(`Set includes output`, async () => {
const withJobNamePrefix = include => {
if (inpJobNamePrefix) {
return {name: inpJobNamePrefix, ...include};
}
return include;
};
let includes = [];
if (!inpDistribute || inpPlatforms.length === 0) {
includes.push({
includes.push(withJobNamePrefix({
index: 0,
runner: resolveRunner(runnerConfig)
});
}));
} else {
inpPlatforms.forEach((platform, index) => {
includes.push({
includes.push(withJobNamePrefix({
index: index,
platform: platform,
runner: resolveRunner(runnerConfig, platform)
});
}));
});
}
core.info(JSON.stringify(includes, null, 2));
Expand Down Expand Up @@ -960,6 +976,10 @@ jobs:

finalize:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- name: ${{ inputs.job-name-prefix }}
outputs:
meta-json: ${{ steps.meta.outputs.json }}
cosign-version: ${{ env.COSIGN_VERSION }}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ jobs:
| `runner` | String | See [Runner mapping](#runner-mapping) | GitHub-hosted Linux runner label or platform mapping to build on. See [Runner mapping](#runner-mapping). |
| `distribute` | Bool | `true` | Whether to distribute the build across multiple runners (one platform per runner) |
| `fail-fast` | Bool | `false` | Whether to cancel all in-progress and queued jobs in the matrix if any job fails |
| `job-name-prefix` | String | | Prefix to include in reusable workflow job matrix names in the GitHub Actions UI |
| `setup-qemu` | Bool | `false` | Runs the `setup-qemu-action` step to install QEMU static binaries |
| `artifact-name` | String | `docker-github-builder-assets` | Name of the uploaded GitHub artifact (for `local` output) |
| `artifact-upload` | Bool | `false` | Upload build output GitHub artifact (for `local` output) |
Expand Down Expand Up @@ -330,6 +331,7 @@ jobs:
| `runner` | String | See [Runner mapping](#runner-mapping) | GitHub-hosted Linux runner label or platform mapping to build on. See [Runner mapping](#runner-mapping). |
| `distribute` | Bool | `true` | Whether to distribute the build across multiple runners (one platform per runner) |
| `fail-fast` | Bool | `false` | Whether to cancel all in-progress and queued jobs in the matrix if any job fails |
| `job-name-prefix` | String | | Prefix to include in reusable workflow job matrix names in the GitHub Actions UI |
| `setup-qemu` | Bool | `false` | Runs the `setup-qemu-action` step to install QEMU static binaries |
| `artifact-name` | String | `docker-github-builder-assets` | Name of the uploaded GitHub artifact (for `local` output) |
| `artifact-upload` | Bool | `false` | Upload build output GitHub artifact (for `local` output) |
Expand Down
Loading