-
Notifications
You must be signed in to change notification settings - Fork 415
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
Add configuration for goreleaser #257
Conversation
Looks like there is a issue with the golden files and line endings on Windows Rather than fix this now, I'm going to remove windows from the test script. We can still build for Windows though. |
Hi @rogchap , thanks a lot for the PR, this looks great. Unfortunately I think we really need to have the versioning saved into the go source code so that you can
The pattern of baking the version info on build time is a common one but one I'm not very fond of for Golang projects. I don't think that should be too difficult to implement. What do you think? |
Hey @LandonTClipp, I strongly recommend moving away from
goreleaser requires a git tag before it will build; so you always need a new valid git tag to do a deployment. The flow you describe is actually quite complex, because you would have to build the binary before building the binary (!!??) to get the version, check that there are no tags with that version and then (and only then) do a deployment based of that version. Not impossible, but quite messy, and unconventional from managing Go releases. You could If you are not keen on master containing version If you really really really still want to maintain |
|
||
go: | ||
- 1.11.x | ||
- 1.12.x |
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.
stretchr/testify still supports 1.11/1.12. Yes I know they're ancient but let's keep them in here for now.
https://github.com/stretchr/testify#supported-go-versions
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.
Surly this only effects the build of the mockery binary, rather than the supported Go output by the tool? We would only build mockery binary with the latest (1.14) so we could actually remove all but 1 Go version to run the tests. 💁♂️
That said, I've added both 1.11 and 1.12 back in as requested.
@rogchap thank you for all your input. After thinking it over I think what you are saying makes sense and we can go ahead and move forward. I really don't think that it's that complicated of a workflow but if that's how most of the Go community releases binaries I think we should follow that. Let's keep the idea of I will look this over once more on Monday and get this merged. I'll put in a few minor comments. Thanks!! |
oops, this change has broken our CI, we are installing latest mockery and check for version to be |
Okay, we might just need to change the default version to be 1.0.0 for
backwards compatibility. I'll fix this.
Regards,
…--
Landon Clipp
On Sun, May 10, 2020, 2:09 PM Maksym Naboka ***@***.***> wrote:
oops, this change has broken our CI, we are installing latest mockery and
check for version to be 1.0.0 :(
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#257 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACVWMAPZ5ZOHEZGNXB6M6NDRQ33XZANCNFSM4M3YQIQQ>
.
|
People relying on version of latest commit being 1.0.0. Adding this back in for backwards-compatibility.
If you can run in modules mode, then |
@mnaboka can you confirm your CI is fixed from the new commit? I think to prevent other CI's from breaking we need to add this back in. We should add a deprecation note for a few months to inform people the default SemVer is going to be |
@LandonTClipp sure, i've fixed it on my end, another issue is that all generated mocks also include a string with version, so all those mocks will also be changed. |
Yes the commit reverts back to the old behavior where SemVer is 1.0.0. Thank you for fixing it on your end. I've added a note in the README about this, we'll keep that deprecation for a while and then we can switch it back over to |
In vektra/mockery#257 mockery changed how the version is specified https://github.com/vektra/mockery/pull/257/files#diff-3a895417c300af3c34fab6ebb556e984R9. When we run `go get github.com/vektra/mockery/cmd/mockery` the version is `0-0-dev` when in reality it's a different version. Update the installation of mockery to download the file from GitHub instead of `go get` so that the version is set correctly and prevents changes in the generated mocks. This causes pipelines to fail like https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/546233640 closes https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25645
This adds basic configuration for goreleaser.
On a tagged release it will build for linux, osx and windows, and add to the GitHub release page, including the artifacts, changelog and checksum file.
To test locally you can run
goreleaser --snapshot --skip-publish --rm-dist
I've also change the
SemVer
to be auto generated at build time via ldflags; This may cause slight confusion for people installing viago get
as it will display0.0.0-dev
, but allows easier version management via CI releases (with goreleaser); In the future we should favour CI builds over usinggo get
.This is a prerequisite to having other distributions such as docker (#180) and homebrew (recommended)
I've amended CI (travis) to run the tests and do a deploy when there is a valid release tagged.