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 }}_
{{- if .IsSnapshot }}{{ .ShortCommit }} {{- with index .Env "RELEASE_VERSION" -}}
{{- else }}{{ .Version }} {{ . }}
{{ end }} {{- else -}}
{{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }}
{{- 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 }}_
{{- if .IsSnapshot }}{{ .ShortCommit }} {{- with index .Env "RELEASE_VERSION" -}}
{{- else }}{{ .Version }} {{ . }}
{{- end }} {{- else -}}
{{- if .IsSnapshot }}{{ .ShortCommit }}
{{- else }}{{ .Version }}
{{- end }}
{{- end -}}
{{- with index .Env "DIRTY_SUFFIX" -}} {{- with index .Env "DIRTY_SUFFIX" -}}
{{ . }} {{ . }}
{{- end -}} {{- end -}}