From f3a41864fe25faf94ea667f7c8f0a3faaaee1c57 Mon Sep 17 00:00:00 2001 From: Travis Cotton Date: Tue, 14 May 2024 15:29:44 -0600 Subject: [PATCH] update to .goreleaser.yaml to build arm64 and amd64 images, then create/push the manifest --- .goreleaser.yaml | 60 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index e61f116..795fbdd 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -14,9 +14,9 @@ builds: goos: - linux goarch: - - amd64 - arm64 - no_unique_dist_dir: true + - amd64 + no_unique_dist_dir: false tags: - dynamic - id: bss-init @@ -27,29 +27,69 @@ builds: goarch: - amd64 - arm64 - no_unique_dist_dir: true + no_unique_dist_dir: false tags: - dynamic dockers: - - - image_templates: - - ghcr.io/openchami/{{.ProjectName}}:latest - - ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }} - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }} - - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }} + - image_templates: + - ghcr.io/openchami/{{.ProjectName}}:latest-amd64 + - ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-amd64 + - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-amd64 + - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64 build_flag_templates: - "--pull" + - "--platform=linux/amd64" - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.title={{.ProjectName}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" + goarch: amd64 + use: buildx extra_files: - LICENSE - CHANGELOG.md - README.md - .version - migrations/ + - image_templates: + - ghcr.io/openchami/{{.ProjectName}}:latest-arm64 + - ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-arm64 + - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-arm64 + - ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64 + build_flag_templates: + - "--pull" + - "--platform=linux/arm64" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + goarch: arm64 + use: buildx + extra_files: + - LICENSE + - CHANGELOG.md + - README.md + - .version + - migrations/ + +docker_manifests: +- name_template: 'ghcr.io/openchami/{{.ProjectName}}:latest' + image_templates: + - 'ghcr.io/openchami/{{.ProjectName}}:latest-amd64' + - 'ghcr.io/openchami/{{.ProjectName}}:latest-arm64' +- name_template: 'ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}' + image_templates: + - 'ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-amd64' + - 'ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}-arm64' +- name_template: 'ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}' + image_templates: + - 'ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-amd64' + - 'ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}-arm64' +- name_template: 'ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}' + image_templates: + - 'ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-amd64' + - 'ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}-arm64' archives: - format: tar.gz @@ -66,7 +106,6 @@ archives: - CHANGELOG.md - README.md - checksum: name_template: 'checksums.txt' snapshot: @@ -78,7 +117,6 @@ changelog: - '^docs:' - '^test:' - # The lines beneath this are called `modelines`. See `:help modeline` # Feel free to remove those if you don't want/use them. # yaml-language-server: $schema=https://goreleaser.com/static/schema.json