Android / Build, or is the channel already serving this? (push) Successful in 3s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 12s
CI & Build / Python tests (push) Successful in 23s
Android / Core and FFI clippy and tests (push) Successful in 51s
CI & Build / integration (push) Successful in 1m49s
CI & Build / Build & push image (push) Skipped
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 2m20s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m6s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 3m46s
Desktop (Tauri) / Update manifest (push) Successful in 3s
Android / Kotlin + Rust (APK) (push) Successful in 8m31s
Android / Build the server image (push) Successful in 1s
#6225 "Comment standard sweep: root, config, CI workflows, docs and packaging", milestone 546 "Bring the repo to the comment standard (rule 32) and compose defaults (rule 198)". - README restructured in newcomer order: what it is, quick start, configuration, setup pitfalls, updating and backups, features, troubleshooting, development, licence. Its quick-start compose carries no restart policy. - Dockerfile and .env.example trimmed to one or two lines per setting. - Workflows, packaging scripts and docs lose issue, run, note, rule and milestone references and their history narration. Comments that still described path filters and "step 6" as future work now state what the workflows do. - ci-requirements.md rewritten against the current workflows. It said the build gated on typecheck and lint only, the integration lane did not gate, a v* tag published :latest, and ci-tauri lacked bsdtar and zstd; none of those is true now (the last checked against run 9630's log). - Echo strings in guard-forward.sh and version.sh drop their note citations; every string a test asserts on is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69 lines
2.8 KiB
Bash
Executable File
69 lines
2.8 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
#
|
|
# Does this artifact need building, or is the channel already serving this exact
|
|
# source? Prints `true` or `false`.
|
|
#
|
|
# should-build.sh <desktop|android> <dev|stable>
|
|
#
|
|
# Skip-if-exists, keyed on what the channel serves rather than on a registry tag:
|
|
# there are no `:<version>` tags to ask about. Both clients' channels publish the
|
|
# version they serve, so if the channel already serves what this source derives,
|
|
# the artifact would be byte-identical and there is nothing to build.
|
|
#
|
|
# This is also why the workflows carry no `paths:` filters: a second, hand-kept
|
|
# statement of each artifact's file set beside the one in `version.sh` drifts from
|
|
# it, and a lane whose filter misses a file never runs on the commit that changed
|
|
# it. One definition with one reader; the cost saving is a bonus.
|
|
#
|
|
# THE SERVER IS NOT LISTED HERE, DELIBERATELY. Its image build is ~15 seconds against
|
|
# 6 and 9 minutes for the clients, so there is little to save — and always building
|
|
# it is strictly better for a server that can face the internet, because it picks up
|
|
# `python:3.12-slim` base updates on every push. The clients' bases are CI runner
|
|
# images, pinned deliberately.
|
|
set -eu
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
artifact="${1:?usage: should-build.sh <desktop|android> <dev|stable>}"
|
|
channel="${2:?usage: should-build.sh <desktop|android> <dev|stable>}"
|
|
|
|
case "$artifact" in desktop|android) : ;; *)
|
|
echo "should-build.sh: unknown artifact '$artifact'" >&2; exit 2 ;;
|
|
esac
|
|
case "$channel" in dev|stable) : ;; *)
|
|
echo "should-build.sh: unknown channel '$channel'" >&2; exit 2 ;;
|
|
esac
|
|
|
|
# The value that answers "is this the same code?" — which is not the same as the one
|
|
# the guard compares.
|
|
#
|
|
# desktop the ordering key IS the identity; one value, one clock.
|
|
# android the NAME. Its versionCode is build-time and moves every run, so
|
|
# comparing that would report a change on every push and never skip.
|
|
case "$artifact" in
|
|
desktop) derived="$(sh "$ROOT/packaging/version.sh" key desktop)" ;;
|
|
android) derived="$(sh "$ROOT/packaging/version.sh" display android)" ;;
|
|
esac
|
|
|
|
published="$(sh "$ROOT/packaging/guard-forward.sh" published "$artifact" "$channel")"
|
|
|
|
if [ -z "$published" ]; then
|
|
echo "should-build: $channel serves no $artifact yet — building." >&2
|
|
echo true
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$derived" = "$published" ]; then
|
|
# UNCHANGED. The channel is already serving this exact source, so a build would
|
|
# produce the same artifact under the same name and republish it for nothing.
|
|
#
|
|
# Skipping is safe here in a way it would not be if anything pinned: there is no
|
|
# version tag to re-push with different bytes, so this stands on cost alone.
|
|
echo "should-build: $channel already serves $artifact $derived — skipping." >&2
|
|
echo false
|
|
exit 0
|
|
fi
|
|
|
|
echo "should-build: $artifact moved $published -> $derived — building." >&2
|
|
echo true
|