feat: introduce release version env variable for goreleaser

This commit is contained in:
mrekucci 2024-06-13 19:13:54 +02:00
parent 06340fcfff
commit 6e15b3b6a3

View file

@ -26,9 +26,13 @@ archives:
- format: tar.gz - format: tar.gz
name_template: >- name_template: >-
{{- .Binary }}_ {{- .Binary }}_
{{- with index .Env "RELEASE_VERSION" -}}
{{ . }}
{{- else -}}
{{- if .IsSnapshot }}{{ .ShortCommit }} {{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }} {{- else }}{{ .Version }}
{{ end }} {{- end }}
{{- end -}}
{{- with index .Env "DIRTY_SUFFIX" -}} {{- with index .Env "DIRTY_SUFFIX" -}}
{{ . }} {{ . }}
{{- end -}}_ {{- end -}}_
@ -52,9 +56,13 @@ archives:
checksum: checksum:
name_template: >- name_template: >-
{{ .ProjectName }}_ {{ .ProjectName }}_
{{- with index .Env "RELEASE_VERSION" -}}
{{ . }}
{{- else -}}
{{- if .IsSnapshot }}{{ .ShortCommit }} {{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }} {{- else }}{{ .Version }}
{{- end }} {{- end }}
{{- end -}}
{{- with index .Env "DIRTY_SUFFIX" -}} {{- with index .Env "DIRTY_SUFFIX" -}}
{{ . }} {{ . }}
{{- end -}} {{- end -}}