Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@babakks
Copy link
Member

@babakks babakks commented Dec 15, 2025

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 v1 to v2, is that the latest v1 release, 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 to v2. FWIW we're currently using v1.17.1 which 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-action is bumped to v6.
  • GoReleaser version is pinned at 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

  • Added version: 2.
  • Removed now-redundant archives.rclp: true, since it's now always true (notice).
  • Double-quoted 386 in architecture name arrays.
  • Replaced archives.builds with archives.ids (notice).
  • Replaced archives.format with archive.formats array (notice).
  • Added ids to nfpms to limit generating .deb/.rpm packages to our Linux binaries; without it GoReleaser attempts to make .deb/.rpm packages 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 check validates the configuration file.

3. GoReleaser CLI

We call the goreleaser CLI from script/release script. The new version has removed the --skip-validate and --skip-publish flags in favour of --skip validate,publish format.

I've also added --skip announce just 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 dist directory:

  1. Binary artifacts: stored in separate subdirs per OS/arch combination. Each of these subdirs contain the built binary placed as bin/gh or bin/gh.exe.
    • ⚠️ Naming has changed in GoReleaser v2.
  2. Archives: these are archived version of the above built binaries, stored as .tar.gz (for Linux build) or .zip (for macOS/Windows). These archives contain the binary, LICENSE, and man entries (except for Windows).
    • ✅ Naming unchanged (since the format is provided by us via configuration).
    • ✅ Archive content unchanged (no changed paths/names).
  3. Linux-specific packages: these are .deb or .rpm files generated for our Linux packaging.
    • ✅ Naming unchanged. For example, I got the names below, which match our latest release workflow run (here):
    package=gh format=rpm arch=amd64v1 file=dist/gh_2.83.3_linux_amd64.rpm
    package=gh format=rpm arch=arm64v8.0 file=dist/gh_2.83.3_linux_arm64.rpm
    package=gh format=deb arch=arm64v8.0 file=dist/gh_2.83.3_linux_arm64.deb
    package=gh format=deb arch=amd64v1 file=dist/gh_2.83.3_linux_amd64.deb
    package=gh format=rpm arch=arm6 file=dist/gh_2.83.3_linux_armv6.rpm
    package=gh format=deb arch=arm6 file=dist/gh_2.83.3_linux_armv6.deb
    package=gh format=deb arch=386sse2 file=dist/gh_2.83.3_linux_386.deb
    package=gh format=rpm arch=386sse2 file=dist/gh_2.83.3_linux_386.rpm
    

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 .deb and .rpm packages, whose names are unchanged.

  • Windows builds: previously directory names were like this:

    windows_windows_386
    windows_windows_amd64_v1
    windows_windows_arm64
    

    But now they are:

    windows_windows_386_sse2    (changed)
    windows_windows_amd64_v1
    windows_windows_arm64_v8.0  (changed)
    

    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 to v2.13.1 with a comment.

  • Macos builds: previously directory names were:

    macos_darwin_arm64
    macos_darwin_amd64_v1
    

    Now they are:

    macos_darwin_arm64_v8.0  (changed)
    macos_darwin_amd64_v1
    

    We referenced thses names in script/pkgmacos and now they're updated. Again we should use the paths reported in dist/artifacts.json, but I didn't go through that.

Note

Although some names have changed, but the contents are the same. For example, for i386 architecture, 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 for arm64_v8.0 (e.g. see this in our latest release run where GOARM64 is populated with v8.0). For more about these env vars, See Go Wiki: Minimum Requirements.

Copilot AI review requested due to automatic review settings December 15, 2025 19:21
@babakks babakks requested a review from a team as a code owner December 15, 2025 19:21
@babakks babakks requested a review from BagToad December 15, 2025 19:21
Copy link
Contributor

Copilot AI left a 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.yml configuration 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.0 suffix 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 (buildsids, formatformats), 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.

Copy link
Member

@BagToad BagToad left a 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.

@babakks babakks merged commit 146e886 into trunk Dec 19, 2025
11 checks passed
@babakks babakks deleted the babakks/upgrade-to-goreleaser-v2 branch December 19, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to GoReleaser v2

3 participants