mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-30 17:50:07 +08:00
perf(ci): cross-compile the Go CLI and build dev images amd64-only
The docker-dev build took ~14 min, dominated by a ~12-min server-image build — its arm64 half runs under QEMU emulation (native better-sqlite3/sharp). - Dev images (:dev, :dev-cli) now build linux/amd64 only, skipping arm64 QEMU entirely. Releases stay multi-arch. (The primary dev consumer runs amd64.) - The Go CLI builder now runs on $BUILDPLATFORM and cross-compiles via GOOS/GOARCH (CGO off), so the release arm64 CLI builds natively instead of under QEMU — arm64 'go build' verified at ~5s vs emulated minutes. Adds go build/mod cache mounts for fast incremental rebuilds.
This commit is contained in:
@@ -125,7 +125,9 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
# Dev images are amd64-only to skip slow arm64 QEMU emulation
|
||||
# (native better-sqlite3/sharp). Releases stay multi-arch.
|
||||
platforms: linux/amd64
|
||||
build-args: |
|
||||
APP_VERSION=dev
|
||||
APP_COMMIT=${{ github.sha }}
|
||||
@@ -139,7 +141,8 @@ jobs:
|
||||
context: .
|
||||
target: cli
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
# Dev images are amd64-only (see server image above). Releases stay multi-arch.
|
||||
platforms: linux/amd64
|
||||
build-args: |
|
||||
APP_VERSION=dev
|
||||
APP_COMMIT=${{ github.sha }}
|
||||
|
||||
Reference in New Issue
Block a user