5959 - name : Create platforms matrix
6060 id : matrix
6161 run : |
62- METADATA="$(docker buildx bake --print static-builder | jq -c)"
63- GNU_METADATA="$(docker buildx bake --print gnu- static | jq -c)"
62+ METADATA="$(docker buildx bake --print static-builder-musl | jq -c)"
63+ GNU_METADATA="$(docker buildx bake --print static-builder-gnu | jq -c)"
6464 {
6565 echo metadata="${METADATA}"
6666 echo platforms="$(jq -c 'first(.target[]) | .platforms' <<< "${METADATA}")"
@@ -110,16 +110,16 @@ jobs:
110110 with :
111111 pull : true
112112 load : ${{ !fromJson(needs.prepare.outputs.push) || matrix.debug || matrix.mimalloc }}
113- targets : static-builder
113+ targets : static-builder-musl
114114 set : |
115- ${{ matrix.debug && 'static-builder.args.DEBUG_SYMBOLS=1' || '' }}
116- ${{ matrix.mimalloc && 'static-builder.args.MIMALLOC=1' || '' }}
117- ${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'static-builder.args.NO_COMPRESS=1' || '' }}
115+ ${{ matrix.debug && 'static-builder-musl .args.DEBUG_SYMBOLS=1' || '' }}
116+ ${{ matrix.mimalloc && 'static-builder-musl .args.MIMALLOC=1' || '' }}
117+ ${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'static-builder-musl .args.NO_COMPRESS=1' || '' }}
118118 *.tags=
119119 *.platform=${{ matrix.platform }}
120- *.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }}
121- *.cache-from=type=gha,scope=refs/heads/main-static-builder${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }}
122- *.cache-to=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }},ignore-error=true
120+ *.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-musl ${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }}
121+ *.cache-from=type=gha,scope=refs/heads/main-static-builder-musl ${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }}
122+ *.cache-to=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-musl ${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }},ignore-error=true
123123 ${{ (fromJson(needs.prepare.outputs.push) && !matrix.debug && !matrix.mimalloc) && format('*.output=type=image,name={0},push-by-digest=true,name-canonical=true,push=true', env.IMAGE_NAME) || '' }}
124124 env :
125125 SHA : ${{ github.sha }}
@@ -132,24 +132,24 @@ jobs:
132132 mkdir -p /tmp/metadata
133133
134134 # shellcheck disable=SC2086
135- digest=$(jq -r '."static-builder"."containerimage.digest"' <<< ${METADATA})
135+ digest=$(jq -r '."static-builder-musl "."containerimage.digest"' <<< ${METADATA})
136136 touch "/tmp/metadata/${digest#sha256:}"
137137 env :
138138 METADATA : ${{ steps.build.outputs.metadata }}
139139 - name : Upload metadata
140140 if : fromJson(needs.prepare.outputs.push) && !matrix.debug && !matrix.mimalloc
141141 uses : actions/upload-artifact@v4
142142 with :
143- name : metadata-static-builder-${{ steps.prepare.outputs.sanitized_platform }}
143+ name : metadata-static-builder-musl- ${{ steps.prepare.outputs.sanitized_platform }}
144144 path : /tmp/metadata/*
145145 if-no-files-found : error
146146 retention-days : 1
147147 - name : Copy binary
148148 run : |
149149 # shellcheck disable=SC2034
150- digest=$(jq -r '."static-builder"."${{ (fromJson(needs.prepare.outputs.push) && !matrix.debug && !matrix.mimalloc) && 'containerimage.digest' || 'containerimage.config.digest' }}"' <<< "${METADATA}")
151- docker create --platform=${{ matrix.platform }} --name static-builder "${{ (fromJson(needs.prepare.outputs.push) && !matrix.debug && !matrix.mimalloc) && '${IMAGE_NAME}@${digest}' || '${digest}' }}"
152- docker cp "static-builder:/go/src/app/dist/${BINARY}" "${BINARY}${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }}"
150+ digest=$(jq -r '."static-builder-musl "."${{ (fromJson(needs.prepare.outputs.push) && !matrix.debug && !matrix.mimalloc) && 'containerimage.digest' || 'containerimage.config.digest' }}"' <<< "${METADATA}")
151+ docker create --platform=${{ matrix.platform }} --name static-builder-musl "${{ (fromJson(needs.prepare.outputs.push) && !matrix.debug && !matrix.mimalloc) && '${IMAGE_NAME}@${digest}' || '${digest}' }}"
152+ docker cp "static-builder-musl :/go/src/app/dist/${BINARY}" "${BINARY}${{ matrix.debug && '-debug' || '' }}${{ matrix.mimalloc && '-mimalloc' || '' }}"
153153 env :
154154 METADATA : ${{ steps.build.outputs.metadata }}
155155 BINARY : frankenphp-linux-${{ matrix.platform == 'linux/amd64' && 'x86_64' || 'aarch64' }}
@@ -186,7 +186,7 @@ jobs:
186186 matrix :
187187 platform : ${{ fromJson(needs.prepare.outputs.platforms) }}
188188 name : Build ${{ matrix.platform }} GNU static binary
189- runs-on : ubuntu-24.04
189+ runs-on : ${{ startsWith(matrix.platform, 'linux/arm') && ' ubuntu-24.04-arm' || 'ubuntu-24.04' }}
190190 needs : [prepare]
191191 steps :
192192 - name : Prepare
@@ -213,14 +213,14 @@ jobs:
213213 with :
214214 pull : true
215215 load : ${{ !fromJson(needs.prepare.outputs.push) }}
216- targets : gnu- static
216+ targets : static-builder-gnu
217217 set : |
218- ${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'gnu- static.args.NO_COMPRESS=1' || '' }}
218+ ${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'static-builder-gnu .args.NO_COMPRESS=1' || '' }}
219219 *.tags=
220220 *.platform=${{ matrix.platform }}
221- *.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-gnu- static
222- *.cache-from=type=gha,scope=refs/heads/main-gnu- static
223- *.cache-to=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-gnu- static,ignore-error=true
221+ *.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-gnu
222+ *.cache-from=type=gha,scope=refs/heads/main-static-builder-gnu
223+ *.cache-to=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-gnu ,ignore-error=true
224224 ${{ fromJson(needs.prepare.outputs.push) && format('*.output=type=image,name={0}-gnu,push-by-digest=true,name-canonical=true,push=true', env.IMAGE_NAME) || '' }}
225225 env :
226226 SHA : ${{ github.sha }}
@@ -233,24 +233,24 @@ jobs:
233233 mkdir -p /tmp/metadata-gnu
234234
235235 # shellcheck disable=SC2086
236- digest=$(jq -r '."gnu- static"."containerimage.digest"' <<< ${METADATA})
236+ digest=$(jq -r '."static-builder-gnu "."containerimage.digest"' <<< ${METADATA})
237237 touch "/tmp/metadata-gnu/${digest#sha256:}"
238238 env :
239239 METADATA : ${{ steps.build.outputs.metadata }}
240240 - name : Upload metadata
241241 if : fromJson(needs.prepare.outputs.push)
242242 uses : actions/upload-artifact@v4
243243 with :
244- name : metadata-gnu- static-${{ steps.prepare.outputs.sanitized_platform }}
244+ name : metadata-static-builder-gnu -${{ steps.prepare.outputs.sanitized_platform }}
245245 path : /tmp/metadata-gnu/*
246246 if-no-files-found : error
247247 retention-days : 1
248248 - name : Copy binary
249249 run : |
250250 # shellcheck disable=SC2034
251- digest=$(jq -r '."gnu- static"."${{ fromJson(needs.prepare.outputs.push) && 'containerimage.digest' || 'containerimage.config.digest' }}"' <<< "${METADATA}")
252- docker create --platform=${{ matrix.platform }} --name gnu- static "${{ fromJson(needs.prepare.outputs.push) && format('{0}-gnu@{1}', env.IMAGE_NAME, '${digest}') || '${digest}' }}"
253- docker cp "gnu- static:/go/src/app/dist/${BINARY}" "${BINARY}-gnu"
251+ digest=$(jq -r '."static-builder-gnu "."${{ fromJson(needs.prepare.outputs.push) && 'containerimage.digest' || 'containerimage.config.digest' }}"' <<< "${METADATA}")
252+ docker create --platform=${{ matrix.platform }} --name static-builder-gnu "${{ fromJson(needs.prepare.outputs.push) && format('{0}-gnu@{1}', env.IMAGE_NAME, '${digest}') || '${digest}' }}"
253+ docker cp "static-builder-gnu :/go/src/app/dist/${BINARY}" "${BINARY}-gnu"
254254 env :
255255 METADATA : ${{ steps.build.outputs.metadata }}
256256 BINARY : frankenphp-linux-${{ matrix.platform == 'linux/amd64' && 'x86_64' || 'aarch64' }}
@@ -292,13 +292,13 @@ jobs:
292292 - name : Download metadata
293293 uses : actions/download-artifact@v4
294294 with :
295- pattern : metadata-static-builder-*
295+ pattern : metadata-static-builder-musl- *
296296 path : /tmp/metadata
297297 merge-multiple : true
298298 - name : Download GNU metadata
299299 uses : actions/download-artifact@v4
300300 with :
301- pattern : metadata-gnu- static-*
301+ pattern : metadata-static-builder-gnu -*
302302 path : /tmp/metadata-gnu
303303 merge-multiple : true
304304 - name : Set up Docker Buildx
@@ -312,28 +312,28 @@ jobs:
312312 working-directory : /tmp/metadata
313313 run : |
314314 # shellcheck disable=SC2046,SC2086
315- docker buildx imagetools create $(jq -cr '.target."static-builder".tags | map("-t " + .) | join(" ")' <<< "${METADATA}") \
315+ docker buildx imagetools create $(jq -cr '.target."static-builder-musl ".tags | map("-t " + .) | join(" ")' <<< "${METADATA}") \
316316 $(printf "${IMAGE_NAME}@sha256:%s " *)
317317 env :
318318 METADATA : ${{ needs.prepare.outputs.metadata }}
319319 - name : Create GNU manifest list and push
320320 working-directory : /tmp/metadata-gnu
321321 run : |
322322 # shellcheck disable=SC2046,SC2086
323- docker buildx imagetools create $(jq -cr '.target."gnu- static".tags | map("-t " + . + "-gnu") | join(" ")' <<< "${GNU_METADATA}") \
323+ docker buildx imagetools create $(jq -cr '.target."static-builder-gnu ".tags | map("-t " + . + "-gnu") | join(" ")' <<< "${GNU_METADATA}") \
324324 $(printf "${IMAGE_NAME}-gnu@sha256:%s " *)
325325 env :
326326 GNU_METADATA : ${{ needs.prepare.outputs.gnu_metadata }}
327327 - name : Inspect image
328328 run : |
329329 # shellcheck disable=SC2046,SC2086
330- docker buildx imagetools inspect "$(jq -cr '.target."static-builder".tags | first' <<< "${METADATA}")"
330+ docker buildx imagetools inspect "$(jq -cr '.target."static-builder-musl ".tags | first' <<< "${METADATA}")"
331331 env :
332332 METADATA : ${{ needs.prepare.outputs.metadata }}
333333 - name : Inspect GNU image
334334 run : |
335335 # shellcheck disable=SC2046,SC2086
336- docker buildx imagetools inspect "$(jq -cr '.target."gnu- static".tags | first' <<< "${GNU_METADATA}")-gnu"
336+ docker buildx imagetools inspect "$(jq -cr '.target."static-builder-gnu ".tags | first' <<< "${GNU_METADATA}")-gnu"
337337 env :
338338 GNU_METADATA : ${{ needs.prepare.outputs.gnu_metadata }}
339339
0 commit comments