build-test-release / release (push) Failing after 1m32s
Gitea Actions workflow (.gitea/workflows/release.yml) triggered on push to
main: build the GUI against the cached vendored wx, run the 22 unit tests and
two microbenchmarks (view pipeline + cell render, with perf-regression floors),
run the headless UI self-test under xvfb, then package the binary and cut a
release when the change warrants one.
Auto-versioning X.Y.Z (ci/compute-version.sh):
X - manual (ci/version-x.txt); a bump resets Y.Z
Y - backend-logic changes (core/discovery/access/flash/artifacts/cli, the
GUI crate's scan/model/main, build + CI config); resets Z
Z - UI changes (GUI view, fixtures, the wx-rs widget bridge)
Backend beats UI when both change; docs-only changes cut no release.
Runner: a dedicated act_runner (label alkane-ci) on bfe-mpc-0640 (the Gitea
host) runs jobs in a Debian-trixie image with Rust + GTK3/pcre2 + node.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
114 lines
4.4 KiB
YAML
114 lines
4.4 KiB
YAML
name: build-test-release
|
|
|
|
# Runs on every merge/push to main: build the GUI, run tests + a microbenchmark,
|
|
# and (when the change warrants it) cut an X.Y.Z release with the binary attached.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: alkane-ci
|
|
env:
|
|
WX_PREFIX: /root/.cache/wx-3.3.3-linux
|
|
steps:
|
|
- name: Checkout (full history for tags)
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Compute version
|
|
id: ver
|
|
run: bash ci/compute-version.sh | tee -a "$GITHUB_OUTPUT"
|
|
|
|
- name: Cache vendored wxWidgets build
|
|
if: steps.ver.outputs.release == 'true'
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: /root/.cache/wx-3.3.3-linux
|
|
key: wx-3.3.3-${{ runner.os }}-${{ hashFiles('thirdparty/wx-rs/VERSION') }}
|
|
|
|
- name: Build wxWidgets (once, then cached)
|
|
if: steps.ver.outputs.release == 'true'
|
|
run: |
|
|
if [ ! -x "$WX_PREFIX/bin/wx-config" ]; then
|
|
scripts/build-wx-linux.sh
|
|
else
|
|
echo "wx prefix restored from cache"
|
|
fi
|
|
|
|
- name: Set crate version to ${{ steps.ver.outputs.version }}
|
|
if: steps.ver.outputs.release == 'true'
|
|
run: |
|
|
sed -i "0,/^version = \".*\"/s//version = \"${{ steps.ver.outputs.version }}\"/" Cargo.toml
|
|
grep -m1 '^version' Cargo.toml
|
|
|
|
- name: Build release
|
|
if: steps.ver.outputs.release == 'true'
|
|
run: |
|
|
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
cargo build --release -p alkane-gui --offline
|
|
|
|
- name: Unit tests
|
|
if: steps.ver.outputs.release == 'true'
|
|
run: |
|
|
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
cargo test -p alkane-gui --offline
|
|
|
|
- name: Microbenchmarks
|
|
if: steps.ver.outputs.release == 'true'
|
|
run: |
|
|
export WX_RS_WXCONFIG="$WX_PREFIX/bin/wx-config"
|
|
cargo test -p alkane-gui --release --offline -- --ignored --nocapture bench_
|
|
|
|
- name: Headless UI self-test
|
|
if: steps.ver.outputs.release == 'true'
|
|
run: |
|
|
apt-get update -qq && apt-get install -y -qq --no-install-recommends xvfb >/dev/null
|
|
BIN=target/release/alkane-toolkit
|
|
xvfb-run -a env GDK_BACKEND=x11 ALKANE_SELFTEST=1 "$BIN"
|
|
|
|
- name: Package artifact
|
|
if: steps.ver.outputs.release == 'true'
|
|
id: pkg
|
|
run: |
|
|
V="${{ steps.ver.outputs.version }}"
|
|
NAME="alkane-toolkit-v${V}-linux-x86_64"
|
|
mkdir -p "dist/$NAME"
|
|
cp target/release/alkane-toolkit "dist/$NAME/"
|
|
cat > "dist/$NAME/README.txt" <<EOF
|
|
alkane-toolkit v${V} (linux x86_64)
|
|
Bump type: ${{ steps.ver.outputs.bump }}
|
|
Commit: ${GITHUB_SHA}
|
|
|
|
Run: ./alkane-toolkit
|
|
Requires GTK 3 at runtime: sudo apt install libgtk-3-0
|
|
Offline demo: ALKANE_FAKE_SCAN=1 ./alkane-toolkit
|
|
EOF
|
|
tar -C dist -czf "dist/${NAME}.tar.gz" "$NAME"
|
|
echo "asset=dist/${NAME}.tar.gz" >> "$GITHUB_OUTPUT"
|
|
echo "assetname=${NAME}.tar.gz" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Create Gitea release + upload artifact
|
|
if: steps.ver.outputs.release == 'true'
|
|
env:
|
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
TAG="${{ steps.ver.outputs.tag }}"
|
|
API="${GITHUB_API_URL:-https://gitea.bluefla.re/api/v1}"
|
|
REPO="${GITHUB_REPOSITORY}"
|
|
body="Automated ${{ steps.ver.outputs.bump }} release from ${GITHUB_SHA}."
|
|
rel=$(curl -sS -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/json" \
|
|
"${API}/repos/${REPO}/releases" \
|
|
-d "{\"tag_name\":\"${TAG}\",\"target_commitish\":\"${GITHUB_SHA}\",\"name\":\"${TAG}\",\"body\":\"${body}\"}")
|
|
id=$(echo "$rel" | grep -oE '"id":[0-9]+' | head -1 | cut -d: -f2)
|
|
if [ -z "$id" ]; then echo "release create failed: $rel"; exit 1; fi
|
|
curl -sS -X POST -H "Authorization: token ${TOKEN}" -H "Content-Type: application/gzip" \
|
|
"${API}/repos/${REPO}/releases/${id}/assets?name=${{ steps.pkg.outputs.assetname }}" \
|
|
--data-binary @"${{ steps.pkg.outputs.asset }}" | grep -oE '"browser_download_url":"[^"]+"' || true
|
|
echo "Released ${TAG}"
|
|
|
|
- name: No release needed
|
|
if: steps.ver.outputs.release != 'true'
|
|
run: echo "No backend/UI change since ${{ steps.ver.outputs.last_tag }} - skipping release."
|