-
Notifications
You must be signed in to change notification settings - Fork 7.7k
ci: upgrade to GoReleaser v2
#12318
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
ci: upgrade to GoReleaser v2
#12318
Conversation
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
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.
Pull request overview
This PR upgrades GoReleaser from v1.17.1 to v2.13.1 to keep the release tooling current, as GoReleaser v1 reached end-of-life in May 2024. The upgrade involves updating the GitHub Actions workflow, configuration file syntax, and file path references that changed due to GoReleaser v2's modified artifact naming conventions.
Key changes:
- Updated GoReleaser Action to v6 and pinned GoReleaser version to v2.13.1
- Migrated
.goreleaser.ymlconfiguration to v2 format with deprecated field replacements - Updated artifact directory paths in deployment workflow and build scripts to match v2's naming scheme (e.g.,
arm64_v8.0suffix additions)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/deployment.yml |
Updated GoReleaser action to v6.0.0, pinned version to v2.13.1, and adjusted Windows build artifact paths to include architecture suffixes |
.goreleaser.yml |
Added version: 2, replaced deprecated fields (builds→ids, format→formats), quoted "386" architecture, removed rlcp, and added ids filter to nfpms |
script/pkgmacos |
Updated macOS ARM64 binary path to include _v8.0 suffix |
script/release |
Updated CLI flags from --skip-validate --skip-publish to --skip validate,publish,announce format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BagToad
left a comment
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.
LGTM, everything you are changing makes sense. Looking forward to a dry run of these changes.
Fixes #12319
This is a redo of #12277 where we asked Copilot to upgrade GoReleaser. I closed that due to lots of missing changes.
The reason for upgrading GoReleaser from
v1tov2, is that the latestv1release,v1.26.2, published back in May 2024, seems to be the last of its generation. Since it's a critical tool in our process, we should upgrade tov2. FWIW we're currently usingv1.17.1which is even older (April 2023).Important
Soon after merging this PR, I recommend us going through a dry-run release to make sure the changes are okay to keep. I tried to test them locally, but couldn't simulate a real environment, especially around artifact signing or default env vars available to GH runners.
Changes in this PR
Although almost all changes in this PR are mechanical, I'm going to explain them in detail as reviewing this PR might be challenging, and this way a fresh pair of eyes would spot potential misses easier.
1. CI workflow
goreleaser/goreleaser-actionis bumped tov6.v2.13.1(current latest) with a comment that we should be careful when bumping it due to artifact file name changes (more on this later).2. GoReleaser configuration
version: 2.archives.rclp: true, since it's now alwaystrue(notice).386in architecture name arrays.archives.buildswitharchives.ids(notice).archives.formatwitharchive.formatsarray (notice).idstonfpmsto limit generating.deb/.rpmpackages to our Linux binaries; without it GoReleaser attempts to make.deb/.rpmpackages for all builds. Since we only build for a single OS/arch in our process, this is merely for safety, especially in case we decided to consolidate GoReleaser builds into a single workflow job in the future.Tip
Running
goreleaser checkvalidates the configuration file.3. GoReleaser CLI
We call the
goreleaserCLI fromscript/releasescript. The new version has removed the--skip-validateand--skip-publishflags in favour of--skip validate,publishformat.I've also added
--skip announcejust for safety of local builds. FWIW this disables publishing any social media post/sharing.4. Generated files
As a bit of context, GoReleaser generates three kinds of artifacts/outputs for us, all stored under
distdirectory:bin/ghorbin/gh.exe..tar.gz(for Linux build) or.zip(for macOS/Windows). These archives contain the binary,LICENSE, andmanentries (except for Windows)..debor.rpmfiles generated for our Linux packaging.As I noted, only binary artifact directories have different names now, and this is how the PR accommodates the changes:
Linux builds: Thankfully, we don't rely on these directories, as all we need from our Linux builds are
.deband.rpmpackages, whose names are unchanged.Windows builds: previously directory names were like this:
But now they are:
We relied on these paths in our deployment workflow (passing them to Wix, the MSI installer maker), and they're now updated to the new names. However, as of GoReleaser docs, these directory names are not guaranteed to remain the same and we should find them by inspecting
dist/artifacts.json. I didn't go through that to avoid over-complicating this PR, but I did pinned the GoReleaser version tov2.13.1with a comment.Macos builds: previously directory names were:
Now they are:
We referenced thses names in
script/pkgmacosand now they're updated. Again we should use the paths reported indist/artifacts.json, but I didn't go through that.Note
Although some names have changed, but the contents are the same. For example, for
i386architecture, we've always relied on the default (i.e. sse2 floating point instructions). The only difference is now the directory names explicitly report the default value. The same applies forarm64_v8.0(e.g. see this in our latest release run whereGOARM64is populated withv8.0). For more about these env vars, See Go Wiki: Minimum Requirements.