Fetch only the website audio from Gitea LFS
Cloudflare Pages / Build and verify the site (push) Failing after 2m12s

This commit is contained in:
waozi committed 2026-11-20 01:01:00 -03:00
1 parent 43be710898
commit a0bfacaf29
2 files changed
+33 -1

No files matched your search

+5 -1
View File
@@ -23,10 +23,14 @@ jobs:
steps:
- name: Check out Breeze from Gitea
uses: https://github.com/actions/checkout@v4
env:
GIT_LFS_SKIP_SMUDGE: '1'
with:
lfs: true
persist-credentials: false
- name: Fetch the website's audio from Gitea LFS
run: sh site/fetch-meditation-audio.sh
- name: Set up Node.js
uses: https://github.com/actions/setup-node@v4
with:
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
# Pages needs the three meditation tracks. The published app bundle already
# contains its own assets, so no native or design LFS objects are needed here.
sources=$(git ls-files -- 'unpackaged_assets/audio/*.ogg')
test -n "$sources"
printf '%s\n' "$sources" | while IFS= read -r audio; do
test -f "$audio"
if [ "$(head -c 4 "$audio")" = OggS ]; then
continue
fi
git lfs pointer --check --file="$audio"
oid=$(sed -n 's/^oid sha256://p' "$audio")
size=$(sed -n 's/^size //p' "$audio")
download=$(mktemp "$audio.XXXXXX")
trap 'rm -f "$download"' 0
curl -fsSL --max-time 120 --retry 2 \
"https://git.waozi.xyz/waozi/breeze.git/info/lfs/objects/$oid" -o "$download"
test "$(wc -c < "$download")" -eq "$size"
printf '%s %s\n' "$oid" "$download" | sha256sum --check --status
test "$(head -c 4 "$download")" = OggS
chmod 644 "$download"
mv -f "$download" "$audio"
trap - 0
printf 'Verified %s from Gitea LFS\n' "$audio"
done