Skip to content

Commit b865593

Browse files
committed
.github: add name and target parameter to dispatch build
Signed-off-by: Richard Alpe <[email protected]>
1 parent ea2627d commit b865593

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Build
33
on:
44
workflow_dispatch:
55
inputs:
6+
target:
7+
description: "Build target (e.g. aarch64)"
8+
default: "x86_64"
9+
type: string
610
flavor:
711
description: 'Optional build flavor (e.g. _minimal)'
812
default: ''
@@ -11,6 +15,10 @@ on:
1115
description: 'Massive parallel build of each image'
1216
default: true
1317
type: boolean
18+
name:
19+
description: "Name (for spin overrides)"
20+
default: "infix"
21+
type: string
1422
infix_repo:
1523
description: 'Repo to checkout (for spin overrides)'
1624
default: kernelkit/infix
@@ -39,12 +47,14 @@ on:
3947
default: false
4048

4149
env:
50+
NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }}
51+
TARGET: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
4252
FLV: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.flavor || inputs.flavor }}
4353
INFIX_REPO: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }}
4454

4555
jobs:
4656
build:
47-
name: Build ${{ inputs.name }} ${{ inputs.target }}
57+
name: Build ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }}
4858
runs-on: [ self-hosted, latest ]
4959
strategy:
5060
fail-fast: false
@@ -81,8 +91,8 @@ jobs:
8191
| tee -a $GITHUB_OUTPUT $GITHUB_ENV
8292
fi
8393

84-
target=${{ inputs.target }}
85-
name=${{ inputs.name }}
94+
target=${{ env.TARGET }}
95+
name=${{ env.NAME }}
8696
echo "dir=${name}-${target}" >> $GITHUB_OUTPUT
8797
echo "tgz=${name}-${target}.tar.gz" >> $GITHUB_OUTPUT
8898
echo "flv=$FLV" >> $GITHUB_OUTPUT
@@ -100,16 +110,16 @@ jobs:
100110
uses: actions/cache@v4
101111
with:
102112
path: .ccache/
103-
key: ccache-${{ inputs.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
113+
key: ccache-${{ env.TARGET }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
104114
restore-keys: |
105-
ccache-${{ inputs.target }}-
115+
ccache-${{ env.TARGET }}-
106116
ccache-
107117

108-
- name: Configure ${{ inputs.target }}${{ steps.vars.outputs.flv }}
118+
- name: Configure ${{ env.TARGET }}${{ steps.vars.outputs.flv }}
109119
run: |
110-
make ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig
120+
make ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig
111121

112-
- name: Unit Test ${{ inputs.target }}
122+
- name: Unit Test ${{ env.TARGET }}
113123
run: |
114124
make test-unit
115125

@@ -127,9 +137,9 @@ jobs:
127137
fi
128138
echo "MAKE=$MAKE" >> $GITHUB_OUTPUT
129139

130-
- name: Build ${{ inputs.target }}${{ steps.vars.outputs.flv }}
140+
- name: Build ${{ env.TARGET }}${{ steps.vars.outputs.flv }}
131141
run: |
132-
echo "Building ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig ..."
142+
echo "Building ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig ..."
133143
eval "${{ steps.parallel.outputs.MAKE }}"
134144

135145
- name: Check SBOM from Build
@@ -151,7 +161,7 @@ jobs:
151161
printf "Size of output/images/: "
152162
ls -l output/images/
153163

154-
- name: Prepare ${{ inputs.target }} Artifact
164+
- name: Prepare ${{ env.TARGET }} Artifact
155165
run: |
156166
cd output/
157167
mv images ${{ steps.vars.outputs.dir }}
@@ -161,4 +171,4 @@ jobs:
161171
- uses: actions/upload-artifact@v4
162172
with:
163173
path: output/${{ steps.vars.outputs.tgz }}
164-
name: artifact-${{ inputs.target }}
174+
name: artifact-${{ env.TARGET }}

0 commit comments

Comments
 (0)