Skip to content

Commit

Permalink
fix(action): build package-operator image for amd64, arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
mocdaniel authored and pmig committed Feb 12, 2024
1 parent 3b83d21 commit 38e1cc5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
registry: ghcr.io
username: glasskube-bot
password: ${{ secrets.GLASSKUBE_BOT_SECRET }}
- name: Setup qemu
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
Expand Down
37 changes: 33 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,31 @@ builds:
binary: package-operator

dockers:
- use: docker
- image_templates:
- "ghcr.io/glasskube/package-operator:{{.Tag}}-amd64"
- "ghcr.io/glasskube/package-operator:latest-amd64"
use: buildx
dockerfile: release.Dockerfile
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- '--label=org.opencontainers.image.title="Glasskube package-operator"'
- "--label=org.opencontainers.image.vendor=Glasskube"
- "--label=org.opencontainers.image.licenses=Apache-2.0"
- "--label=org.opencontainers.image.source=https://github.com/glasskube/glasskube/"
- "--label=org.opencontainers.image.url=https://glasskube.dev/"
- "--label=org.opencontainers.image.documentation=https://glasskube.dev/docs/"
- image_templates:
- "ghcr.io/glasskube/package-operator:{{.Tag}}-arm64"
- "ghcr.io/glasskube/package-operator:latest-arm64"
use: buildx
dockerfile: release.Dockerfile
image_templates:
- "ghcr.io/glasskube/package-operator:{{.Tag}}"
- "ghcr.io/glasskube/package-operator:latest"
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
Expand All @@ -49,6 +67,17 @@ dockers:
- "--label=org.opencontainers.image.source=https://github.com/glasskube/glasskube/"
- "--label=org.opencontainers.image.url=https://glasskube.dev/"
- "--label=org.opencontainers.image.documentation=https://glasskube.dev/docs/"
goarch: arm64

docker_manifests:
- name_template: "ghcr.io/glasskube/package-operator:{{.Tag}}"
image_templates:
- "ghcr.io/glasskube/package-operator:{{.Tag}}-amd64"
- "ghcr.io/glasskube/package-operator:{{.Tag}}-arm64"
- name_template: "ghcr.io/glasskube/package-operator:latest"
image_templates:
- "ghcr.io/glasskube/package-operator:latest-amd64"
- "ghcr.io/glasskube/package-operator:latest-arm64"

nfpms:
- file_name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Arch }}"
Expand Down

0 comments on commit 38e1cc5

Please sign in to comment.