-
Notifications
You must be signed in to change notification settings - Fork 189
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
fix: use correct tag when commit is tagged with both prerelease and release #218
Conversation
16b0b08
to
c00d9d7
Compare
Actually this only resolves the problem when there are multiple tags, but will not work if the |
Ok I changed the approach and updated the PR description accordingly. |
-rc
suffixfrom release name
-rc
suffixfrom release name-rc
suffix from release name
.goreleaser.yml
Outdated
@@ -39,7 +39,8 @@ builds: | |||
goarch: 386 | |||
|
|||
archives: | |||
- | |||
- name_template: >- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the -rc
from the filename? Isn't it better to make it clear it's a release candidate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we can't simply promote an -rc
by creating a new tag, as we've been doing.
If we want to go the route where we keep the -rc
in the filename, we'd have to either:
- Delete the existing assets, update the prerelease, and create new assets by running
goreleaser
again. - Delete the existing pre-release and create a new release with new assets by running
goreleaser
again. - Somehow change the name of all the assets and checksum file on the existing prerelease.
For 1 and 2 we run the risk of introducing (build environment) changes between the pre-release and the release that's published. Not sure how easy 3 is to automate, but it could be messy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you are trying to simply upgrade the candidate binary. If that's what you want to do, can you confirm that the correct version (without the -rc) is being injected here:
var version = "dev" |
For context, we didn't use to create a release for candidates, only set the tag. I think we created prereleases sometimes. Once confident about the candidate, the release was created. In that case you don't need all those steps you listed. vN-rc-M
can be one prerelease and vn
can be another. There was no need to edit releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with that approach. The less a developer needs to manually amend the release candidate, the better, so if we're rebuilding having separate GitHub releases is safer.
I can revert the file renaming part of this PR and update our process doc to avoid upgrading the candidates in the prerelease.
-rc
suffix from release name-rc
suffix from release assets archive filenames
80b0a01
to
7057aa5
Compare
-rc
suffix from release assets archive filenames
Add a Git config specification to make
goreleaser
find the latest tag for a specific release, following this advice.When you run
goreleaser
on a non-rc tag, the corresponding commit will always have 2 tags (thevX.X.X-rcY
andvX.X.X
tags) andgoreleaser
seems to be picking the wrong one, which puts the-rc
variant first. This prevents someone from checking out thevX.X.X
tag and runninggoreleaser
.