CICD: GoReleaser version - part 1#2737
Conversation
|
Looks good! Could you remove the whitespace changes? (I guess we need to standardize on a YAML prettier :) ). |
4431f23 to
1602bcb
Compare
Done! P.S. The reason why this was committed was because my IDE (GoLand) continuously implemented this format.
Yes certainly, already discussed and local branch with Prettier is almost ready. |
1602bcb to
e956385
Compare
|
If we make this change, we're going to have to do a pre-release and let people check it out. We get a lot of complaints when that version string changes or breaks. |
|
That's a great idea! Would you like to arrange this? I am not able to do that myself. 😊 |
e956385 to
3813c25
Compare
This reverts commit 17da0bc.
|
Sadly I had to revert this because the build broke https://github.com/StackExchange/dnscontrol/actions/runs/7390125976/job/20104387012 |
That's annoying, I could have seen this by running the GitHub Actions on my GitHub fork repository. Sorry! 😕 I have tried to reproduce this error locally. However, this has not been achieved. The GoReleaser output diff with actions/runs/7390125976/job/20104387012: • starting build...
• loading path=.goreleaser.yml
• skipping validate...
• loading environment variables
• getting and validating git state
- • git state commit=7fc1d32fbbad5f8eb671397f96533e5e7fb0a0fc branch=cicd/goreleaser-version current_tag=v4.7.3 previous_tag=v4.7.2 dirty=true
+ • accepting to run without a git repository because this is a snapshot
+ • git state commit=none branch=none current_tag=v0.0.0 previous_tag=<unknown> dirty=false
• pipe skipped reason=disabled during snapshot mode
• parsing tag
• setting defaults
• snapshotting
- • building snapshot... version=4.7.4-next
+ • building snapshot... version=0.0.1-next
• running before hooks
• running hook=go fmt ./...
• running hook=go mod tidy
• running hook=go generate ./...
• took: 8s
• checking distribution directory
- • cleaning dist
• loading go mod information
• build prerequisites
• writing effective config file
• writing config=dist/config.yaml
• building binariesSo I've try without the git directory. This GoReleaser build was also successful. mv .git/ .git-move-directory-for-goreleaser-build/The suggestion from the GitHub action leads me to the Sources consultedCaptured for archival purposes. Based on that, I started looking further at the current GitHub Actions. I tweaked this and now there is a working set-up. See GitHub pull request #2761 containing a working build: https://github.com/cafferata/dnscontrol/actions/runs/7402715334/job/20141152040?pr=1 The additional commits compared to the previous GitHub pull request:
Explanation of the additional commits: GoReleaser
GitHub Action
|
Co-authored-by: Tom Limoncelli <[email protected]>
What is the reason for this pull request?
I saw the comment below listed in the various YAML files within
.github/workflows. So I thought I'd see how far I could get! 🤓GoReleaser documentation
By default, GoReleaser will set the following 3 ldflags:
main.version: Current Git tag (thevprefix is stripped) or the name of the snapshot, if you're using the--snapshotflagmain.commit: Current git commit SHAmain.date: Date in the RFC3339 formathttps://goreleaser.com/cookbooks/using-main.version/
Name Templates
{{ .Commit }}: the git commit hash (deprecated){{ .Date }}: current UTC date in RFC 3339 formathttps://goreleaser.com/customization/templates/
GitHub Actions
https://goreleaser.com/ci/actions/
How has this work (locally) been tested?
GoReleaser
GoReleaser output
Go build
DNSControl TypeScript
Homebrew
For completeness the reporting of the current Homebrew ldflags configuration
P.S. This pull request is best reviewed by a commit-by-commit review.