From 6db07c964e35038db12d728995985815c9fbc172 Mon Sep 17 00:00:00 2001 From: Miha Lunar Date: Sat, 6 Jan 2024 20:21:37 +0100 Subject: [PATCH] Build for x64 & arm --- .github/workflows/release.yml | 4 ++++ .goreleaser.yml | 40 +++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8060dd..141ebaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,10 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up QEMU for Multiarch Builds + uses: docker/setup-qemu-action@v3 + - name: Run GoReleaser (Push) if: github.event_name == 'push' uses: goreleaser/goreleaser-action@v4 diff --git a/.goreleaser.yml b/.goreleaser.yml index f102190..19714f7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -23,11 +23,43 @@ builds: - embedgeo dockers: - dockerfile: Dockerfile-goreleaser + use: buildx image_templates: - - "ghcr.io/smilyorg/photofield:{{ .Tag }}" - - "ghcr.io/smilyorg/photofield:v{{ .Major }}" - - "ghcr.io/smilyorg/photofield:v{{ .Major }}.{{ .Minor }}" - - "ghcr.io/smilyorg/photofield:latest" + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-amd64" + build_flag_templates: + - "--pull" + - "--platform=linux/amd64" + + - dockerfile: Dockerfile-goreleaser + use: buildx + image_templates: + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-arm64" + build_flag_templates: + - "--pull" + - "--platform=linux/arm64" + goarch: arm64 + +docker_manifests: + - name_template: "ghcr.io/smilyorg/photofield:{{ .Tag }}" + image_templates: + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-amd64" + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-arm64" + + - name_template: "ghcr.io/smilyorg/photofield:v{{ .Major }}" + image_templates: + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-amd64" + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-arm64" + + - name_template: "ghcr.io/smilyorg/photofield:v{{ .Major }}.{{ .Minor }}" + image_templates: + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-amd64" + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-arm64" + + - name_template: "ghcr.io/smilyorg/photofield:latest" + image_templates: + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-amd64" + - "ghcr.io/smilyorg/photofield:{{ .Tag }}-arm64" + archives: - format: zip name_template: >-