Skip to content

chore: Replace GoReleaser with custom build scripts#660

Draft
aaron-zeisler wants to merge 6 commits into
v8from
aaronz/SDK-2337/replace-goreleaser-experiment
Draft

chore: Replace GoReleaser with custom build scripts#660
aaron-zeisler wants to merge 6 commits into
v8from
aaronz/SDK-2337/replace-goreleaser-experiment

Conversation

@aaron-zeisler
Copy link
Copy Markdown
Contributor

@aaron-zeisler aaron-zeisler commented May 7, 2026

Summary

  • Replace the 529-line .goreleaser.yml with focused shell scripts that handle cross-compilation, system packaging, and Docker image builds independently
  • Remove the GoReleaser dependency entirely in favor of go build, standalone nfpm, and docker buildx
  • Introduce scripts/release.sh as a single orchestration entry point, keeping the publish action and Makefile minimal
  • Preserve all existing release artifacts, attestation outputs, and dry-run support

Motivation

GoReleaser is opaque and difficult to debug when releases fail. Other LaunchDarkly teams (gonfalon, event-recorder, streamer, foundation) don't use it, and sdk-meta already removed it. The new scripts are individually testable, readable (~60-100 lines each vs 529 lines of YAML), and follow patterns established elsewhere in the org.

Changes

File Description
scripts/release.sh New — Orchestrates the full release pipeline (cross-compile → packages → Docker)
scripts/cross-compile.sh New — Builds all 9 OS/arch targets, produces .tar.gz archives + checksums.txt + metadata.json
scripts/build-packages.sh New — Uses standalone nfpm to create .deb/.rpm packages (uses envsubst for config variable expansion)
scripts/docker-build.sh New — Uses docker buildx for multi-platform builds, creates multi-arch manifests
nfpm.yml New — Standalone package config (was embedded in GoReleaser)
.github/actions/publish/action.yml Simplified to a single "Build release artifacts" step calling release.sh
.github/workflows/ci.yml Added nfpm installation for Docker Scout scan job
Makefile publish and products-for-release are now one-liners calling release.sh
Dockerfile*.goreleaser Unchanged — no modifications needed; docker-build.sh passes the binary directory as the build context
.goreleaser.yml Deleted
scripts/run-goreleaser.sh Deleted

Architecture

scripts/release.sh [--dry-run] [VERSION]
  ├── scripts/cross-compile.sh --keep-build [VERSION]
  │     → dist/*.tar.gz, dist/checksums.txt, dist/metadata.json
  │     → dist/build/ld-relay_<ver>_<os>_<arch>/ld-relay (retained for subsequent steps)
  ├── scripts/build-packages.sh [VERSION]
  │     → dist/*.deb, dist/*.rpm
  └── scripts/docker-build.sh [--dry-run] [VERSION]
        → Docker images pushed (or --load for local scanning)
        → dist/images_and_digests.json

Each script can also be run independently for debugging or selective builds.

Test plan

  • scripts/cross-compile.sh — all 9 targets build successfully (tested locally)
  • scripts/build-packages.sh — all 8 packages (4 arch × deb + rpm) built successfully (tested locally)
  • scripts/docker-build.sh --dry-run — all 10 Docker images built and loaded locally (tested locally)
  • scripts/release.sh --dry-run — full end-to-end pipeline completes successfully (tested locally)
  • End-to-end dry-run via the publish action in CI
  • Verify artifact names match existing GitHub Release naming conventions
  • Verify internal deployment (Ansible) can still fetch linux_amd64.tar.gz

JIRA

SDK-2337

Remove the 529-line .goreleaser.yml and replace it with three focused
shell scripts that handle cross-compilation, system packaging, and
Docker image builds independently.

- scripts/cross-compile.sh: builds all 9 OS/arch targets using go build,
  produces .tar.gz archives and checksums.txt
- scripts/build-packages.sh: uses standalone nfpm to create .deb/.rpm
  packages from pre-built binaries
- scripts/docker-build.sh: uses docker buildx for multi-platform builds
  across 3 image variants, creates multi-arch manifests
- nfpm.yml: standalone package configuration (previously embedded in
  GoReleaser config)
- Updated .github/actions/publish/action.yml to orchestrate the new
  scripts, preserving attestation outputs and dry-run support
- Updated Dockerfiles to accept BINARY build arg for flexible binary
  path injection
- Updated Makefile publish/products-for-release targets

Tracked by SDK-2337.

Co-authored-by: Cursor <cursoragent@cursor.com>
aaron-zeisler and others added 4 commits May 8, 2026 09:06
…nerate metadata

The Docker Scout Scan CI job was failing because:
1. nfpm was not installed (build-packages.sh needs it)
2. products-for-release didn't build Docker images
3. dist/metadata.json was not generated for version extraction

Fixes:
- Install nfpm via go install in CI workflow
- Add docker-build.sh --dry-run to products-for-release target
- Use --load flag in dry-run mode so images are available locally
- Generate dist/metadata.json in cross-compile.sh

Co-authored-by: Cursor <cursoragent@cursor.com>
Standalone nfpm uses 'depends' for package dependencies under
overrides, not 'dependencies' (which is the GoReleaser-embedded
nfpm syntax).

Co-authored-by: Cursor <cursoragent@cursor.com>
nfpm does not expand environment variables in contents[].src paths.
Pre-process nfpm.yml through envsubst before passing to nfpm to
ensure VERSION and NFPM_ARCH_LABEL are properly substituted.

Co-authored-by: Cursor <cursoragent@cursor.com>
… script

- Create scripts/release.sh as a single entry point that orchestrates
  cross-compile, build-packages, and docker-build in sequence.
- Remove unnecessary BINARY ARG from Dockerfiles; instead pass the
  binary's directory as the Docker build context so the existing
  COPY ld-relay instruction works unchanged.
- Simplify publish action.yml from multiple steps to one.
- Simplify Makefile publish/products-for-release to one-liners.

Co-authored-by: Cursor <cursoragent@cursor.com>
@aaron-zeisler aaron-zeisler changed the title [SDK-2337] Replace GoReleaser with custom build scripts chore: Replace GoReleaser with custom build scripts May 28, 2026
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.

1 participant