-
Notifications
You must be signed in to change notification settings - Fork 608
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
Improve our release process with goreleaser #5813
Conversation
If you are curious these are the logs:
Logs:
|
name_template: "checksums.txt" | ||
algorithm: sha256 | ||
|
||
# Docs: https://goreleaser.com/customization/homebrew/ |
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.
oh sweet we have an osmosis brew??
# Docs: https://goreleaser.com/customization/announce/ | ||
# | ||
# We could automatically announce the release in | ||
# - discord | ||
# - slack | ||
# - webhooks | ||
# - telegram | ||
# | ||
# announce: | ||
# discord: | ||
# enabled: true | ||
# message_template: 'New {{.Tag}} is out!' |
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.
Can we track this in an issue, seems like it would be super useful.
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.
ACKing with minimal context, but no issues stand out
* Add .goreleaser.yaml * Add complete .goreleaser.yaml * use tar.gz as a format * Update docker description (cherry picked from commit ccd779d)
* Add .goreleaser.yaml * Add complete .goreleaser.yaml * use tar.gz as a format * Update docker description (cherry picked from commit ccd779d) Co-authored-by: Niccolo Raspa <[email protected]>
What is the purpose of the change
This PR introduces the
.goreleaser.yaml
configuration file and sets up the release process for the project osmosisd.Goreleaser is a popular tool used in the Go ecosystem to automate the build and release workflow for Go projects. It simplifies the process of building binaries, creating archives, generating checksums, and publishing releases across multiple platforms and architectures.
The
goreleaser.yaml
file included in this PR defines the configuration for the release process ofosmosisd
.Let's summarize the key elements of the configuration:
Project Information:
project_name
: Specifies the name of the project asosmosisd
.Environment Variables:
Builds:
The configuration defines four build targets, each specifying different operating systems and architectures:
osmosisd-darwin-amd64
: Builds theosmosisd
binary for macOS (darwin) on AMD64 architecture.osmosisd-darwin-arm64
: Builds theosmosisd
binary for macOS (darwin) on ARM64 architecture.osmosisd-linux-amd64
: Builds theosmosisd
binary for Linux on AMD64 architecture.osmosisd-linux-arm64
: Builds theosmosisd
binary for Linux on ARM64 architecture.For each build, the configuration specifies the necessary build commands, hooks, environment variables, Go compiler options, flags, and linker flags.
Universal Binaries:
osmosisd-darwin-universal
: Creates a universal binary that includes both the macOS (darwin) AMD64 and ARM64 builds.Archives:
The configuration defines an archive configuration named
zipped
that generates zip archives for the universal darwin binary and Linux AMD64/ARM64 binaries.Checksums:
osmosisd-{{ .Version }}-checksums.txt
using the SHA256 algorithm.Brew Formula:
osmosisd
calledosmosisd
. The formula installs theosmosisd
binary and includes tests and installation instructions. This would allow user to installosmosisd
withbrew install osmosisd
Release Configuration:
There a lot of options that we could customize in this file.
For example we could automatically announce on Discord, Slack, Twitter, etc.. once the release is done: https://goreleaser.com/customization/announce/
Testing and Verifying
I have used this
.goreleaser.yaml
to create the following release in my local fork: Link to ReleaseTo replicate the release process, execute the following command:
Fork the osmosis repo with all the tags
Clone the repo and select the tag
Copy this
.goreleaser.yaml
Edit the
.goreleaser.yaml
to avoid creating a release in the real repository.goreleaser-cross
:docker run -e GITHUB_TOKEN=<GITHUB_TOKEN_WITH_REPO_ACCESS> -v /var/run/docker.sock:/var/run/docker.sock -v pwd:/go/src/osmosisd -w /go/src/osmosisd ghcr.io/goreleaser/goreleaser-cross:v1.20.5 release --clean
Replace
<GITHUB_TOKEN_WITH_REPO_ACCESS>
with an actual GitHub token that has access to the repository.Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)