Skip to content

build: standardize release asset naming#1729

Merged
meiji163 merged 2 commits into
github:masterfrom
conf:1728-release-assets-naming
Jun 25, 2026
Merged

build: standardize release asset naming#1729
meiji163 merged 2 commits into
github:masterfrom
conf:1728-release-assets-naming

Conversation

@conf

@conf conf commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

A Pull Request should be associated with an Issue.

Related issue: #1728

Description

This PR reworks the release packaging so the published assets have stable,
predictable names that are easy to automate against (e.g. installing a fixed
version from a Dockerfile without first listing a release's assets), and
slims down the packaging tooling along the way.

Asset naming (build.sh)

  • Drop the generated timestamp from tarball names — the biggest pain point,
    since it forced consumers to list a release's assets before they could pick a
    download.
  • Drop the -binary infix from tarball names.
  • Name macOS tarballs with darwin (matches GOOS) instead of osx.
  • Drop the version from .rpm/.deb filenames — the release download URL
    already carries it (.../download/v1.1.10/gh-ost.x86_64.rpm). Package
    metadata still records the version and epoch.
  • Build arm64 .rpm and .deb in addition to amd64, using each
    ecosystem's arch convention (x86_64/aarch64 for rpm, amd64/arm64
    for deb).
  • Stop publishing the bare gh-ost binary — it was just the last build
    (darwin/arm64) left over in the build dir, and its name made the OS/arch
    non-obvious. Tarballs and packages already cover every OS/arch.
  • Emit a SHA256SUMS manifest so a download can be verified with
    sha256sum -c SHA256SUMS (or --ignore-missing for a single file).

Resulting assets:

gh-ost-linux-amd64.tar.gz    gh-ost.x86_64.rpm    gh-ost.amd64.deb
gh-ost-linux-arm64.tar.gz    gh-ost.aarch64.rpm   gh-ost.arm64.deb
gh-ost-darwin-amd64.tar.gz
gh-ost-darwin-arm64.tar.gz   SHA256SUMS

Packaging tooling (Dockerfile.packaging, script/dock)

  • Collapse the per-package RUN apt-get install layers into one, drop packages
    already provided by the golang:bookworm base (git, tar, curl, gcc, g++,
    bash) and the unused rsync, and drop the legacy GOPATH src/ layout (the
    build is module-mode). Only ruby/ruby-dev/build-essential (for fpm) and
    rpm (for rpmbuild) are installed now.
  • Use a multi-stage build with a scratch artifacts stage so
    docker build --output type=local exports the assets straight to the host.
    This drops the intermediate container, bind mount, -it TTY and
    find | xargs cp step from script/dock pkg.
  • Fix the stale/misleading usage text in script/dock.

Verification

Built all assets via script/dock pkg and verified: every tarball/package
contains a binary of the expected arch, the rpm/deb arch metadata is correct,
the deb version is 1:1.1.10 (epoch preserved), sha256sum -c SHA256SUMS
round-trips green, and the exported directory contains only the release assets.

⚠️ Note for the release-upload step: SHA256SUMS has no gh-ost
prefix, so it will not match a gh-ost* upload glob. The upload step needs to
include it explicitly (or upload the whole /tmp/gh-ost-release directory).

In case this PR introduced Go code changes:

  • contributed code is using same conventions as original code
  • script/cibuild returns with no formatting errors, build errors or unit test errors.

conf added 2 commits June 25, 2026 19:28
Rework build.sh so released assets have stable, predictable names that
are easy to automate against:

- drop the generated timestamp from tarball names
- drop the "-binary" infix from tarball names
- name macOS tarballs with "darwin" (matches GOOS) instead of "osx"
- drop the version from .rpm/.deb filenames; the release download URL
  already carries it. Package metadata still records version + epoch
- build arm64 .rpm and .deb in addition to amd64, using each ecosystem's
  arch convention (x86_64/aarch64 for rpm, amd64/arm64 for deb)
- stop publishing the bare "gh-ost" binary; it was just the last build
  (darwin/arm64) and was ambiguous. Tarballs and packages cover every
  OS/arch
- emit a SHA256SUMS manifest so downloads can be verified with
  `sha256sum -c SHA256SUMS`

Resulting assets:
  gh-ost-{linux,darwin}-{amd64,arm64}.tar.gz
  gh-ost.{x86_64,aarch64}.rpm
  gh-ost.{amd64,arm64}.deb
  SHA256SUMS

Also refactor build() to take GOOS/GOARCH directly, share common fpm
flags via an array, and update the README build.sh description.
Slim down the release packaging tooling:

- Dockerfile.packaging: collapse the per-package RUN layers into one, drop
  packages already provided by the golang:bookworm base (git, tar, curl,
  gcc, g++, bash) and the unused rsync, and drop the legacy GOPATH src
  layout (the build is module-mode). Only ruby/ruby-dev/build-essential
  (for fpm) and rpm (for rpmbuild) are installed now.
- Use a multi-stage build with a `scratch` artifacts stage so
  `docker build --output type=local` exports the assets straight to the
  host. This drops the intermediate container, bind mount, -it TTY and
  find|xargs cp dance from `script/dock pkg`.
- build.sh: stage the fpm package tree in the system temp dir instead of
  under $buildpath, so it never lands among the exported release artifacts.
@conf conf force-pushed the 1728-release-assets-naming branch from 754943b to 22875f4 Compare June 25, 2026 17:28
@conf conf changed the title build: standardize release asset naming (#1728) build: standardize release asset naming Jun 25, 2026
@meiji163 meiji163 merged commit c231272 into github:master Jun 25, 2026
14 checks passed
@conf

conf commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks a lot! Any ETA for the release?

@conf conf deleted the 1728-release-assets-naming branch June 26, 2026 08:38
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.

2 participants