@@ -3,19 +3,24 @@ name: Build
33on :
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)'
8- required : false
912 default : ' '
1013 type : string
1114 parallel :
1215 description : ' Massive parallel build of each image'
13- required : false
1416 default : true
1517 type : boolean
18+ name :
19+ description : " Name (for spin overrides)"
20+ default : " infix"
21+ type : string
1622 infix_repo :
1723 description : ' Repo to checkout (for spin overrides)'
18- required : false
1924 default : kernelkit/infix
2025 type : string
2126
3641 required : false
3742 type : string
3843 default : kernelkit/infix
44+ parallel :
45+ required : false
46+ type : boolean
47+ default : false
3948
4049env :
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 }}
4152 FLV : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.flavor || inputs.flavor }}
4253 INFIX_REPO : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.infix_repo || inputs.infix_repo }}
4354
4455jobs :
4556 build :
46- 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 }}
4758 runs-on : [ self-hosted, latest ]
4859 strategy :
4960 fail-fast : false
8091 | tee -a $GITHUB_OUTPUT $GITHUB_ENV
8192 fi
8293
83- target=${{ inputs.target }}
84- name=${{ inputs.name }}
94+ target=${{ env.TARGET }}
95+ name=${{ env.NAME }}
8596 echo "dir=${name}-${target}" >> $GITHUB_OUTPUT
8697 echo "tgz=${name}-${target}.tar.gz" >> $GITHUB_OUTPUT
8798 echo "flv=$FLV" >> $GITHUB_OUTPUT
@@ -99,16 +110,16 @@ jobs:
99110 uses : actions/cache@v4
100111 with :
101112 path : .ccache/
102- key : ccache-${{ inputs.target }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
113+ key : ccache-${{ env.TARGET }}-${{ hashFiles('.git/modules/buildroot/HEAD', 'package/*/*.hash') }}
103114 restore-keys : |
104- ccache-${{ inputs.target }}-
115+ ccache-${{ env.TARGET }}-
105116 ccache-
106117
107- - name : Configure ${{ inputs.target }}${{ steps.vars.outputs.flv }}
118+ - name : Configure ${{ env.TARGET }}${{ steps.vars.outputs.flv }}
108119 run : |
109- make ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig
120+ make ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig
110121
111- - name : Unit Test ${{ inputs.target }}
122+ - name : Unit Test ${{ env.TARGET }}
112123 run : |
113124 make test-unit
114125
@@ -126,9 +137,9 @@ jobs:
126137 fi
127138 echo "MAKE=$MAKE" >> $GITHUB_OUTPUT
128139
129- - name : Build ${{ inputs.target }}${{ steps.vars.outputs.flv }}
140+ - name : Build ${{ env.TARGET }}${{ steps.vars.outputs.flv }}
130141 run : |
131- echo "Building ${{ inputs.target }}${{ steps.vars.outputs.flv }}_defconfig ..."
142+ echo "Building ${{ env.TARGET }}${{ steps.vars.outputs.flv }}_defconfig ..."
132143 eval "${{ steps.parallel.outputs.MAKE }}"
133144
134145 - name : Check SBOM from Build
@@ -150,7 +161,7 @@ jobs:
150161 printf "Size of output/images/: "
151162 ls -l output/images/
152163
153- - name : Prepare ${{ inputs.target }} Artifact
164+ - name : Prepare ${{ env.TARGET }} Artifact
154165 run : |
155166 cd output/
156167 mv images ${{ steps.vars.outputs.dir }}
@@ -160,4 +171,4 @@ jobs:
160171 - uses : actions/upload-artifact@v4
161172 with :
162173 path : output/${{ steps.vars.outputs.tgz }}
163- name : artifact-${{ inputs.target }}
174+ name : artifact-${{ env.TARGET }}
0 commit comments