From 209c3c87839147b9ba2c37688d69142933d55b82 Mon Sep 17 00:00:00 2001 From: Blai Peidro Date: Mon, 30 Nov 2026 00:26:20 +0100 Subject: [PATCH] feat: the builder's binaries on each release --- .github/workflows/release.yml | 25 +++++++++++++++++++++---- CHANGELOG.md | 1 + CONTRIBUTING.md | 3 ++- README.md | 1 + 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51dd442..48cbebf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,11 @@ name: Release # release moves it). Once CI is green on a push to main, and when that version has no release # yet, it publishes the image for amd64 and arm64 : # ghcr.io/ansibleforms/ansibleforms-rte-builder:, :., : and :latest -# and creates the release with the changelog's entry. A version released already, or -# 0.0.0 (none followed yet), releases nothing : a change merged between two app releases goes out -# with the next one, listed under Unreleased in CHANGELOG.md. +# and creates the release with the changelog's entry, the static binaries for Linux on +# amd64 and arm64 attached with their SHA-256 sums (the installer's native Builder downloads +# them). A version released already, or 0.0.0 (none followed yet), releases nothing : a change +# merged between two app releases goes out with the next one, listed under Unreleased in +# CHANGELOG.md. # # The release is created with a token of the ansibleforms-release GitHub App, so it is # ansibleforms[bot]'s, as the app's : it needs the variable RELEASE_APP_CLIENT_ID and the secret @@ -60,6 +62,21 @@ jobs: echo "major=${version%%.*}" } >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@v7 + if: steps.v.outputs.skip != 'true' + with: + go-version-file: go.mod + + - name: Build the binaries + if: steps.v.outputs.skip != 'true' + run: | + set -euo pipefail + mkdir dist + for arch in amd64 arm64; do + CGO_ENABLED=0 GOOS=linux GOARCH="$arch" go build -trimpath -ldflags "-s -w" -o "dist/ansibleforms-rte-builder_linux_$arch" . + done + (cd dist && sha256sum ansibleforms-rte-builder_linux_* > SHA256SUMS) + - uses: docker/setup-qemu-action@v4 if: steps.v.outputs.skip != 'true' - uses: docker/setup-buildx-action@v4 @@ -101,4 +118,4 @@ jobs: # the changelog's entry of this version, else a line naming the app release it follows awk -v v="## $VERSION" '$0==v{on=1;next} /^## /{if(on)exit} on' CHANGELOG.md > notes.md [ -s notes.md ] || echo "The RTE builder of AnsibleForms $VERSION." > notes.md - gh release create "$VERSION" -R "$GITHUB_REPOSITORY" --target "$SHA" --title "$VERSION" --notes-file notes.md + gh release create "$VERSION" -R "$GITHUB_REPOSITORY" --target "$SHA" --title "$VERSION" --notes-file notes.md dist/* diff --git a/CHANGELOG.md b/CHANGELOG.md index e0581f8..81ab1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The changes made to the builder between two releases wait under Unreleased and g ### Added +- **Its binaries:** each release also has static binaries for Linux on amd64 and arm64, with their SHA-256 sums. - Rootless Podman: run as the container's root (`--user 0 --privileged`), the builder starts its buildkitd directly, on `overlayfs`. - `BUILDKIT_SNAPSHOTTER`: the snapshotter of that buildkitd, when overlayfs does not suit the host. - A registry's TLS check: a build whose registry has it off (a self-signed certificate) is pushed and signed without checking its certificate. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5351fd3..7964187 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -71,5 +71,6 @@ Branches are named `/`, and one pull request holds one change The builder's version follows AnsibleForms'. When the app releases, it tells this repository, and Follow app release opens a pull request that moves `internal/version/version.go` to that version and turns the changelog's Unreleased section into its entry. -Once it is merged and CI is green, the Release workflow publishes `ghcr.io/ansibleforms/ansibleforms-rte-builder` on amd64 and arm64 and creates the release. +Once it is merged and CI is green, the Release workflow publishes `ghcr.io/ansibleforms/ansibleforms-rte-builder` on amd64 and arm64, +and creates the release with the static binaries `ansibleforms-rte-builder_linux_amd64` and `_linux_arm64` and their `SHA256SUMS`. Changes merged between two app releases are listed under Unreleased and go out with the next one. diff --git a/README.md b/README.md index 858a8b3..609aba0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ The controller decides what to build; the builder builds it, and knows nothing e - **Live log:** every line of a build reaches the controller's job, its secrets masked - **Survives a drop:** what the controller did not store yet is sent again after a reconnect - **Needs nothing more:** no database, no repositories, no playbooks +- **Image or binary:** its image, or a static binary for Linux on each release, run as a service ## How it works