-
Notifications
You must be signed in to change notification settings - Fork 1
Multi Platform Support #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c94915b
2412097
aa0c392
ecb09f7
3449b51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,24 +12,22 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| name: Test and Build | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v4 | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| cache: true | ||
| - name: Test | ||
| run: go test ./... | ||
|
|
||
| code_quality: | ||
| name: Code Quality🎖️ | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-go@v4 | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| cache: true | ||
| - uses: golangci/golangci-lint-action@v8 | ||
| - uses: golangci/golangci-lint-action@v9 | ||
|
Comment on lines
+26
to
+30
|
||
| with: | ||
| version: v2.10.1 | ||
| args: --timeout 9m0s | ||
|
|
@@ -67,7 +65,7 @@ jobs: | |
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: docker/setup-buildx-action@v3 | ||
|
|
||
|
|
@@ -84,9 +82,13 @@ jobs: | |
| push: true | ||
| context: . | ||
| file: Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| provenance: true | ||
| sbom: true | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| tags: | | ||
| ${{ vars.DOCKER_REGISTRY_TARGET }}:${{ env.RELEASE_VERSION }} | ||
|
|
||
| - name: Output Image Path | ||
| run: echo "Image pushed to ${{ vars.DOCKER_REGISTRY_TARGET }}:${{ env.RELEASE_VERSION }}" | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||
| # Build stage | ||||||||
| FROM golang:1.26 AS build | ||||||||
| # Build stage - runs on native platform, cross-compiles to target | ||||||||
| FROM --platform=$BUILDPLATFORM golang:1.26 AS build | ||||||||
|
||||||||
| FROM --platform=$BUILDPLATFORM golang:1.26 AS build | |
| FROM --platform=$BUILDPLATFORM golang:1.25.0 AS build |
Copilot
AI
Mar 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARG TARGETARCH is required for the GOARCH=${TARGETARCH} build. If someone builds with a non-BuildKit/legacy builder where TARGETARCH isn't automatically provided, this will produce an empty GOARCH and fail the build. Consider adding a safe default (e.g., fall back to go env GOARCH) so docker build . works reliably without requiring extra flags.
| RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /app/main main.go | |
| RUN export GOARCH=${TARGETARCH:-$(go env GOARCH)} \ | |
| && CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH go build -ldflags="-s -w" -o /app/main main.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go version in CI is pinned to
1.26whilego.moddeclaresgo 1.25.0. To keep toolchains consistent across local builds, Docker builds, and CI, consider aligning these (either bumpgo.modto 1.26 if intended, or run CI with 1.25.x).