Skip to content

Commit

Permalink
nice and forkable goreleaser (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
fopina authored Sep 15, 2024
1 parent 3a2d525 commit cf7f071
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ project_name: dkron
release:
prerelease: auto

env:
- IMAGE_PREFIX={{ if index .Env "IMAGE_PREFIX" }}{{ .Env.IMAGE_PREFIX }}{{ else }}dkron{{ end }}

builds:
- &xbuild
main: .
Expand Down Expand Up @@ -107,7 +110,7 @@ snapshot:

dockers:
- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-amd64
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-amd64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -127,7 +130,7 @@ dockers:
- --platform=linux/amd64

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-arm64
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-arm64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -137,7 +140,7 @@ dockers:
- --platform=linux/arm64/v8

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-armv7"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -148,7 +151,7 @@ dockers:
- --platform=linux/arm/v7

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-light-amd64
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-amd64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -159,7 +162,7 @@ dockers:
- --platform=linux/amd64

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-light-arm64
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-arm64"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -169,7 +172,7 @@ dockers:
- --platform=linux/arm64/v8

- image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-light-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-armv7"
dockerfile: Dockerfile.release
use: buildx
goos: linux
Expand All @@ -180,23 +183,29 @@ dockers:
- --platform=linux/arm/v7

docker_manifests:
- name_template: dkron/{{ .ProjectName }}:{{ .Version }}
- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}"
image_templates:
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-armv7"

- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:latest"
image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-amd64
- dkron/{{ .ProjectName }}:{{ .Version }}-arm64
- dkron/{{ .ProjectName }}:{{ .Version }}-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-armv7"

- name_template: dkron/{{ .ProjectName }}:latest
- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light"
image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-amd64
- dkron/{{ .ProjectName }}:{{ .Version }}-arm64
- dkron/{{ .ProjectName }}:{{ .Version }}-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-armv7"

- name_template: dkron/{{ .ProjectName }}:{{ .Version }}-light
- name_template: "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:light"
image_templates:
- dkron/{{ .ProjectName }}:{{ .Version }}-light-amd64
- dkron/{{ .ProjectName }}:{{ .Version }}-light-arm64
- dkron/{{ .ProjectName }}:{{ .Version }}-light-armv7
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-amd64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-arm64"
- "{{ .Env.IMAGE_PREFIX }}/{{ .ProjectName }}:{{ .Version }}-light-armv7"

changelog:
sort: asc
Expand Down

0 comments on commit cf7f071

Please sign in to comment.