This will also come in handy for multiple languages support (#5307).
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
historically this is kind of a mess, some places set the prefixed ext
(e.g. `.exe`) others don't (e.g. `msi`)
this standardize it to have the preceding `.`
also makes `ByExt` works with or without it so it doesn't break anyone's
config.
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
continuing the work of #5153closes#5153
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: 世界 <i@sekai.icu>
Add a new function `map` to template functions.
`map` creates a map from a list of pairs of key values, then you can
convert a key to a value using `.Get`. This simplifies writing
key-mapping templates. For example, the defaule `archives.name_template`
```yaml
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
```
becomes
```yaml
name_template: >-
{{ $arch := map "amd64" "x86_64" "386" "i386" -}}
{{ .ProjectName }}_
{{- title .OS }}_
{{- $arch.Get .Arch .Arch }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
```
---------
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
since this will be a late, big release, let's remove the deprecated
stuff that expired
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
this would allow to add the checksums to the body of the release
contents, for example.
refs https://github.com/orgs/goreleaser/discussions/4063
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
versioned all new options since v1.2 (late 2021).
Should be enough to fix#3317 for now.
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
We should not imply the target_commitish, as some users might want to
have the code in one repo and the releases in another (e.g. private
code, public releases), so the commit might not be there.
We should instead allow the user to set the `target_commitish` (or not),
and pass it down to the github api.
refs 95bba02211
refs #3044
refs #3330
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
* feat: annotated tag body
this adds another template variable, `TagBody`, with the body of the annotated tag/commit message only.
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* refactor: tag contents
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* feat: add grep and grep -v template functions
this adds `grep` and `reverseGrep` template functions, which should help dealing with text.
refs #2920
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* refactor: rename funcs
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* feat: expose runtime goos and goarch on templates and metadata
* test: fix duplicated map literal in some os/arch
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>