Publish a GoReleaser release

Use this guide when GoReleaser builds your archives and creates your GitHub release. At the end, each release also carries a signed packslip.sigstore.json that describes those archives.

To sign from your own Go release tool instead, see Publish from Go.

Add the step after GoReleaser

GoReleaser does not write a release bundle, so the packslip action runs as the next step of the same job and reads the archives GoReleaser left in dist:

name: release
on:
  push:
    tags: ["v*"]

permissions:
  contents: write      # Create the release and upload the bundle.
  id-token: write      # Sign with the workflow's identity.
  attestations: write  # Attest the archives.

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
        with:
          fetch-depth: 0
      - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
        with:
          go-version-file: go.mod
      - uses: goreleaser/goreleaser-action@a4f02ab5355a589de60d917a659ce617ed19b3de # v7.3.0
        with:
          version: "~> v2"
          args: release --clean
        env:
          GITHUB_TOKEN: ${{ github.token }}
      - uses: jdx/packslip@v1
        with:
          artifacts: dist/*.tar.gz dist/*.zip
          bin: mytool

On a tag push, the action derives the project, version, download URLs, and source commit from the repository and tag. Publish with GitHub Actions covers the other inputs, and Check the published result shows how to verify the release afterwards.

If the repository uses immutable releases, set release.draft: true in .goreleaser.yaml and publish the release after this step, as Prepare the files and release explains.

Check what the step reads

packslip create reads each archive's OS, architecture, and format from its name. It reads GoReleaser's default archive names and the names goreleaser init writes:

Archiveosarchformatbin
mytool_1.2.3_linux_amd64.tar.gzlinuxx86_64tar.gzmytool
mytool_1.2.3_linux_arm64.tar.gzlinuxaarch64tar.gzmytool
mytool_1.2.3_linux_armv7.tar.gzlinuxarmv7tar.gzmytool
mytool_1.2.3_linux_386.tar.gzlinuxi686tar.gzmytool
mytool_1.2.3_darwin_all.tar.gzdarwinnonetar.gzmytool
mytool_1.2.3_windows_amd64.zipwindowsx86_64zipmytool.exe
mytool_Linux_x86_64.tar.gzlinuxx86_64tar.gzmytool
mytool_Darwin_arm64.tar.gzdarwinaarch64tar.gzmytool
mytool_Windows_i386.zipwindowsi686zipmytool.exe

The universal macOS archive, darwin_all, records no arch, so every Mac can select it. A build with CGO_ENABLED=0 is statically linked: create records no libc, and the archive fits glibc and musl hosts. For a cgo build, create reads the C library from the executable, as C library explains.

If you changed name_template, check your own names before the first release. Build without publishing, then create a trial bundle with a local key:

goreleaser release --snapshot --clean
packslip keygen --out release.key
packslip create --key release.key --no-log \
  --project mytool.example.com --version 1.2.3 --bin mytool \
  --url-base https://mytool.example.com/v1.2.3 \
  --out packslip dist/*.tar.gz dist/*.zip
packslip show packslip/packslip.sigstore.json

For a name create reads wrongly, set the platform in a release.toml you pass as manifest, as Override the inferred platform shows.

Give each CPU-level build a variant

A build matrix such as goamd64: [v1, v3] makes two archives for one platform. Leave the default build without a variant and give the other its CPU level. The variants input takes file names, and GoReleaser's default names include the version, so read it from the tag first:

      - name: Read the version from the tag
        run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
      - uses: jdx/packslip@v1
        with:
          artifacts: dist/*.tar.gz dist/*.zip
          bin: mytool
          variants: >-
            mytool_${{ env.VERSION }}_linux_amd64v3.tar.gz=v3
            mytool_${{ env.VERSION }}_windows_amd64v3.zip=v3

Consumers install the build without a variant unless the user asks for one. Vocabularies in the specification lists the CPU-level and softfloat variants, and Separate builds that share a platform gives the rules.

Troubleshoot

ErrorWhat to do
artifact "artifacts.json": nothing in the name says what kind of file it is; give it a format, or leave it out of the artifacts if it is not oneartifacts matched GoReleaser's own files in dist. List only the archive globs, such as dist/*.tar.gz dist/*.zip.
artifacts "mytool_1.2.3_linux_amd64.tar.gz" and "mytool_1.2.3_linux_amd64v3.tar.gz" both describe linux/x86_64/tar.gz; give one a variant so consumers can tell them apartGive each CPU-level build a variant.
no artifacts matched: artifacts=[…] download=[…]The globs match nothing in dist. Check the archive formats in .goreleaser.yaml, and that this step runs in the job that ran GoReleaser.

Troubleshoot publication lists the action's other errors.