ci: target the GCC 16 builder runner
This commit is contained in:
1 parent
a6dfa95ca2
commit
97709d37a5
2 files changed
+72
-84
No files matched your search
@@ -1,11 +1,11 @@
|
||||
# VoidBuildSystem release (Gitea Actions).
|
||||
#
|
||||
# Triggered by a `v*` tag. Builds a Release configuration, runs the full suite, packages
|
||||
# binaries, the SDK and the deterministic source archive, uploads them as CI artifacts, and
|
||||
# creates (or updates) the Gitea release with the same files attached.
|
||||
# Triggered by a `v*` tag (or manually). Builds a Release configuration, runs the full suite,
|
||||
# packages binaries, the SDK and the deterministic source archive, uploads them as CI
|
||||
# artifacts, and creates (or updates) the Gitea release with the same files attached.
|
||||
#
|
||||
# Runner: `linux` (host) for the dev toolchain (`dev cpp-gcc -c ...`); the release upload uses
|
||||
# the automatically provided GITHUB_TOKEN with repository write access.
|
||||
# Runner: `echoion-release-serial` - the GCC 16.1.0 builder container. The release upload
|
||||
# uses the automatically provided GITHUB_TOKEN with repository write access.
|
||||
name: Release
|
||||
|
||||
on:
|
||||
@@ -18,48 +18,50 @@ permissions:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: linux
|
||||
runs-on: echoion-release-serial
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up the dev toolchain
|
||||
- name: Check the toolchain
|
||||
run: |
|
||||
for dir in /etc/profiles/per-user/*/bin /run/current-system/sw/bin /nix/var/nix/profiles/default/bin; do
|
||||
if [ -d "$dir" ] && [ -x "$dir/dev" ]; then
|
||||
export PATH="$dir:$PATH"
|
||||
break
|
||||
fi
|
||||
done
|
||||
command -v dev || { echo "the 'dev' toolchain wrapper was not found on this runner" >&2; exit 1; }
|
||||
echo "PATH=$PATH" >> "$GITHUB_ENV"
|
||||
dev cpp-gcc -c g++ --version | head -1
|
||||
g++ --version | head -1
|
||||
major="$(g++ -dumpversion | cut -d. -f1)"
|
||||
if [ "${major:-0}" -lt 16 ]; then
|
||||
echo "GCC 16 or newer is required for C++26 (found ${major:-unknown})" >&2
|
||||
exit 1
|
||||
fi
|
||||
- name: Verify the tag matches the project version
|
||||
run: |
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
version="$(sed -nE 's/^project\(VoidBuildSystem VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)"
|
||||
echo "tag=${tag} project version=${version}"
|
||||
case "${tag}" in
|
||||
v*) ;;
|
||||
*) echo "not a release tag (${tag}); skipping the version check" ; exit 0 ;;
|
||||
esac
|
||||
if [ "${tag#v}" != "${version}" ]; then
|
||||
echo "tag ${tag} does not match the project version ${version}" >&2
|
||||
exit 1
|
||||
fi
|
||||
- name: Configure (Release, Ninja)
|
||||
run: |
|
||||
dev cpp-gcc -c cmake -S . -B build/release -G Ninja \
|
||||
cmake -S . -B build/release -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_COMPILER=g++ \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
- name: Build
|
||||
run: dev cpp-gcc -c cmake --build build/release --parallel 4
|
||||
run: cmake --build build/release --parallel 4
|
||||
- name: Run the full suite
|
||||
run: |
|
||||
set -o pipefail
|
||||
dev cpp-gcc -c ctest --test-dir build/release --output-on-failure 2>&1 | tee ctest-release.log
|
||||
ctest --test-dir build/release --output-on-failure 2>&1 | tee ctest-release.log
|
||||
- name: Package binaries, SDK and source
|
||||
run: |
|
||||
set -eu
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
stage="$(mktemp -d)"
|
||||
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" "dist"
|
||||
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" dist
|
||||
cp build/release/bin/vbs build/release/bin/vbs-registry "${stage}/bin/"
|
||||
cp -r include/Void "${stage}/include/"
|
||||
cp build/release/libVoidBuild_Sdk.a "${stage}/lib/" 2>/dev/null || \
|
||||
@@ -67,10 +69,7 @@ jobs:
|
||||
cp README.md "${stage}/"
|
||||
tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \
|
||||
-czf "dist/vbs-${tag}-linux-x86_64.tar.gz" -C "${stage}" .
|
||||
build/release/bin/vbs pack --project . --output "dist/vbs-${tag}-source.tar" \
|
||||
|| tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \
|
||||
--exclude=.git --exclude=build --exclude=.vbs \
|
||||
-czf "dist/vbs-${tag}-source.tar.gz" .
|
||||
build/release/bin/vbs pack --project . --output "dist/vbs-${tag}-source.tar"
|
||||
cp ctest-release.log dist/
|
||||
sha256sum dist/* > dist/SHA256SUMS
|
||||
ls -l dist/
|
||||
@@ -88,16 +87,20 @@ jobs:
|
||||
run: |
|
||||
set -eu
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
case "${tag}" in
|
||||
v*) ;;
|
||||
*) echo "not a release tag (${tag}); skipping the release upload" ; exit 0 ;;
|
||||
esac
|
||||
api="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
body="$(printf 'Release %s\n\nBuilt from %s with the full CTest suite green.\nSee SHA256SUMS for artifact digests.' "${tag}" "${GITHUB_SHA}")"
|
||||
payload="$(printf '{"tag_name":"%s","name":"%s","body":"%s","draft":false,"prerelease":false}' \
|
||||
"${tag}" "${tag}" "${body}")"
|
||||
release_id="$(curl -fsS -X POST -H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" -d "${payload}" \
|
||||
"${api}/releases" | sed -nE 's/.*"id":([0-9]+).*/\1/p' | head -1)"
|
||||
"${api}/releases" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))')"
|
||||
if [ -z "${release_id}" ]; then
|
||||
release_id="$(curl -fsS -H "Authorization: token ${TOKEN}" \
|
||||
"${api}/releases/tags/${tag}" | sed -nE 's/.*"id":([0-9]+).*/\1/p' | head -1)"
|
||||
"${api}/releases/tags/${tag}" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))')"
|
||||
fi
|
||||
test -n "${release_id}"
|
||||
for file in dist/*; do
|
||||
|
||||
Reference in new issue
Block a user