Build Pages with pinned static site assets
Cloudflare Pages / Build and verify the site (push) Failing after 2m31s

This commit is contained in:
waozi committed 2026-11-20 01:28:43 -03:00
1 parent ab8dd4cce3
commit 6b4d1d2c54
5 files changed
+54 -16

No files matched your search

+8 -12
View File
@@ -18,7 +18,6 @@ jobs:
runs-on: alpha-ubuntu24.04
timeout-minutes: 45
env:
PACKAGE_FLAGS: --locked
SITE_ASSET_VERSION: ${{ gitea.sha }}
steps:
- name: Check out Breeze from Gitea
@@ -39,16 +38,12 @@ jobs:
- name: Install site build dependencies
run: USER="$(id -un)" .github/scripts/install-apt-packages.sh .github/apt/empty-packages.txt apt-utils gnupg ripgrep unzip zip zstd
- name: Resolve locked package sources on Gitea
env:
GIT_CONFIG_COUNT: '3'
GIT_CONFIG_KEY_0: url.https://git.waozi.xyz/waozi/.insteadOf
GIT_CONFIG_VALUE_0: https://github.com/waozixyz/
GIT_CONFIG_KEY_1: url.https://git.waozi.xyz/kryonlabs/.insteadOf
GIT_CONFIG_VALUE_1: https://github.com/kryonlabs/
GIT_CONFIG_KEY_2: url.https://git.waozi.xyz/ziranlang/.insteadOf
GIT_CONFIG_VALUE_2: https://github.com/ziranlang/
run: make packages
- name: Fetch the pinned site icons from Gitea
run: |
set -eu
kryon_dir="$PWD/build/site-kryon"
sh site/fetch-kryon-icons.sh "$kryon_dir"
printf 'KRYON_DIR=%s\n' "$kryon_dir" >> "$GITHUB_ENV"
- name: Select the verified web app origin
if: gitea.event_name != 'pull_request'
@@ -68,7 +63,8 @@ jobs:
- name: Test website routes, assets and Telegram bridge
run: |
make site-assets-test apt-repo-test
node tests/site_assets_test.mjs
sh tests/apt_repo_test.sh
node tests/telegram_bridge_test.mjs
- name: Deploy current master to Cloudflare Pages
+2 -2
View File
@@ -32,10 +32,10 @@ mkdir -p "$release_dir/app"
unzip -q "$release_dir/inbe-web.zip" -d "$release_dir/app"
test -s "$release_dir/app/index.wasm"
make package-unpackaged-assets
make -f site/production.mk package-unpackaged-assets
SITE_WEB_DIR="$PWD/$release_dir/app" sh site/build.sh
# Gitea's job token is only valid on Gitea. Downloads still follow the public release.
env -u GITHUB_TOKEN -u GH_TOKEN make site-release-assets-check
env -u GITHUB_TOKEN -u GH_TOKEN make -f site/production.mk site-release-assets-check
if [ -n "${APT_SIGNING_KEY:-}" ]; then
deb_dir="$release_dir/debs"
+2 -2
View File
@@ -34,7 +34,7 @@ copy_dir_contents() {
sync_shared_web_icons() {
sync_script="$kryon_dir/scripts/sync-icons.sh"
require_path "$sync_script"
sh "$sync_script" "$root_dir/web-assets/icons" platforms language tiles
sh "$sync_script" "$out_dir/web-assets/icons" platforms language tiles
}
expand_template_file() {
@@ -230,8 +230,8 @@ fi
mkdir -p "$out_dir/legacy-converter"
cp "$out_dir/legacy-converter.html" "$out_dir/legacy-converter/index.html"
sync_shared_web_icons
copy_dir_contents "$root_dir/web-assets" "$out_dir/web-assets"
sync_shared_web_icons
# Keep the released app's audio URL available alongside the current archive name.
copy_path "$out_dir/web-assets/dl/breathing-meditation-audio-v1.zip" "$out_dir/web-assets/dl/inbe-meditation-audio-v1.zip"
copy_dir_contents "$root_dir/site-icons" "$out_dir/site-icons"
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
destination=${1:?Usage: fetch-kryon-icons.sh DESTINATION}
revision=$(python3 - <<'PY'
import json
import re
from pathlib import Path
lock = json.loads(Path('ziran.lock').read_text())
pins = [package['commit'] for package in lock['packages'] if package['name'] == 'kryon']
if len(pins) != 1 or not re.fullmatch(r'[0-9a-f]{40}', pins[0]):
raise SystemExit('Expected one pinned Kryon commit in ziran.lock')
print(pins[0])
PY
)
mkdir -p "$destination/icons" "$destination/scripts"
for file in scripts/sync-icons.sh icons/platforms.png icons/platforms.json \
icons/language.png icons/language.json icons/tiles.png icons/tiles.json; do
temporary=$(mktemp "$destination/$file.XXXXXX")
trap 'rm -f "$temporary"' 0
curl -fsSL --max-time 30 --retry 2 \
"https://git.waozi.xyz/kryonlabs/kryon/raw/commit/$revision/$file" -o "$temporary"
test -s "$temporary"
chmod 644 "$temporary"
mv -f "$temporary" "$destination/$file"
trap - 0
done
printf 'Fetched the site icon sheets from Kryon commit %s\n' "$revision"
+12
View File
@@ -0,0 +1,12 @@
# Pages uses the released web app and builds only the website's downloads.
UNPACKAGED_AUDIO_DIR := unpackaged_assets/audio
UNPACKAGED_AUDIO_FILES := $(shell git ls-files -- $(UNPACKAGED_AUDIO_DIR))
MEDITATION_AUDIO_TRACKS := $(patsubst $(UNPACKAGED_AUDIO_DIR)/%,%,$(filter %.ogg,$(UNPACKAGED_AUDIO_FILES)))
MEDITATION_AUDIO_ZIP := web-assets/dl/breathing-meditation-audio-v1.zip
ifeq ($(strip $(MEDITATION_AUDIO_TRACKS)),)
$(error No tracked meditation audio files)
endif
MAKE := $(MAKE) -f site/production.mk
.PHONY: validate-meditation-audio package-unpackaged-assets site-release-assets-check
include mk/site.mk