Skip to content

chore: test auto prerelease #347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 19, 2025
Merged

chore: test auto prerelease #347

merged 3 commits into from
Feb 19, 2025

Conversation

matifali
Copy link
Member

@matifali matifali commented Feb 19, 2025

This configures goreleaser to automate prereleases when we push a tag that contains pre or rc
Ref: https://goreleaser.com/customization/release/#github

This configures goreleaser to automate prereleases when we push a tag that contains `pre` or `rc`
@matifali matifali requested a review from johnstcn February 19, 2025 09:52
@matifali matifali self-assigned this Feb 19, 2025
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

🤞

.goreleaser.yml Outdated
Comment on lines 59 to 60
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.

@matifali matifali requested a review from johnstcn February 19, 2025 11:42
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

{{ not .Prerelease }} should also work as you suggested: https://go.dev/play/p/aDU6YypI2KT

@matifali matifali merged commit 249863d into main Feb 19, 2025
3 checks passed
@matifali matifali deleted the atif/test-prerelease branch February 19, 2025 12:55
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants