Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
publish:
name: Build and push the image
runs-on: ubuntu-latest
timeout-minutes: 30
# The arm64 build runs emulated; allow for it.
timeout-minutes: 90

steps:
- name: Check the publishing credentials are configured
Expand Down Expand Up @@ -151,6 +152,12 @@ jobs:
exit 1
fi

# The arm64 half of the manifest list runs its Bun install and Next build
# under emulation; the alternative, cross-building on amd64, would ship
# amd64-only native modules (sharp) inside the standalone output.
- name: Set up QEMU
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0

- name: Set up Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

Expand All @@ -162,13 +169,17 @@ jobs:
run: |
set -euo pipefail
output=--push
platforms=linux/amd64,linux/arm64
if [ "${DRY_RUN}" = "true" ]; then
# A dry run loads the image into the local daemon, which can hold
# one platform, so it rehearses the native build only.
output=--load
platforms=linux/amd64
fi
# Artifact Registry rejects buildx's default provenance/SBOM
# attestation manifest lists with HTTP 400.
docker buildx build \
--platform linux/amd64 \
--platform "${platforms}" \
--provenance=false \
--sbom=false \
--build-arg "BUILD=${TAG}" \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ merging the open release PR updates `CHANGELOG.md` and `package.json` and tags
the release as `vX.Y.Z`.

That tag publishes a container image to
`us-docker.pkg.dev/e2b-artifacts/dashboard/dashboard:vX.Y.Z` (`linux/amd64`,
anonymous pulls):
`us-docker.pkg.dev/e2b-artifacts/dashboard/dashboard:vX.Y.Z` (`linux/amd64` and
`linux/arm64`, anonymous pulls):

```bash
docker run --rm -p 3001:3001 us-docker.pkg.dev/e2b-artifacts/dashboard/dashboard:vX.Y.Z
Expand Down
7 changes: 4 additions & 3 deletions tests/unit/publish-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { describe, expect, it } from 'vitest'

/**
* The publish path cannot be exercised outside a release, so these assertions
* guard the flags it cannot go without: the registry it pushes to, the single
* architecture, and the attestation switches Artifact Registry rejects.
* guard the flags it cannot go without: the registry it pushes to, the two
* architectures, and the attestation switches Artifact Registry rejects.
*/
const read = (relativePath: string) =>
readFileSync(join(process.cwd(), relativePath), 'utf8')
Expand Down Expand Up @@ -33,7 +33,8 @@ describe('publish workflow', () => {
expect(workflow).toContain(
'us-docker.pkg.dev/e2b-artifacts/dashboard/dashboard'
)
expect(workflow).toContain('--platform linux/amd64')
expect(workflow).toContain('platforms=linux/amd64,linux/arm64')
expect(workflow).toContain('docker/setup-qemu-action@')
})

it('disables the attestations Artifact Registry rejects', () => {
Expand Down
Loading