Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ release:
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
prerelease: auto
make_latest: "{{ not .Prerelease }}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per https://goreleaser.com/customization/templates/

make_latest: "{{ not .Prerelease }}"

is wrong and

"{{ .Prerelease }}"

will evaluate to pre
It is not a boolean, so my change will not work.

QQ: Can I match a template check for

"{{ .Prerelease == 'pre' }}"

I am assuming templating works the same as they do in Helm charts.

Copy link
Member

@johnstcn johnstcn Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like templates aren't supported in make_latest yet.
There's a PR to support this: goreleaser/goreleaser#5418 that got released in v2.6.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's merged and available as per v2.6.0
goreleaser/goreleaser#5420

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{ eq (.Prerelease | len) 0 }}

https://go.dev/play/p/4_PNM98L86r

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make_latest: {{ not .Prerelease }} should also return make_latest: true when .Prerelease is empty.

https://go.dev/play/p/mot2uUV-qTj

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting the change.

changelog:
# see https://goreleaser.com/customization/changelog/
use: github-native
Expand Down
Loading