Skip to content

Commit 62a3259

Browse files
committed
gha/.build: support multiple distros values
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent 46b8bdc commit 62a3259

File tree

8 files changed

+33
-25
lines changed

8 files changed

+33
-25
lines changed

.github/workflows/.build.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
release:
1414
required: false
1515
type: string
16-
distro:
16+
distros:
1717
required: false
1818
type: string
1919

@@ -38,12 +38,19 @@ jobs:
3838
env:
3939
INPUT_NAME: ${{ inputs.name }}
4040
INPUT_RELEASE: ${{ inputs.release }}
41-
INPUT_DISTRO: ${{ inputs.distro }}
41+
INPUT_DISTROS: ${{ inputs.distros }}
4242
with:
4343
script: |
4444
const inpName = core.getInput('name');
4545
const inpRelease = core.getInput('release');
46-
const inpDistro = core.getInput('distro');
46+
const inpDistros = core.getInput('distros');
47+
let distroFilter = [];
48+
if (inpDistros) {
49+
distroFilter = inpDistros
50+
.split(',')
51+
.map(d => d.trim())
52+
.filter(d => d !== '');
53+
}
4754
4855
if (inpRelease !== '' && !['pushonly', 'draft', 'prerelease', 'release'].includes(inpRelease)) {
4956
throw new Error(`Invalid release type: ${inpRelease}`);
@@ -73,7 +80,8 @@ jobs:
7380
const pkgName = match[1];
7481
const distro = match[2];
7582
// Skip distros that don't match the input distro filter
76-
if (inpDistro !== '' && distro !== inpDistro) {
83+
if (distroFilter.length > 0 && !distroFilter.includes(distro)) {
84+
core.info(`Skipping ${targetName} because it doesn't match the input distro filter`);
7785
continue;
7886
}
7987
const target = def.target[targetName];

.github/workflows/release-buildx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu2204")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: buildx
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

.github/workflows/release-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build for'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu22.04")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: compose
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

.github/workflows/release-containerd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build for'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu22.04")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: containerd
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

.github/workflows/release-credential-helpers.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu22.04")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: credential-helpers
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

.github/workflows/release-docker-cli.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu22.04")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: docker-cli
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

.github/workflows/release-docker-engine.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu22.04")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: docker-engine
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

.github/workflows/release-model.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ on:
2525
- draft
2626
- prerelease
2727
- release
28-
distro:
29-
description: 'Single distro to build'
28+
distros:
29+
description: 'Distros to build (comma-separated, e.g. "debian12,ubuntu22.04")'
3030
required: false
3131
type: string
3232
default: ''
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
name: model
4646
release: ${{ inputs.release }}
47-
distro: ${{ inputs.distro }}
47+
distros: ${{ inputs.distros }}
4848
envs: |
4949
PKG_REPO=${{ inputs.repo }}
5050
PKG_REF=${{ inputs.ref }}

0 commit comments

Comments
 (0)