Build each architecture natively instead of emulating arm64 - #1
Merged
Conversation
The publish job built linux/amd64 and linux/arm64 together under QEMU. This image compiles php extensions (gd, intl) during the build, which is close to the worst case for emulation — the last run spent over half an hour on publish while the round-trip test beside it finished in a few minutes. GitHub gives public repositories free arm64 runners, so nothing needs emulating. Each arch now builds on its own native runner and pushes by digest, and a small merge job stitches the digests into one multi-arch tag. Two details worth keeping: the build cache is scoped per-architecture, since a shared scope has the two jobs overwrite each other's layers; and no per-arch tags are pushed, since a tag written by both jobs ends up pointing at whichever finished last. The merge job names the image exactly once, then asserts both architectures are actually in the manifest so a silently half-published tag fails the run instead of shipping.
build/publish only ran on main or a tag, so a change to the build itself could not be tested before merging: the pull request showed a green roundtrip and said nothing about whether the image still publishes. Adding workflow_dispatch makes this very change verifiable on its branch.
actions/upload-artifact rejects ':' in a filename, so the export step failed after the image had already built and pushed successfully. The merge job was already written to expect the bare hex and re-add the prefix; only the export half was wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The publish job built
linux/amd64andlinux/arm64together under QEMU. This image compiles PHP extensions (gd,intl) during the build, which is close to the worst case for emulation — the last run onmainspent over half an hour on publish whileroundtripfinished in a few minutes.GitHub provides free arm64 runners for public repos, so neither architecture needs emulating. Each now builds on its own native runner and pushes by digest; a small merge job stitches the digests into one multi-arch tag.
Three details:
roundtripis untouched, so the required check behaves exactly as before.