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' }}
@@ -185,7 +185,7 @@ jobs:
185185 matrix :
186186 platform : ${{ fromJson(needs.prepare.outputs.platforms) }}
187187 name : Build ${{ matrix.platform }} GNU static binary
188- runs-on : ubuntu-24.04
188+ runs-on : ${{ startsWith(matrix.platform, 'linux/arm') && ' ubuntu-24.04-arm' || 'ubuntu-24.04' }}
189189 needs : [prepare]
190190 steps :
191191 - name : Prepare
@@ -212,14 +212,14 @@ jobs:
212212 with :
213213 pull : true
214214 load : ${{ !fromJson(needs.prepare.outputs.push) }}
215- targets : gnu- static
215+ targets : static-builder-gnu
216216 set : |
217- ${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'gnu- static.args.NO_COMPRESS=1' || '' }}
217+ ${{ (github.event_name == 'pull_request' || matrix.platform == 'linux/arm64') && 'static-builder-gnu .args.NO_COMPRESS=1' || '' }}
218218 *.tags=
219219 *.platform=${{ matrix.platform }}
220- *.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-gnu- static
221- *.cache-from=type=gha,scope=refs/heads/main-gnu- static
222- *.cache-to=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-gnu- static,ignore-error=true
220+ *.cache-from=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-gnu
221+ *.cache-from=type=gha,scope=refs/heads/main-static-builder-gnu
222+ *.cache-to=type=gha,scope=${{ needs.prepare.outputs.ref || github.ref }}-static-builder-gnu ,ignore-error=true
223223 ${{ fromJson(needs.prepare.outputs.push) && format('*.output=type=image,name={0}-gnu,push-by-digest=true,name-canonical=true,push=true', env.IMAGE_NAME) || '' }}
224224 env :
225225 SHA : ${{ github.sha }}
@@ -232,24 +232,24 @@ jobs:
232232 mkdir -p /tmp/metadata-gnu
233233
234234 # shellcheck disable=SC2086
235- digest=$(jq -r '."gnu- static"."containerimage.digest"' <<< ${METADATA})
235+ digest=$(jq -r '."static-builder-gnu "."containerimage.digest"' <<< ${METADATA})
236236 touch "/tmp/metadata-gnu/${digest#sha256:}"
237237 env :
238238 METADATA : ${{ steps.build.outputs.metadata }}
239239 - name : Upload metadata
240240 if : fromJson(needs.prepare.outputs.push)
241241 uses : actions/upload-artifact@v4
242242 with :
243- name : metadata-gnu- static-${{ steps.prepare.outputs.sanitized_platform }}
243+ name : metadata-static-builder-gnu -${{ steps.prepare.outputs.sanitized_platform }}
244244 path : /tmp/metadata-gnu/*
245245 if-no-files-found : error
246246 retention-days : 1
247247 - name : Copy binary
248248 run : |
249249 # shellcheck disable=SC2034
250- digest=$(jq -r '."gnu- static"."${{ fromJson(needs.prepare.outputs.push) && 'containerimage.digest' || 'containerimage.config.digest' }}"' <<< "${METADATA}")
251- docker create --platform=${{ matrix.platform }} --name gnu- static "${{ fromJson(needs.prepare.outputs.push) && format('{0}-gnu@{1}', env.IMAGE_NAME, '${digest}') || '${digest}' }}"
252- docker cp "gnu- static:/go/src/app/dist/${BINARY}" "${BINARY}-gnu"
250+ digest=$(jq -r '."static-builder-gnu "."${{ fromJson(needs.prepare.outputs.push) && 'containerimage.digest' || 'containerimage.config.digest' }}"' <<< "${METADATA}")
251+ docker create --platform=${{ matrix.platform }} --name static-builder-gnu "${{ fromJson(needs.prepare.outputs.push) && format('{0}-gnu@{1}', env.IMAGE_NAME, '${digest}') || '${digest}' }}"
252+ docker cp "static-builder-gnu :/go/src/app/dist/${BINARY}" "${BINARY}-gnu"
253253 env :
254254 METADATA : ${{ steps.build.outputs.metadata }}
255255 BINARY : frankenphp-linux-${{ matrix.platform == 'linux/amd64' && 'x86_64' || 'aarch64' }}
@@ -291,13 +291,13 @@ jobs:
291291 - name : Download metadata
292292 uses : actions/download-artifact@v4
293293 with :
294- pattern : metadata-static-builder-*
294+ pattern : metadata-static-builder-musl- *
295295 path : /tmp/metadata
296296 merge-multiple : true
297297 - name : Download GNU metadata
298298 uses : actions/download-artifact@v4
299299 with :
300- pattern : metadata-gnu- static-*
300+ pattern : metadata-static-builder-gnu -*
301301 path : /tmp/metadata-gnu
302302 merge-multiple : true
303303 - name : Set up Docker Buildx
@@ -311,28 +311,28 @@ jobs:
311311 working-directory : /tmp/metadata
312312 run : |
313313 # shellcheck disable=SC2046,SC2086
314- docker buildx imagetools create $(jq -cr '.target."static-builder".tags | map("-t " + .) | join(" ")' <<< "${METADATA}") \
314+ docker buildx imagetools create $(jq -cr '.target."static-builder-musl ".tags | map("-t " + .) | join(" ")' <<< "${METADATA}") \
315315 $(printf "${IMAGE_NAME}@sha256:%s " *)
316316 env :
317317 METADATA : ${{ needs.prepare.outputs.metadata }}
318318 - name : Create GNU manifest list and push
319319 working-directory : /tmp/metadata-gnu
320320 run : |
321321 # shellcheck disable=SC2046,SC2086
322- docker buildx imagetools create $(jq -cr '.target."gnu- static".tags | map("-t " + . + "-gnu") | join(" ")' <<< "${GNU_METADATA}") \
322+ docker buildx imagetools create $(jq -cr '.target."static-builder-gnu ".tags | map("-t " + . + "-gnu") | join(" ")' <<< "${GNU_METADATA}") \
323323 $(printf "${IMAGE_NAME}-gnu@sha256:%s " *)
324324 env :
325325 GNU_METADATA : ${{ needs.prepare.outputs.gnu_metadata }}
326326 - name : Inspect image
327327 run : |
328328 # shellcheck disable=SC2046,SC2086
329- docker buildx imagetools inspect "$(jq -cr '.target."static-builder".tags | first' <<< "${METADATA}")"
329+ docker buildx imagetools inspect "$(jq -cr '.target."static-builder-musl ".tags | first' <<< "${METADATA}")"
330330 env :
331331 METADATA : ${{ needs.prepare.outputs.metadata }}
332332 - name : Inspect GNU image
333333 run : |
334334 # shellcheck disable=SC2046,SC2086
335- docker buildx imagetools inspect "$(jq -cr '.target."gnu- static".tags | first' <<< "${GNU_METADATA}")-gnu"
335+ docker buildx imagetools inspect "$(jq -cr '.target."static-builder-gnu ".tags | first' <<< "${GNU_METADATA}")-gnu"
336336 env :
337337 GNU_METADATA : ${{ needs.prepare.outputs.gnu_metadata }}
338338
0 commit comments