diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2de4066..c6f33491 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,9 @@ on: jobs: release: runs-on: ubuntu-latest + env: + DOCKER_CLI_EXPERIMENTAL: "enabled" + steps: - uses: actions/checkout@v2 with: @@ -18,6 +21,12 @@ jobs: with: go-version: 1.19 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub uses: docker/login-action@v1 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 72636bbf..ea100d6a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -34,13 +34,22 @@ snapshot: changelog: sort: asc dockers: - - goos: linux + - image_templates: ["vektra/mockery:{{ .Tag }}-amd64"] goarch: amd64 - image_templates: - - 'vektra/mockery:{{ .Tag }}' - - 'vektra/mockery:v{{ .Major }}' - - 'vektra/mockery:v{{ .Major }}.{{ .Minor }}' - - 'vektra/mockery:latest' + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.name={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/amd64" + - image_templates: ["vektra/mockery:{{ .Tag }}-arm64"] + goarch: arm64 + dockerfile: Dockerfile + use: buildx build_flag_templates: - "--pull" - "--label=org.opencontainers.image.created={{.Date}}" @@ -48,6 +57,24 @@ dockers: - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" - "--label=org.opencontainers.image.source={{.GitURL}}" + - "--platform=linux/arm64" +docker_manifests: + - name_template: vektra/mockery:{{ .Tag }} + image_templates: + - vektra/mockery:{{ .Tag }}-amd64 + - vektra/mockery:{{ .Tag }}-arm64 + - name_template: vektra/mockery:v{{ .Major }} + image_templates: + - vektra/mockery:{{ .Tag }}-amd64 + - vektra/mockery:{{ .Tag }}-arm64 + - name_template: vektra/mockery:v{{ .Major }}.{{ .Minor }} + image_templates: + - vektra/mockery:{{ .Tag }}-amd64 + - vektra/mockery:{{ .Tag }}-arm64 + - name_template: vektra/mockery:latest + image_templates: + - vektra/mockery:{{ .Tag }}-amd64 + - vektra/mockery:{{ .Tag }}-arm64 brews: - homepage: https://github.com/vektra/mockery description: "A mock code autogenerator for Go"