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
62 lines
2.2 KiB
Bash
62 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Compute the next release version for alkane-toolkit from the latest release
|
|
# tag and the paths changed since it. Version scheme X.Y.Z:
|
|
# X - major, bumped manually (ci/version-x.txt); a bump resets Y.Z to 0.0
|
|
# Y - backend-logic changes (core/discovery/access/flash/artifacts/cli,
|
|
# scan+model+main in the GUI crate, build/CI config); resets Z to 0
|
|
# Z - UI changes (the GUI view + fixtures + the wx-rs widget bridge)
|
|
# When both backend and UI changed, backend wins (bump Y). Docs-only changes
|
|
# produce no release.
|
|
#
|
|
# Emits KEY=VALUE lines on stdout (suitable for $GITHUB_OUTPUT):
|
|
# version, tag, bump, release (true/false), last_tag
|
|
set -euo pipefail
|
|
|
|
x_file="ci/version-x.txt"
|
|
X=0
|
|
[ -f "$x_file" ] && X=$(tr -dc '0-9' < "$x_file")
|
|
X=${X:-0}
|
|
|
|
last=$(git tag -l 'v*.*.*' | sort -V | tail -1 || true)
|
|
if [ -n "$last" ]; then
|
|
v=${last#v}; lx=${v%%.*}; rest=${v#*.}; ly=${rest%%.*}; lz=${rest##*.}
|
|
changed=$(git diff --name-only "$last"..HEAD)
|
|
else
|
|
lx=0; ly=0; lz=0
|
|
changed=$(git ls-files)
|
|
fi
|
|
|
|
ui=false; backend=false
|
|
while IFS= read -r f; do
|
|
[ -z "$f" ] && continue
|
|
case "$f" in
|
|
crates/alkane-gui/src/ui.rs|crates/alkane-gui/src/fixtures.rs|thirdparty/wx-rs/*)
|
|
ui=true ;;
|
|
crates/alkane-core/*|crates/alkane-discovery/*|crates/alkane-access/*|\
|
|
crates/alkane-flash/*|crates/alkane-artifacts/*|crates/alkane-cli/*|\
|
|
crates/alkane-gui/src/scan.rs|crates/alkane-gui/src/model.rs|\
|
|
crates/alkane-gui/src/main.rs|Cargo.toml|Cargo.lock|.gitea/*|ci/*|scripts/*)
|
|
backend=true ;;
|
|
*) : ;; # docs, HANDOFF, README, thirdparty/wxwidgets tree: no bump
|
|
esac
|
|
done <<< "$changed"
|
|
|
|
if [ -z "$last" ]; then
|
|
# First release: X.1.0 (or X.0.0 if X was pre-bumped above 0).
|
|
nx=$X; if [ "$X" -gt 0 ]; then ny=0; else ny=1; fi; nz=0; bump=initial; release=true
|
|
elif [ "$X" -gt "$lx" ]; then
|
|
nx=$X; ny=0; nz=0; bump=major; release=true
|
|
elif [ "$backend" = true ]; then
|
|
nx=$lx; ny=$((ly + 1)); nz=0; bump=backend; release=true
|
|
elif [ "$ui" = true ]; then
|
|
nx=$lx; ny=$ly; nz=$((lz + 1)); bump=ui; release=true
|
|
else
|
|
nx=$lx; ny=$ly; nz=$lz; bump=none; release=false
|
|
fi
|
|
|
|
echo "version=${nx}.${ny}.${nz}"
|
|
echo "tag=v${nx}.${ny}.${nz}"
|
|
echo "bump=${bump}"
|
|
echo "release=${release}"
|
|
echo "last_tag=${last:-none}"
|