diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1923e88e2..77e320318 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -141,28 +141,24 @@ jobs: type=edge type=ref,event=branch - - name: Build Image (linux/amd64) - run: | - newcontainer=$(buildah from --platform=linux/amd64 scratch) - buildah copy --chmod=0755 $newcontainer ./artifact/x86_64-unknown-linux-musl/${{ needs.env.outputs.BINARY_NAME }} /${{ needs.env.outputs.BINARY_NAME }} - buildah config --entrypoint='["./${{ needs.env.outputs.BINARY_NAME }}"]' $newcontainer + - run: | + build() { + newcontainer=$(buildah from --platform="$1" scratch) + buildah copy --chmod=0755 $newcontainer ./artifact/"$2"/${{ needs.env.outputs.BINARY_NAME }} /${{ needs.env.outputs.BINARY_NAME }} + buildah config --entrypoint='["./${{ needs.env.outputs.BINARY_NAME }}"]' $newcontainer - buildah config --author="Mogyuchi" $(awk '{print "--label=" $0}' <<< "${{ steps.meta.outputs.labels }}") $newcontainer - buildah inspect $newcontainer + buildah config --author="Mogyuchi" $(awk '{print "--label=" $0}' <<< "${{ steps.meta.outputs.labels }}") $newcontainer + buildah inspect $newcontainer - buildah commit --manifest=localhost/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} $newcontainer - buildah rm $newcontainer + buildah commit --manifest=localhost/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} $newcontainer + buildah rm $newcontainer + } + - name: Build Image (linux/amd64) + run: | + build linux/amd64 x86_64-unknown-linux-musl - name: Build Image (linux/arm64) run: | - newcontainer=$(buildah from --platform=linux/arm64 scratch) - buildah copy --chmod=0755 $newcontainer ./artifact/aarch64-unknown-linux-musl/${{ needs.env.outputs.BINARY_NAME }} /${{ needs.env.outputs.BINARY_NAME }} - buildah config --entrypoint='["./${{ needs.env.outputs.BINARY_NAME }}"]' $newcontainer - - buildah config --author="Mogyuchi" $(awk '{print "--label=" $0}' <<< "${{ steps.meta.outputs.labels }}") $newcontainer - buildah inspect $newcontainer - - buildah commit --manifest=localhost/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} $newcontainer - buildah rm $newcontainer + build linux/arm64 aarch64-unknown-linux-musl - id: push name: Push To GHCR