From aa5908418eba8f9837ce6d1cfcca3019cf78be45 Mon Sep 17 00:00:00 2001 From: luxingmin Date: Wed, 24 Mar 2021 11:13:04 +0800 Subject: [PATCH 1/2] [feature] support multi arch --- .github/workflows/release.yml | 9 +++++++ .goreleaser.yml | 47 ++++++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e65f33eca8..84501c9f2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,15 @@ jobs: - name: Install gox run: GO111MODULE=off go get github.com/mitchellh/gox + - name: "Set up QEMU" + uses: docker/setup-qemu-action@master + with: + platforms: all + + - name: "Set up Docker buildx" + uses: "docker/setup-buildx-action@master" + id: "buildx" + - name: Login to Docker Hub uses: docker/login-action@v1 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 3e1e29321d..37f8a279c9 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -27,6 +27,7 @@ builds: - amd64 - "386" - arm + - arm64 ignore: - goos: darwin goarch: "386" @@ -72,14 +73,48 @@ signs: signature: ${artifact}.sig artifacts: none dockers: - - - ids: + - ids: - centrifugo goos: linux goarch: amd64 goarm: '' image_templates: - - "centrifugo/centrifugo:{{ .Tag }}" - - "centrifugo/centrifugo:v{{ .Major }}" - - "centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }}" - - "centrifugo/centrifugo:latest" + - "centrifugo/centrifugo:{{ .Tag }}-amd64" + - "centrifugo/centrifugo:v{{ .Major }}-amd64" + - "centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }}-amd64" + - "centrifugo/centrifugo:latest-amd64" + use_buildx: true + build_flag_templates: + - "--platform=linux/amd64" + - "--load" + - ids: + - centrifugo + goos: linux + goarch: arm64 + goarm: '' + image_templates: + - "centrifugo/centrifugo:{{ .Tag }}-arm64" + - "centrifugo/centrifugo:v{{ .Major }}-arm64" + - "centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }}-arm64" + - "centrifugo/centrifugo:latest-arm64" + use_buildx: true + build_flag_templates: + - "--platform=linux/arm64" + - "--load" +docker_manifests: + - name_template: centrifugo/centrifugo:{{ .Tag }} + image_templates: + - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-amd64 + - name_template: centrifugo/centrifugo:v{{ .Major }} + image_templates: + - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-amd64 + - name_template: centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }} + image_templates: + - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-amd64 + - name_template: centrifugo/centrifugo:latest + image_templates: + - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-amd64 \ No newline at end of file From 4520f715d60b916441da603eefada448600b8cdc Mon Sep 17 00:00:00 2001 From: luxingmin Date: Wed, 24 Mar 2021 16:40:08 +0800 Subject: [PATCH 2/2] [feature] support multi arch --- .github/workflows/release.yml | 7 +++---- .goreleaser.yml | 28 +++++++++++++++------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84501c9f2a..38417d107e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,14 +27,13 @@ jobs: run: GO111MODULE=off go get github.com/mitchellh/gox - name: "Set up QEMU" - uses: docker/setup-qemu-action@master + uses: docker/setup-qemu-action@v1 with: platforms: all - name: "Set up Docker buildx" - uses: "docker/setup-buildx-action@master" - id: "buildx" - + uses: "docker/setup-buildx-action@v1" + - name: Login to Docker Hub uses: docker/login-action@v1 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 37f8a279c9..1e74b171a3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -41,6 +41,10 @@ builds: goarch: arm - goos: freebsd goarch: arm + - goos: windows + goarch: arm64 + - goos: freebsd + goarch: arm64 main: . ldflags: -s -w -X main.VERSION={{.Version}} binary: centrifugo @@ -77,7 +81,6 @@ dockers: - centrifugo goos: linux goarch: amd64 - goarm: '' image_templates: - "centrifugo/centrifugo:{{ .Tag }}-amd64" - "centrifugo/centrifugo:v{{ .Major }}-amd64" @@ -86,35 +89,34 @@ dockers: use_buildx: true build_flag_templates: - "--platform=linux/amd64" - - "--load" + - "--pull" - ids: - centrifugo goos: linux goarch: arm64 - goarm: '' image_templates: - - "centrifugo/centrifugo:{{ .Tag }}-arm64" - - "centrifugo/centrifugo:v{{ .Major }}-arm64" - - "centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }}-arm64" - - "centrifugo/centrifugo:latest-arm64" + - "centrifugo/centrifugo:{{ .Tag }}-arm64v8" + - "centrifugo/centrifugo:v{{ .Major }}-arm64v8" + - "centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }}-arm64v8" + - "centrifugo/centrifugo:latest-arm64v8" use_buildx: true build_flag_templates: - - "--platform=linux/arm64" - - "--load" + - "--platform=linux/arm64/v8" + - "--pull" docker_manifests: - name_template: centrifugo/centrifugo:{{ .Tag }} image_templates: - - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-arm64v8 - centrifugo/centrifugo:{{ .Tag }}-amd64 - name_template: centrifugo/centrifugo:v{{ .Major }} image_templates: - - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-arm64v8 - centrifugo/centrifugo:{{ .Tag }}-amd64 - name_template: centrifugo/centrifugo:v{{ .Major }}.{{ .Minor }} image_templates: - - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-arm64v8 - centrifugo/centrifugo:{{ .Tag }}-amd64 - name_template: centrifugo/centrifugo:latest image_templates: - - centrifugo/centrifugo:{{ .Tag }}-arm64 + - centrifugo/centrifugo:{{ .Tag }}-arm64v8 - centrifugo/centrifugo:{{ .Tag }}-amd64 \ No newline at end of file