2 Commits
Author SHA1 Message Date
NeilClack 5caf1d6ef8 Move to checksums.md5
build-dev / nix-build (push) Failing after 13s
Server is scheduled to generate this file nightly
2026-08-23 12:39:05 -05:00
NeilClack e17e881c00 Split builds 2026-08-23 12:38:44 -05:00
3 changed files with 88 additions and 22 deletions
+70
View File
@@ -0,0 +1,70 @@
name: build-dev
on:
# Every push to dev: build, run the offline test suite, publish to the
# dev Attic cache.
push:
branches: [dev]
jobs:
nix-build:
runs-on: build-server
steps:
# actions/checkout@v4 is unreliable on host-mode runners (its files are
# copied into the workspace instead of the repo), so clone explicitly.
- name: Checkout
run: |
rm -rf ./* ./.[!.]* 2>/dev/null || true
git config --global http.extraheader "Authorization: token ${{ github.token }}"
git clone --branch "${{ gitea.ref_name }}" \
"${{ gitea.server_url }}/${{ gitea.repository }}.git" .
test -f flake.nix
git log --oneline -1
- name: Inspect workspace
run: |
pwd
ls -la
git rev-parse --show-toplevel 2>&1 || true
git remote -v 2>&1 || true
git describe --tags --always 2>&1 || true
test -f flake.nix && echo "flake.nix present" || echo "NO flake.nix"
# Dev builds fingerprint as the short commit hash.
# Persisted via GITHUB_ENV so the impure nix eval below reads it via
# builtins.getEnv.
- name: Compute version
run: |
echo "APP_VERSION=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
# checks is keyed per-system (checks.<system>.default); nix build's
# #attr shorthand can't resolve it, so resolve the current system inline.
# --impure lets the flake read APP_VERSION via builtins.getEnv
# (pure evals always get the package defaults). The offline test suite
# runs in the package's checkPhase.
- name: Build + offline test suite
run: nix build -L ".#checks.$(nix eval --impure --raw --expr 'builtins.currentSystem').default" --impure
- name: Live portal tests
env:
RWT_LIVE_ACCOUNT_EMAIL: ${{ secrets.RWT_LIVE_ACCOUNT_EMAIL }}
RWT_LIVE_LICENSE_EMAIL: ${{ secrets.RWT_LIVE_LICENSE_EMAIL }}
RWT_LIVE_LICENSE_KEY: ${{ secrets.RWT_LIVE_LICENSE_KEY }}
run: |
nix develop --command bash -c '
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build --target test_api_client test_license_service
./build/test_api_client
./build/test_license_service
'
# Dev closure lands in the dev cache.
- name: Push to Attic dev cache
env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN_DEV }}
run: |
nix profile install github:zhaofengli/attic#attic-client \
--extra-experimental-features "nix-command flakes"
attic login radiantwave https://attic.radiantwavetech.com "$ATTIC_TOKEN"
attic push radiantwave:radiantwave-dev ./result
@@ -1,9 +1,8 @@
name: build name: build-main
on: on:
# Manual only for now. Select the branch to build when dispatching: # Manual only. Dispatch against main: build, run the offline test suite,
# main -> APP_VERSION is the current git tag # publish to the release Attic cache.
# dev -> APP_VERSION is the current commit hash
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@@ -12,8 +11,8 @@ jobs:
steps: steps:
# actions/checkout@v4 is unreliable on host-mode runners (its files are # actions/checkout@v4 is unreliable on host-mode runners (its files are
# copied into the workspace instead of the repo), so clone explicitly. # copied into the workspace instead of the repo), so clone explicitly.
# A full clone (no --depth) is required so `git describe --tags` on main # A full clone (no --depth) is required so `git describe --tags` resolves
# resolves the real nearest tag instead of falling back to a hash. # the real nearest tag instead of falling back to a hash.
- name: Checkout - name: Checkout
run: | run: |
rm -rf ./* ./.[!.]* 2>/dev/null || true rm -rf ./* ./.[!.]* 2>/dev/null || true
@@ -32,18 +31,12 @@ jobs:
git describe --tags --always 2>&1 || true git describe --tags --always 2>&1 || true
test -f flake.nix && echo "flake.nix present" || echo "NO flake.nix" test -f flake.nix && echo "flake.nix present" || echo "NO flake.nix"
# Compute the version string baked into the binary's Home footer: # Release builds report the current git tag.
# main reports the git tag, dev reports the commit hash fingerprint. # Persisted via GITHUB_ENV so the impure nix eval below reads it via
# The key stays in the build step's environment (never echoed). # builtins.getEnv.
- name: Compute version - name: Compute version
id: version
run: | run: |
if [ "${{ gitea.ref_name }}" = "main" ]; then echo "APP_VERSION=$(git describe --tags --always)" >> "$GITHUB_ENV"
APP_VERSION="$(git describe --tags --always)"
else
APP_VERSION="$(git rev-parse --short HEAD)"
fi
echo "Branch: ${{ gitea.ref_name }} -> APP_VERSION=$APP_VERSION"
# checks is keyed per-system (checks.<system>.default); nix build's # checks is keyed per-system (checks.<system>.default); nix build's
# #attr shorthand can't resolve it, so resolve the current system inline. # #attr shorthand can't resolve it, so resolve the current system inline.
@@ -66,10 +59,13 @@ jobs:
./build/test_license_service ./build/test_license_service
' '
- name: Push to Attic cache # Release closure lands in the release cache.
- name: Push to Attic release cache
env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN_PROD }}
run: | run: |
nix profile install github:zhaofengli/attic#attic-client \ nix profile install github:zhaofengli/attic#attic-client \
--extra-experimental-features "nix-command flakes" --extra-experimental-features "nix-command flakes"
attic login radiantwave https://attic.radiantwavetech.com "${{ secrets.ATTIC_TOKEN }}" attic login radiantwave https://attic.radiantwavetech.com "$ATTIC_TOKEN"
attic push radiantwave ./result-kiosk ./result-android ./result-commercial attic push radiantwave:radiantwave ./result
+3 -3
View File
@@ -37,7 +37,7 @@ struct AudioManifestEntry {
// and keeps the database's audio_files table in sync with what is actually // and keeps the database's audio_files table in sync with what is actually
// on disk. // on disk.
// //
// Fetches new_checksums.md5, compares each entry against the local file's MD5, // Fetches checksums.md5, compares each entry against the local file's MD5,
// and re-downloads anything that is missing or whose checksum differs. // and re-downloads anything that is missing or whose checksum differs.
// Files present on disk but absent from the manifest are deleted, and the // Files present on disk but absent from the manifest are deleted, and the
// audio_files table is reconciled on every pass (and after each individual // audio_files table is reconciled on every pass (and after each individual
@@ -68,7 +68,7 @@ public:
static constexpr const char *AUDIO_BASE_URL = static constexpr const char *AUDIO_BASE_URL =
"https://files.radiantwavetech.com/audio/"; "https://files.radiantwavetech.com/audio/";
static constexpr const char *MANIFEST_FILENAME = "new_checksums.md5"; static constexpr const char *MANIFEST_FILENAME = "checksums.md5";
private: private:
void run(); void run();
@@ -88,7 +88,7 @@ private:
db::DatabaseManager *db_ = nullptr; db::DatabaseManager *db_ = nullptr;
}; };
// Parses new_checksums.md5 manifest text into entries. Blank lines and lines // Parses checksums.md5 manifest text into entries. Blank lines and lines
// starting with '#' are ignored. Lines that don't match a known format are // starting with '#' are ignored. Lines that don't match a known format are
// skipped. Returns false if no valid entries were found. // skipped. Returns false if no valid entries were found.
bool parseManifest(const std::string &text, bool parseManifest(const std::string &text,