Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:<version>, :<major>.<minor>, :<major> and :latest
# and creates the release <version> 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 <version> 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/*
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ Branches are named `<type>/<description>`, 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.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down