diff --git a/.goreleaser.yml b/.goreleaser.yml index 5027916..b662d3b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -108,11 +108,47 @@ archives: - goos: windows format: zip -# TODO(joem): multi-arch docker image: https://goreleaser.com/cookbooks/multi-platform-docker-images/ dockers: - dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--platform=linux/amd64" image_templates: - - "ghcr.io/autotag-dev/autotag:{{ .Tag }}" # v1.0.0 - - "ghcr.io/autotag-dev/autotag:v{{ .Major }}" # v1 - - "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}" # v1.0 - - "ghcr.io/autotag-dev/autotag:latest" + - "ghcr.io/autotag-dev/autotag:{{ .Tag }}-amd64" # v1.0.0-amd64 + - "ghcr.io/autotag-dev/autotag:v{{ .Major }}-amd64" # v1-amd64 + - "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-amd64" # v1.0-amd64 + - "ghcr.io/autotag-dev/autotag:latest-amd64" + + - dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--pull" + - "--platform=linux/arm64" + image_templates: + - "ghcr.io/autotag-dev/autotag:{{ .Tag }}-arm64" # v1.0.0-arm64 + - "ghcr.io/autotag-dev/autotag:v{{ .Major }}-arm64" # v1-arm64 + - "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-arm64" # v1.0-arm64 + - "ghcr.io/autotag-dev/autotag:latest-arm64" + +# use `docker_manifests` section to create combined multi-arch image manifests: +docker_manifests: + - name_template: "ghcr.io/autotag-dev/autotag:{{ .Tag }}" + image_templates: + - "ghcr.io/autotag-dev/autotag:{{ .Tag }}-amd64" + - "ghcr.io/autotag-dev/autotag:{{ .Tag }}-arm64" + + - name_template: "ghcr.io/autotag-dev/autotag:{{ .Major }}" + image_templates: + - "ghcr.io/autotag-dev/autotag:{{ .Major }}-amd64" + - "ghcr.io/autotag-dev/autotag:{{ .Major }}-arm64" + + - name_template: "ghcr.io/autotag-dev/autotag:{{ .Major }}.{{ .Minor }}" + image_templates: + - "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-amd64" + - "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-arm64" + + - name_template: "ghcr.io/autotag-dev/autotag:latest" + image_templates: + - "ghcr.io/autotag-dev/autotag:latest-amd64" + - "ghcr.io/autotag-dev/autotag:latest-arm64" diff --git a/Makefile b/Makefile index e21bd54..9145078 100644 --- a/Makefile +++ b/Makefile @@ -19,4 +19,4 @@ cov: go tool cover -func cover.out snapshot: - @goreleaser --rm-dist --snapshot --debug \ No newline at end of file + @goreleaser release --clean --snapshot --verbose \ No newline at end of file diff --git a/README.md b/README.md index 41b4925..834bdbc 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,19 @@ Installing ### Pre-built binaries | OS | Arch | binary | -| ----- | ----- | ------------------- | +|-------|-------|---------------------| | macOS | amd64 | [autotag][releases] | | Linux | amd64 | [autotag][releases] | ### Docker images -| Arch | Images | -| ----- | ---------------------------------------------------------------- | -| amd64 | `ghcr.io/autotag-dev/autotag:latest`, `vX.Y.Z`, `vX.Y`, `vX` | +> multi-arch and -arm64 images are available beginning with v1.3.34 + +| Arch | Images | +|------------|--------------------------------------------------------------------------------------| +| multi-arch | `ghcr.io/autotag-dev/autotag:latest`, `vX.Y.Z`, `vX.Y`, `vX` | +| amd64 | `ghcr.io/autotag-dev/autotag:latest-amd64`, `vX.Y.Z-amd64`, `vX.Y-amd64`, `vX-amd64` | +| arm64 | `ghcr.io/autotag-dev/autotag:latest-arm64`, `vX.Y.Z-arm64`, `vX.Y-arm64`, `vX-arm64` | [releases]: https://github.com/autotag-dev/autotag/releases/latest