Skip to content

feat(release): build and package with goreleaser (#502) - #521

Merged
scttfrdmn merged 7 commits into
mainfrom
feat/goreleaser-release-pipeline
Sep 17, 2026
Merged

scttfrdmn merged 7 commits into
mainfrom
feat/goreleaser-release-pipeline

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #502. Second half of the two-PR split; #520 was the first.

One .goreleaser.yml replaces nfpm.yaml, release.yml's five-cell build matrix (131 lines) and its package-linux job (274). The two jobs collapse into one artifacts job of 162 lines, and make package-linux runs the same binary over the same config — so what a PR proves and what a tag does are the same operation.

The published layout does not change. Same five tarballs under the same names, each holding the same platform-named binary, each with its own .sha256 sibling; same .deb/.rpm filename conventions; same twelve install destinations; same two maintainer scriptlets.

Three goreleaser defaults had to be overridden, each found by building rather than by reading

  • file_name_template: "{{ .ConventionalFileName }}" — the default names an rpm objectfs_0.16.0_linux_amd64.rpm, where amd64 is not what rpm calls that architecture and _linux_ appears in no rpm anywhere. The override restores each format's own arch spellings (amd64/arm64/armhf vs x86_64/aarch64/armv7hl).
  • files: [none*], not files: [] — an empty list reads as unset and the defaulter fills it in. Measured: all five tarballs came out carrying CHANGELOG.md, LICENSE and README.md beside the binary. none* is a glob matching nothing, which is the documented way to say "no extra files".
  • checksum: split: true — the default writes one checksums.txt and no per-asset siblings. scripts/install.sh fetches <asset>.sha256 by exact name and treats its absence as fatal, so the default publishes a complete-looking release that breaks the documented one-liner on every platform at once.

Two builds of the same source

goreleaser has no rename step between a build and an archive. The tarball's binary is named for its platform (install.sh looks up objectfs-linux-amd64 and renames it); the package's has to be objectfs, because that is what the systemd unit, both modulefiles and postinstall.sh invoke. With a single platform-named build the rpm came out carrying /usr/bin/objectfs-linux-amd64: it built, installed, ran its scriptlet, exited 0, and then answered objectfs: command not found — with every packaging test passing, because the binary is not a contents: entry. TestThePackagedBinaryIsOnThePathAsObjectfs is that gate, and it is new.

Publishing stays outside goreleaser

release: disable: true. Three things the publish job does have no goreleaser equivalent: notes extracted from a hand-written Keep-a-Changelog CHANGELOG.md rather than from commit subjects, a cross-check that the per-asset .sha256 files and checksums.txt agree before either is served, and a cosign verify-blob against the same certificate identity the notes tell a reader to pass.

The GPG apparatus is gone, because nothing ever checked the signature it produced

nfpm.yaml's rpm.signature block, release.yml's key-import steps and TestTheRPMSigningPathStaysIntact all rested on one claim, stated in those words: "gpgcheck=1 is dnf's default and verifies each package's own embedded signature, so dnf install ./objectfs-*.rpm checks it too." The first clause is right and the second does not follow. Read out of a rockylinux:9 container rather than reasoned about:

gpgcheck = True            # packages coming from a *repository*
localpkg_gpgcheck = False  # a package named as a local file  <-- the only path this project has

A deliberately unsigned aarch64 rpm was installed with dnf install ./objectfs-0.14.0-1.aarch64.rpm. It installed, pulled fuse3 in as a Recommends, ran the postinstall scriptlet, reported Signature : (none) under rpm -qi, and answered objectfs version. dnf raised nothing.

The failure that originally motivated the key was real — "Package objectfs-0.13.0-1.x86_64.rpm is not signed / Error: GPG check FAILED" — and it came from ci.yml's repo-install job installing out of a throwaway-signed yum repository with gpgcheck=1. That is the repository path, governed by the first setting, and it is the path #520 deleted: objectfs.io/yum answered 404 for the whole life of the feature.

GPG_SIGNING_KEY and GPG_PASSPHRASE are now read by nothing. Deleting the secrets is a repository-settings change and is left to @scttfrdmn.

Two deliberate behavioural changes

  • armv7 now gets a .deb and an .rpm. nfpm's output is per linux platform and armv7 is already a build target here; the old Makefile loop built amd64 and arm64 only, and release.yml's comment recorded that asymmetry as a limitation rather than a decision. A release now carries 11 assets — 5 tarballs, 3 debs, 3 rpms — up from 9.
  • -trimpath, which was not previously passed. It strips the build machine's absolute paths out of the binary, so a build is reproducible from the tag rather than from the runner.

Mutation results

14 mutations. 12 were killed by the intended test on the first run. Two survived, and both were real gate defects:

  • TestTheArchiveNameTemplateIsTheOneEverythingElseAssumes pinned the archive's name_template but not the archived binary's binary: template. They are independent strings that have to be identical — wrap_in_directory: false, so the tarball holds one file and install.sh looks it up by name. Shortening one and leaving the other passed the whole package and would have shipped a release that downloads, verifies its checksum, and then dies on "does not contain objectfs-linux-amd64" on all five platforms at once.
  • The check written to reject goreleaser build searched the step body for "release" — which is a substring of goreleaser/goreleaser-action. args: build --clean passed it. It now reads the args: input by name.

Both are fixed and re-mutated.

Verification

  • goreleaser check validates; make package-linux produces exactly 22 files (11 assets + 11 .sha256 siblings) with correct conventional names.
  • ar x on the amd64 deb and podman run rockylinux:9 rpm -qpl on the aarch64 rpm both show all twelve destinations, /usr/bin/objectfs, and modulefile paths of 0.14.1-next — matching dist/metadata.json's version exactly.
  • gofmt, go vet, golangci-lint run ./internal/config/... clean; go test -race ./internal/config/ ok.

One CI-visible consequence: ci.yml's packaging job now reads the version it looks for out of dist/metadata.json rather than out of cmd/objectfs/main.go. A local or CI build is a --snapshot, so the constant says 0.14.0 while the artifacts say 0.14.1-next and the modulefiles install under that string. Reading the constant would have the job look for a path nothing created and report it as a packaging failure.

There are deliberately no -X ldflags: version in cmd/objectfs/main.go is an untyped constant, so the linker cannot rewrite it, and every release before #375 passed that flag and shipped a binary reporting the hardcoded value anyway. release.yml still asserts the tag equals "v" plus the constant, and TestPackageVersionComesFromTheVersionConstant now fails on a re-added -X main.version.

One .goreleaser.yml replaces nfpm.yaml, release.yml's five-cell build
matrix (131 lines) and its package-linux job (274) — the two jobs collapse
into one `artifacts` job of 162 lines. `make package-linux` runs the same
binary over the same config, so what a pull request proves and what a tag
does are the same operation.

The published layout does not change: the same five tarballs under the same
names, each holding the same platform-named binary, each with its own
.sha256 sibling; the same .deb and .rpm filename conventions; the same
twelve install destinations; the same two maintainer scriptlets. Three
goreleaser defaults had to be overridden to keep it that way, and each was
found by building and inspecting rather than by reading docs:

  - file_name_template: {{ .ConventionalFileName }} — the default names an
    rpm objectfs_0.16.0_linux_amd64.rpm, where amd64 is not what rpm calls
    that architecture and _linux_ appears in no rpm anywhere.
  - files: [none*] on the archive, not files: [] — an empty list reads as
    unset and the defaulter fills it in; measured, all five tarballs came
    out carrying CHANGELOG.md, LICENSE and README.md beside the binary.
  - checksum: split: true — the default writes one checksums.txt and no
    per-asset siblings, and scripts/install.sh fetches <asset>.sha256 by
    exact name and treats its absence as fatal.

Two builds of the same source, because goreleaser has no rename step
between a build and an archive: the tarball's binary is named for its
platform (install.sh looks up objectfs-linux-amd64) and the package's has
to be `objectfs` (the systemd unit, both modulefiles and postinstall.sh
invoke it). With a single platform-named build the rpm came out carrying
/usr/bin/objectfs-linux-amd64: it built, installed, ran its scriptlet,
exited 0, and then answered `objectfs: command not found`, with every
packaging test passing because the binary is not a contents: entry.
TestThePackagedBinaryIsOnThePathAsObjectfs is that gate, and it is new.

Publishing stays outside goreleaser (release: disable: true). Three things
the publish job does have no goreleaser equivalent: notes extracted from a
hand-written CHANGELOG.md, a cross-check that the .sha256 files and
checksums.txt agree before either is served, and a cosign verify-blob
against the certificate identity the notes name.

Also removes the GPG signing apparatus, because nothing on any install path
this project publishes ever checked the signature it produced. Both the
config and TestTheRPMSigningPathStaysIntact said "gpgcheck=1 is dnf's
default ... so dnf install ./objectfs-*.rpm checks it too". The first
clause is right and the second does not follow — read out of a rockylinux:9
container rather than reasoned about:

    gpgcheck = True            # packages from a *repository*
    localpkg_gpgcheck = False  # a package named as a local file

A deliberately unsigned aarch64 rpm installed with `dnf install ./...rpm`,
pulled fuse3 in as a Recommends, ran its scriptlet, reported
`Signature : (none)` under rpm -qi, and answered `objectfs version`. dnf
raised nothing. The failure that originally motivated the signature was
real and came from ci.yml's repo-install job installing out of a
throwaway-signed *yum repository* — the repository path, governed by the
first setting, and the path deleted in 81d137c. GPG_SIGNING_KEY and
GPG_PASSPHRASE are no longer read by anything.

Two deliberate behavioural changes: armv7 now gets a .deb and an .rpm, so a
release carries 11 assets instead of 9; and -trimpath is passed, which was
not previously true.

ci.yml's packaging job now reads the version it looks for out of
dist/metadata.json rather than out of cmd/objectfs/main.go, because a local
or CI build is a --snapshot: the constant says 0.14.0 while the artifacts
say 0.14.1-next, and the modulefiles install under that string. Verified by
unpacking both a deb and an rpm.

Refs #502
The two are independent templates in .goreleaser.yml and have to be the
same string: wrap_in_directory is false, so the tarball holds one file, and
install.sh looks that file up by name before renaming it to objectfs.
Mutating the build's binary: template from
objectfs-{{ .Os }}-{{ .Arch }}... to objectfs-{{ .Os }} and leaving the
archive's name_template alone passed every test in the package — the release
would download, verify its checksum, and die on "does not contain
objectfs-linux-amd64" on all five platforms at once.
…step

`strings.Contains(step, "release")` is true for every step that uses
`goreleaser/goreleaser-action`, because "goreleaser" contains "release".
The check written to reject `goreleaser build` — which compiles the
binaries and produces no archive, no package and no checksum — passed with
`args: build --clean` in the file, verified by mutation. actionInput reads
one named with: input instead, and a block scalar comes back empty, which
fails the caller rather than passing it.
The packaging job failed on PR #521: goreleaser v2.18.1 declares
`go >= 1.27.1`, this module declares 1.26.0, and setup-go sets
GOTOOLCHAIN=local so the Go it installed is the Go that runs. The
Makefile's from-source fallback therefore cannot work in CI —

  go: github.com/goreleaser/goreleaser/[email protected] requires go >= 1.27.1
      (running go 1.26.6; GOTOOLCHAIN=local)

— and that refusal is correct: pinning the toolchain is the point, and a
job that silently fetched a newer Go to build a release tool would build
the release with a compiler this project does not test against. A
developer with the default GOTOOLCHAIN=auto never sees it, which is why it
reached a pull request instead of this machine.

ci.yml now installs a prebuilt goreleaser with goreleaser-action's
install-only mode, at the same pin release.yml uses, and still builds with
`make package-linux` — so the command a developer runs, the command a pull
request runs and the command a tag runs stay the same command over the same
config.

That makes three copies of the version pin, so
TestTheGoreleaserVersionIsPinnedToOneValueEverywhere couples them:
goreleaser owns the asset names, so a skew means a PR proved a different
tool than the release used. Its first form read every `version:` in the
workflows and reported a skew that did not exist — v2.12.2 is
golangci-lint's pin. It now reads the input out of the goreleaser-action
step that sets it.
…next

The comment named the number a developer's full clone produces. actions/
checkout fetches one commit and no tags, so goreleaser finds no tag, falls
back to v0.0.0, and incpatch gives 0.0.1-next — which is what the run
actually exported through Lmod. Someone debugging the modulefile path would
have gone looking for a version this job never builds.

Left shallow on purpose, and the comment now says why: nothing here depends
on the version being a particular string, only on the packaging, the install
and the modulefile agreeing on it, and a number nothing could have
hardcoded tests that agreement more strongly. release.yml passes
fetch-depth: 0 because there the tag is the version.
@scttfrdmn
scttfrdmn merged commit 4205ac9 into main Sep 17, 2026
42 checks passed
@scttfrdmn
scttfrdmn deleted the feat/goreleaser-release-pipeline branch September 17, 2026 04:49
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.

Evaluate goreleaser as the single packaging definition (blocked: rpm key_id, two sources of truth)

1 participant