mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
chore(release): publish standalone floci-aws binaries as release assets (#5844)
* chore(release): publish standalone floci-aws binaries as release assets The release already built Linux native executables, but only to package them into the images; they were discarded after a day and releases carried no assets. Users without Docker had nothing to download. release.yml now also builds macOS (arm64, and x86_64 under Rosetta) and Windows x86_64 binaries with GraalVM Community, smoke-tests every binary on its own runner with .github/scripts/smoke-binary.sh (version matches the tag, SQS and DynamoDB round trips, clean stop on SIGTERM), and checks that the Linux amd64 binary still starts on glibc 2.34 (Ubuntu 22.04). A new publish-binaries job, the only one with write access to the release, stages the six executables as floci-aws-<os>-<arch>, writes sha256sums.txt, signs every file with keyless cosign sign-blob, attests build provenance, and uploads them to the release semantic-release created. Build artifacts are kept 7 days so that job can be re-run on its own. make native-install now installs floci-aws, since floci is the CLI. Refs #5767 Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(release): check the glibc 2.34 floor on every Linux binary and wait for the release Review follow-ups for the binary release jobs: - The floor check started the amd64 binary on Ubuntu 22.04, whose glibc is 2.35, so a binary that needed 2.35 would have passed. check-glibc-floor.sh now reads the newest GLIBC_ symbol version the binary requires with readelf and fails above 2.34, then starts it in UBI 9, whose glibc is 2.34. - The two arm64 builds had no floor check at all; they run the same script. - publish-binaries waits up to 10 minutes for semantic-release to create the GitHub Release before uploading, instead of failing if it is not there yet. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(release): build darwin-amd64 with a pinned, checksummed GraalVM Community The macOS x86_64 job downloaded Oracle GraalVM from download.oracle.com's "latest" URL: not the Community build the job's comment names, unpinned and unchecked, though its output is then signed and attested as ours. It now fetches GraalVM Community 25.0.1, the last release with a macOS x64 build, from graalvm-ce-builds and checks it against the published SHA-256 before extracting it. The publish-binaries header said semantic-release creates the release before pushing the tag; it pushes the tag first, as the upload step says. Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This commit is contained in:
1 parent
043daa5da6
commit
5370920012
5 files changed
+385
-8
No files matched your search
@@ -2,7 +2,8 @@ name: Release
|
||||
|
||||
# Triggered when a version tag (e.g. 1.2.3) is pushed.
|
||||
# Builds native (amd64 + arm64) Docker images and pushes them to Docker Hub
|
||||
# and Amazon ECR Public.
|
||||
# and Amazon ECR Public, and publishes standalone floci-aws binaries for Linux,
|
||||
# macOS and Windows as GitHub Release assets.
|
||||
#
|
||||
# Published tags:
|
||||
# Native: floci/floci:1.2.3 floci/floci:latest
|
||||
@@ -57,6 +58,17 @@ jobs:
|
||||
# The flag only exists on Mandrel, so it is passed here rather than in application.yml.
|
||||
run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-march=x86-64-v2,-H:-AOTSingleCallsiteInline"
|
||||
|
||||
- name: Smoke-test the standalone binary
|
||||
# The same binary is published as a release asset (publish-binaries), so it is checked
|
||||
# the way a user runs it: on the host, no Docker image around it.
|
||||
run: .github/scripts/smoke-binary.sh "$(ls target/*-runner)" "$GITHUB_REF_NAME"
|
||||
|
||||
- name: Check the glibc floor of the standalone binary
|
||||
# The release asset links glibc dynamically and must run on 2.34 (RHEL 9, Debian 12,
|
||||
# Ubuntu 22.04, Amazon Linux 2023). The script checks the symbol versions it requires and
|
||||
# starts it in UBI 9, whose glibc is exactly 2.34.
|
||||
run: .github/scripts/check-glibc-floor.sh "$(ls target/*-runner)"
|
||||
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: native-amd64
|
||||
@@ -65,7 +77,8 @@ jobs:
|
||||
target/*.properties
|
||||
target/*.so
|
||||
if-no-files-found: warn
|
||||
retention-days: 1
|
||||
# Long enough to re-run publish-binaries on its own after a failure.
|
||||
retention-days: 7
|
||||
|
||||
# ── Build native artifact — arm64 ────────────────────────────────────────
|
||||
build-native-arm64:
|
||||
@@ -91,6 +104,14 @@ jobs:
|
||||
# The flag only exists on Mandrel, so it is passed here rather than in application.yml.
|
||||
run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-H:-AOTSingleCallsiteInline"
|
||||
|
||||
- name: Smoke-test the standalone binary
|
||||
# The same binary is published as a release asset (publish-binaries), so it is checked
|
||||
# the way a user runs it: on the host, no Docker image around it.
|
||||
run: .github/scripts/smoke-binary.sh "$(ls target/*-runner)" "$GITHUB_REF_NAME"
|
||||
|
||||
- name: Check the glibc floor of the standalone binary
|
||||
run: .github/scripts/check-glibc-floor.sh "$(ls target/*-runner)"
|
||||
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: native-arm64
|
||||
@@ -99,7 +120,8 @@ jobs:
|
||||
target/*.properties
|
||||
target/*.so
|
||||
if-no-files-found: warn
|
||||
retention-days: 1
|
||||
# Long enough to re-run publish-binaries on its own after a failure.
|
||||
retention-days: 7
|
||||
|
||||
# ── Build baseline native artifact — arm64 only ─────────────────────────
|
||||
build-native-arm64-baseline:
|
||||
@@ -123,6 +145,14 @@ jobs:
|
||||
# inherit optional AArch64 features (notably LSE) from the GitHub-hosted build runner.
|
||||
run: mvn clean package -Dnative -DskipTests -B -Dquarkus.native.additional-build-args-append="-march=armv8-a,-H:-AOTSingleCallsiteInline"
|
||||
|
||||
- name: Smoke-test the standalone binary
|
||||
# The same binary is published as a release asset (publish-binaries), so it is checked
|
||||
# the way a user runs it: on the host, no Docker image around it.
|
||||
run: .github/scripts/smoke-binary.sh "$(ls target/*-runner)" "$GITHUB_REF_NAME"
|
||||
|
||||
- name: Check the glibc floor of the standalone binary
|
||||
run: .github/scripts/check-glibc-floor.sh "$(ls target/*-runner)"
|
||||
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: native-arm64-baseline
|
||||
@@ -131,7 +161,199 @@ jobs:
|
||||
target/*.properties
|
||||
target/*.so
|
||||
if-no-files-found: warn
|
||||
retention-days: 1
|
||||
# Long enough to re-run publish-binaries on its own after a failure.
|
||||
retention-days: 7
|
||||
|
||||
# ── Build standalone binaries — macOS and Windows ───────────────────────
|
||||
# The Linux release binaries are the native-amd64, native-arm64 and native-arm64-baseline
|
||||
# artifacts above, which also go into the images. macOS and Windows are built only for the
|
||||
# release assets. Mandrel has no macOS distribution, so both use GraalVM Community, which has
|
||||
# no -H:-AOTSingleCallsiteInline option to pass.
|
||||
build-binary-darwin-arm64:
|
||||
name: Build standalone binary (darwin-arm64)
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: graalvm/setup-graalvm@27b360dbb857524eaf0b4c4cef364d38e5b4f173 # v1
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native executable
|
||||
run: mvn clean package -Dnative -DskipTests -B
|
||||
|
||||
- name: Smoke-test the standalone binary
|
||||
run: .github/scripts/smoke-binary.sh "$(ls target/*-runner)" "$GITHUB_REF_NAME"
|
||||
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: binary-darwin-arm64
|
||||
path: target/*-runner
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
build-binary-darwin-amd64:
|
||||
name: Build standalone binary (darwin-amd64, Rosetta)
|
||||
# native-image cannot cross-compile, and Intel macOS runners queue for hours, so an x86_64
|
||||
# GraalVM runs under Rosetta 2 on the Apple Silicon runner (floci-cli's recipe).
|
||||
# setup-graalvm has no architecture override, so the x86_64 JDK is installed by hand: GraalVM
|
||||
# Community, like the other binaries, pinned to 25.0.1 (the last release with a macOS x64 build)
|
||||
# and checked against its published SHA-256 before anything built with it is signed.
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 90
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Install Rosetta 2
|
||||
run: sudo softwareupdate --install-rosetta --agree-to-license
|
||||
|
||||
- name: Install x86_64 GraalVM
|
||||
env:
|
||||
GRAALVM_X64_URL: https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-25.0.1/graalvm-community-jdk-25.0.1_macos-x64_bin.tar.gz
|
||||
GRAALVM_X64_SHA256: a3d895b4cd1c783badbd277ec70409806bd4102fca0d2a60dbaeb0bab41aec30
|
||||
run: |
|
||||
curl -fsSL -o "$RUNNER_TEMP/graalvm-x64.tar.gz" "$GRAALVM_X64_URL"
|
||||
echo "$GRAALVM_X64_SHA256 $RUNNER_TEMP/graalvm-x64.tar.gz" | shasum -a 256 -c -
|
||||
mkdir -p "$RUNNER_TEMP/graalvm-x64"
|
||||
tar -xzf "$RUNNER_TEMP/graalvm-x64.tar.gz" -C "$RUNNER_TEMP/graalvm-x64" --strip-components 1
|
||||
echo "JAVA_HOME=$RUNNER_TEMP/graalvm-x64/Contents/Home" >> "$GITHUB_ENV"
|
||||
echo "GRAALVM_HOME=$RUNNER_TEMP/graalvm-x64/Contents/Home" >> "$GITHUB_ENV"
|
||||
echo "$RUNNER_TEMP/graalvm-x64/Contents/Home/bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Build native executable (x86_64 under Rosetta)
|
||||
run: arch -x86_64 mvn clean package -Dnative -DskipTests -B
|
||||
|
||||
- name: Verify the binary is x86_64
|
||||
run: file target/*-runner | grep -q x86_64
|
||||
|
||||
- name: Smoke-test the standalone binary
|
||||
run: arch -x86_64 .github/scripts/smoke-binary.sh "$(ls target/*-runner)" "$GITHUB_REF_NAME"
|
||||
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: binary-darwin-amd64
|
||||
path: target/*-runner
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
build-binary-windows-amd64:
|
||||
name: Build standalone binary (windows-amd64)
|
||||
runs-on: windows-latest
|
||||
timeout-minutes: 90
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- uses: graalvm/setup-graalvm@27b360dbb857524eaf0b4c4cef364d38e5b4f173 # v1
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'graalvm-community'
|
||||
cache: maven
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build native executable
|
||||
# Keeps the Windows snappy-java and JNA dispatch libraries every other build excludes
|
||||
# (see quarkus.native.resources in application.yml).
|
||||
shell: bash
|
||||
run: >-
|
||||
mvn clean package -Dnative -DskipTests -B
|
||||
"-Dfloci.native.windows-jni-include=*"
|
||||
-Dfloci.native.windows-jni-exclude=none
|
||||
|
||||
- name: Smoke-test the standalone binary
|
||||
shell: bash
|
||||
run: .github/scripts/smoke-binary.sh "$(ls target/*-runner.exe)" "$GITHUB_REF_NAME"
|
||||
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: binary-windows-amd64
|
||||
path: target/*-runner.exe
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
# ── Publish standalone binaries to the GitHub Release ────────────────────
|
||||
# semantic-release pushes this tag and then creates the release (notes only); the upload step
|
||||
# waits for the release to exist. This job adds
|
||||
# one raw executable per platform, sha256sums.txt, a keyless cosign bundle per file, and a
|
||||
# GitHub build-provenance attestation. It is the only job that writes to the release.
|
||||
# Verify a download with:
|
||||
# sha256sum --ignore-missing -c sha256sums.txt
|
||||
# cosign verify-blob floci-aws-linux-amd64 --bundle floci-aws-linux-amd64.sigstore.json \
|
||||
# --certificate-identity-regexp '^https://github.com/floci-io/floci/.github/workflows/release.yml@' \
|
||||
# --certificate-oidc-issuer https://token.actions.githubusercontent.com
|
||||
# gh attestation verify floci-aws-linux-amd64 --repo floci-io/floci
|
||||
publish-binaries:
|
||||
name: Publish standalone binaries
|
||||
needs:
|
||||
- build-native-amd64
|
||||
- build-native-arm64
|
||||
- build-native-arm64-baseline
|
||||
- build-binary-darwin-arm64
|
||||
- build-binary-darwin-amd64
|
||||
- build-binary-windows-amd64
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
attestations: write
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Stage the release assets
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir dist
|
||||
stage() { local src=("artifacts/$1"/*-runner*); install -m 755 "${src[0]}" "dist/$2"; }
|
||||
stage native-amd64 floci-aws-linux-amd64
|
||||
stage native-arm64 floci-aws-linux-arm64
|
||||
stage native-arm64-baseline floci-aws-linux-arm64-baseline
|
||||
stage binary-darwin-arm64 floci-aws-darwin-arm64
|
||||
stage binary-darwin-amd64 floci-aws-darwin-amd64
|
||||
stage binary-windows-amd64 floci-aws-windows-amd64.exe
|
||||
(cd dist && sha256sum floci-aws-* > sha256sums.txt)
|
||||
ls -l dist
|
||||
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
||||
with:
|
||||
cosign-release: 'v3.1.3'
|
||||
|
||||
- name: Sign the release assets
|
||||
working-directory: dist
|
||||
run: |
|
||||
for f in floci-aws-* sha256sums.txt; do
|
||||
cosign sign-blob --yes --bundle "$f.sigstore.json" "$f"
|
||||
done
|
||||
|
||||
- name: Attest build provenance
|
||||
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
||||
with:
|
||||
subject-path: dist/floci-aws-*
|
||||
|
||||
- name: Upload to the GitHub Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
# The tag starts this workflow before semantic-release creates the GitHub Release, so wait
|
||||
# for it (up to 10 minutes) instead of failing the upload. --clobber makes a re-run idempotent.
|
||||
run: |
|
||||
for _ in $(seq 1 30); do
|
||||
gh release view "$GITHUB_REF_NAME" > /dev/null 2>&1 && break
|
||||
echo "waiting for the $GITHUB_REF_NAME release to exist"; sleep 20
|
||||
done
|
||||
gh release view "$GITHUB_REF_NAME" > /dev/null || { echo "::error::release $GITHUB_REF_NAME not found after 10 minutes"; exit 1; }
|
||||
gh release upload "$GITHUB_REF_NAME" dist/* --clobber
|
||||
|
||||
# ── Push native + compat Docker images ───────────────────────────────────
|
||||
push-native:
|
||||
|
||||
Reference in new issue
Block a user