Skip to content
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

Add multiarch support for amd64, arm64/v8 & ppc64le using buildx #483

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Setup Go
uses: actions/setup-go@v2
with:
Expand Down
68 changes: 64 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ builds:
goarch:
- amd64
- arm64
- ppc64le

dockers:
- image_templates:
- pseudomuto/{{.ProjectName}}:latest
- pseudomuto/{{.ProjectName}}:{{.Version}}
- pseudomuto/{{.ProjectName}}:{{.Major}}
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}
- pseudomuto/{{.ProjectName}}:latest-amd64
- pseudomuto/{{.ProjectName}}:{{.Version}}-amd64
- pseudomuto/{{.ProjectName}}:{{.Major}}-amd64
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}-amd64
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -33,6 +35,64 @@ dockers:
- LICENSE.md
- README.md
- script/entrypoint.sh
- image_templates:
- pseudomuto/{{.ProjectName}}:latest-arm64v8
- pseudomuto/{{.ProjectName}}:{{.Version}}-arm64v8
- pseudomuto/{{.ProjectName}}:{{.Major}}-arm64v8
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}-arm64v8
use: buildx
goarch: arm64
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64/v8"
extra_files:
- LICENSE.md
- README.md
- script/entrypoint.sh
- image_templates:
- pseudomuto/{{.ProjectName}}:latest-ppc64le
- pseudomuto/{{.ProjectName}}:{{.Version}}-ppc64le
- pseudomuto/{{.ProjectName}}:{{.Major}}-ppc64le
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}-ppc64le
use: buildx
goarch: ppc64le
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/ppc64le"
extra_files:
- LICENSE.md
- README.md
- script/entrypoint.sh

docker_manifests:
- name_template: pseudomuto/{{.ProjectName}}:latest
image_templates:
- pseudomuto/{{.ProjectName}}:latest-amd64
- pseudomuto/{{.ProjectName}}:latest-arm64v8
- pseudomuto/{{.ProjectName}}:latest-ppc64le
- name_template: pseudomuto/{{.ProjectName}}:{{.Version}}
image_templates:
- pseudomuto/{{.ProjectName}}:{{.Version}}-amd64
- pseudomuto/{{.ProjectName}}:{{.Version}}-arm64v8
- pseudomuto/{{.ProjectName}}:{{.Version}}-ppc64le
- name_template: pseudomuto/{{.ProjectName}}:{{.Major}}
image_templates:
- pseudomuto/{{.ProjectName}}:{{.Major}}-amd64
- pseudomuto/{{.ProjectName}}:{{.Major}}-arm64v8
- pseudomuto/{{.ProjectName}}:{{.Major}}-ppc64le
- name_template: pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}
image_templates:
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}-amd64
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}-arm64v8
- pseudomuto/{{.ProjectName}}:{{.Major}}.{{.Minor}}-ppc64le

checksum:
name_template: 'checksums.txt'
Expand Down
14 changes: 3 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,18 @@ require (
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007
github.com/pseudomuto/protokit v0.2.0
github.com/stretchr/testify v1.6.1
google.golang.org/api v0.58.0
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4
)

require (
cloud.google.com/go v0.94.1 // indirect
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/sys v0.0.0-20210917161153-d61c044b1678 // indirect
golang.org/x/text v0.3.6 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/grpc v1.40.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
Loading