Skip to content

Commit 41847c6

Browse files
committed
fix(repo): mirrorlist 同版本漂移根治+自举 CDN 优先+lang-map 补登记解封 Pages——#37
三个耦合问题一次修完: 1. site.yml 步骤顺序错位是漂移根因:db 的 repo-add 用上一轮 run 的 mirrorlist 包字节,而本轮重建的新包在 db 生成之后才落 _site,且 从未进入 unified pool。同日双跑(版本号相同、makepkg 输出不字节 复现)→ Pages 包与 Pages db 校验和不一致。修法:Build mirrorlist package 步整体搬到 Build pacman repo 之前,并在包解析后把新包 覆盖进 feed pool(rm+cp 保证池内恰一份新字节),使 db/CDN/Pages/ tag 四方同一字节。 2. install.sh 自举节原只写 Pages 单源,首笔 pacman 交易必踩漂移包。 改为五个 CDN 主机优先、Pages 垫底(与脚本内置快照逐行一致)。 3. verify-site-structure 断言⑤要求 lang-map 反向登记全部页面; Push261013/261016 五语 wiki 页未登记致连续 11 个 run 失败、 Pages 自 10-13 起冻结(新批次包根本没上 Pages)。补 2 条目解封。 验证:yaml.safe_load OK;tools/verify-site-structure.sh 全过; bash -n install.sh OK;json.tool OK。
1 parent d7b6024 commit 41847c6

3 files changed

Lines changed: 107 additions & 71 deletions

File tree

‎.github/workflows/site.yml‎

Lines changed: 77 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -170,75 +170,6 @@ jobs:
170170
done
171171
fi
172172
173-
- name: Build pacman repo
174-
run: |
175-
set -euo pipefail
176-
shopt -s nullglob
177-
# archlinux:base-devel everywhere: one shared image pull per job
178-
# (layers cached across steps) and no per-run `pacman -Sy base-devel`
179-
# inside the makepkg container — upstream publishes this variant
180-
# daily/weekly with the group preinstalled (archlinux/archlinux-docker).
181-
mkdir -p _site/repo/Termux/pacman
182-
for pool in feed/pacman/*/; do
183-
pool="${pool%/}"
184-
base="${pool##*/}"
185-
# the io-repo pool (mirrorlist tag fetch) only feeds the unified
186-
# db + the Pages pkg dir; the mirrorlist pkg is served through the
187-
# [hope2333] server list and has no per-pool db of its own
188-
if [ "$base" = "hope2333.github.io" ]; then continue; fi
189-
docker run --rm -v "$PWD/$pool:/work" archlinux:base-devel bash -c "cd /work && repo-add $base.db.tar.gz *.pkg.tar.*"
190-
cp "$pool/$base.db" "$pool/$base.db.tar.gz" _site/repo/Termux/pacman/
191-
done
192-
# Unified [hope2333] db: latest packages of every feed repo in one pool
193-
# (fresh CI workspace => latest-only snapshot, single version cached)
194-
mkdir -p feed/pacman-unified
195-
cp feed/pacman/*/*.pkg.tar.* feed/pacman-unified/
196-
docker run --rm -v "$PWD/feed/pacman-unified:/work" archlinux:base-devel bash -c 'cd /work && repo-add hope2333.db.tar.gz *.pkg.tar.*'
197-
# repo-add leaves hope2333.db as a symlink; materialize a real copy
198-
# so gh release upload ships content, not the link itself
199-
rm feed/pacman-unified/hope2333.db
200-
cp feed/pacman-unified/hope2333.db.tar.gz feed/pacman-unified/hope2333.db
201-
cp feed/pacman-unified/hope2333.db feed/pacman-unified/hope2333.db.tar.gz _site/repo/Termux/pacman/
202-
cp feed/pacman/*/*.pkg.tar.* _site/repo/Termux/pacman/
203-
204-
- name: Publish unified db to release CDNs
205-
env:
206-
HOPE_PAT: ${{ secrets.HOPE_PAT }}
207-
run: |
208-
set -euo pipefail
209-
if [ -z "$HOPE_PAT" ]; then
210-
echo "HOPE_PAT secret not set — skipping CDN db publish (Pages fallback still serves the db)"
211-
exit 0
212-
fi
213-
export GH_TOKEN="$HOPE_PAT"
214-
DB="feed/pacman-unified/hope2333.db.tar.gz"
215-
DBRAW="feed/pacman-unified/hope2333.db"
216-
[ -f "$DB" ] && [ -f "$DBRAW" ] || { echo "::error::unified db missing"; exit 1; }
217-
# mirrorlist pkg rides alongside the db on every server: pacman
218-
# fetches pkg files per-server too, so the version the unified db
219-
# references must exist on each CDN (Pages serves the same file)
220-
MLPKG="$(find feed/pacman-unified -maxdepth 1 -name 'hope2333-mirrorlist-*.pkg.tar.xz' ! -name '*-latest-*' | head -1)"
221-
[ -n "$MLPKG" ] || { echo "::error::hope2333-mirrorlist pkg missing from unified pool"; exit 1; }
222-
MLALIAS="feed/pacman-unified/hope2333-mirrorlist-latest-1-any.pkg.tar.xz"
223-
cp "$MLPKG" "$MLALIAS"
224-
fail=0
225-
publish() {
226-
# both names: pacman fetches <repo>.db (uncompressed name); shipping
227-
# only the .tar.gz name made every github CDN 404 on -Sy and fall
228-
# through to the Pages fallback
229-
if gh release upload "$2" -R "$1" "$DB" "$DBRAW" "$MLPKG" "$MLALIAS" --clobber >/dev/null 2>&1; then
230-
echo "published hope2333.db{,.tar.gz} + mirrorlist pkg -> $1@$2"
231-
else
232-
echo "::warning ::db publish failed for $1@$2"; fail=1
233-
fi
234-
}
235-
publish Hope2333/codegraph-termux "$(gh api repos/Hope2333/codegraph-termux/releases/latest --jq .tag_name)"
236-
publish Hope2333/opencode-termux "$(gh api repos/Hope2333/opencode-termux/releases/latest --jq .tag_name)"
237-
publish Hope2333/MiMoCode-Termux Push260829
238-
publish Hope2333/freebuff-termux "$(gh api repos/Hope2333/freebuff-termux/releases/latest --jq .tag_name)"
239-
publish Hope2333/codebuff-termux "$(gh api repos/Hope2333/codebuff-termux/releases/latest --jq .tag_name)"
240-
[ "$fail" -eq 0 ] || echo "::notice ::some db publishes failed; Pages fallback still serves the db"
241-
242173
- name: Build mirrorlist package
243174
run: |
244175
set -euo pipefail
@@ -258,7 +189,7 @@ jobs:
258189
# mirrorlist servers must keep pointing at latest (they mirror the
259190
# unified hope2333.db, which the publish step uploads to latest).
260191
declare -A APT_REPO_PIN=( [opencode-termux]=Push260912 )
261-
mkdir -p build/mirrorlist build/mirrorlist-deb/DEBIAN build/mirrorlist-deb/etc/apt/sources.list.d _site/repo/Termux/apt
192+
mkdir -p build/mirrorlist build/mirrorlist-deb/DEBIAN build/mirrorlist-deb/etc/apt/sources.list.d _site/repo/Termux/apt _site/repo/Termux/pacman
262193
# v11: ship the incident NOTICE + the offline auto-repair script
263194
cp NOTICE.md build/mirrorlist/NOTICE
264195
cp scripts/repair-doubled.sh build/mirrorlist/repair-doubled.sh
@@ -388,6 +319,13 @@ jobs:
388319
PKG="$(find build/mirrorlist -maxdepth 1 -name 'hope2333-mirrorlist-*.pkg.tar.xz' | head -1)"
389320
[ -n "$PKG" ] || { echo "::error::mirrorlist pkg not found on host after makepkg"; ls -la build/mirrorlist || true; exit 1; }
390321
echo "mirrorlist pkg resolved: $PKG"
322+
# Feed the freshly built pkg into the feed pool, REPLACING the tag-
323+
# fetched copy (previous run's bytes): the unified db's repo-add runs
324+
# later (Build pacman repo) and must checksum THESE bytes — the same
325+
# file that goes to _site (Pages), the CDNs and the mirrorlist tag.
326+
mkdir -p feed/pacman/hope2333.github.io
327+
rm -f feed/pacman/hope2333.github.io/hope2333-mirrorlist-*.pkg.tar.xz
328+
cp "$PKG" feed/pacman/hope2333.github.io/
391329
# alias lives in _site (host-writable): build/mirrorlist is docker-
392330
# owned (makepkg uid) and refuses writes from the runner user
393331
cp "$PKG" _site/repo/Termux/pacman/
@@ -420,6 +358,75 @@ jobs:
420358
cp "hope2333-mirrorlist_${FULLVER}_aarch64.deb" _site/repo/Termux/apt/
421359
( cd _site/repo/Termux/apt && dpkg-scanpackages . /dev/null > Packages && gzip -9kc Packages > Packages.gz && apt-ftparchive release . > Release )
422360
361+
- name: Build pacman repo
362+
run: |
363+
set -euo pipefail
364+
shopt -s nullglob
365+
# archlinux:base-devel everywhere: one shared image pull per job
366+
# (layers cached across steps) and no per-run `pacman -Sy base-devel`
367+
# inside the makepkg container — upstream publishes this variant
368+
# daily/weekly with the group preinstalled (archlinux/archlinux-docker).
369+
mkdir -p _site/repo/Termux/pacman
370+
for pool in feed/pacman/*/; do
371+
pool="${pool%/}"
372+
base="${pool##*/}"
373+
# the io-repo pool (mirrorlist tag fetch) only feeds the unified
374+
# db + the Pages pkg dir; the mirrorlist pkg is served through the
375+
# [hope2333] server list and has no per-pool db of its own
376+
if [ "$base" = "hope2333.github.io" ]; then continue; fi
377+
docker run --rm -v "$PWD/$pool:/work" archlinux:base-devel bash -c "cd /work && repo-add $base.db.tar.gz *.pkg.tar.*"
378+
cp "$pool/$base.db" "$pool/$base.db.tar.gz" _site/repo/Termux/pacman/
379+
done
380+
# Unified [hope2333] db: latest packages of every feed repo in one pool
381+
# (fresh CI workspace => latest-only snapshot, single version cached)
382+
mkdir -p feed/pacman-unified
383+
cp feed/pacman/*/*.pkg.tar.* feed/pacman-unified/
384+
docker run --rm -v "$PWD/feed/pacman-unified:/work" archlinux:base-devel bash -c 'cd /work && repo-add hope2333.db.tar.gz *.pkg.tar.*'
385+
# repo-add leaves hope2333.db as a symlink; materialize a real copy
386+
# so gh release upload ships content, not the link itself
387+
rm feed/pacman-unified/hope2333.db
388+
cp feed/pacman-unified/hope2333.db.tar.gz feed/pacman-unified/hope2333.db
389+
cp feed/pacman-unified/hope2333.db feed/pacman-unified/hope2333.db.tar.gz _site/repo/Termux/pacman/
390+
cp feed/pacman/*/*.pkg.tar.* _site/repo/Termux/pacman/
391+
392+
- name: Publish unified db to release CDNs
393+
env:
394+
HOPE_PAT: ${{ secrets.HOPE_PAT }}
395+
run: |
396+
set -euo pipefail
397+
if [ -z "$HOPE_PAT" ]; then
398+
echo "HOPE_PAT secret not set — skipping CDN db publish (Pages fallback still serves the db)"
399+
exit 0
400+
fi
401+
export GH_TOKEN="$HOPE_PAT"
402+
DB="feed/pacman-unified/hope2333.db.tar.gz"
403+
DBRAW="feed/pacman-unified/hope2333.db"
404+
[ -f "$DB" ] && [ -f "$DBRAW" ] || { echo "::error::unified db missing"; exit 1; }
405+
# mirrorlist pkg rides alongside the db on every server: pacman
406+
# fetches pkg files per-server too, so the version the unified db
407+
# references must exist on each CDN (Pages serves the same file)
408+
MLPKG="$(find feed/pacman-unified -maxdepth 1 -name 'hope2333-mirrorlist-*.pkg.tar.xz' ! -name '*-latest-*' | head -1)"
409+
[ -n "$MLPKG" ] || { echo "::error::hope2333-mirrorlist pkg missing from unified pool"; exit 1; }
410+
MLALIAS="feed/pacman-unified/hope2333-mirrorlist-latest-1-any.pkg.tar.xz"
411+
cp "$MLPKG" "$MLALIAS"
412+
fail=0
413+
publish() {
414+
# both names: pacman fetches <repo>.db (uncompressed name); shipping
415+
# only the .tar.gz name made every github CDN 404 on -Sy and fall
416+
# through to the Pages fallback
417+
if gh release upload "$2" -R "$1" "$DB" "$DBRAW" "$MLPKG" "$MLALIAS" --clobber >/dev/null 2>&1; then
418+
echo "published hope2333.db{,.tar.gz} + mirrorlist pkg -> $1@$2"
419+
else
420+
echo "::warning ::db publish failed for $1@$2"; fail=1
421+
fi
422+
}
423+
publish Hope2333/codegraph-termux "$(gh api repos/Hope2333/codegraph-termux/releases/latest --jq .tag_name)"
424+
publish Hope2333/opencode-termux "$(gh api repos/Hope2333/opencode-termux/releases/latest --jq .tag_name)"
425+
publish Hope2333/MiMoCode-Termux Push260829
426+
publish Hope2333/freebuff-termux "$(gh api repos/Hope2333/freebuff-termux/releases/latest --jq .tag_name)"
427+
publish Hope2333/codebuff-termux "$(gh api repos/Hope2333/codebuff-termux/releases/latest --jq .tag_name)"
428+
[ "$fail" -eq 0 ] || echo "::notice ::some db publishes failed; Pages fallback still serves the db"
429+
423430
- name: Upload mirrorlist release
424431
env:
425432
GH_TOKEN: ${{ github.token }}

‎repo/install.sh‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,14 @@ inhope { next }
290290
{ print }
291291
' "$PACMAN_CONF" > "$PACMAN_CONF.tmp" && mv "$PACMAN_CONF.tmp" "$PACMAN_CONF"
292292
if ! grep -q 'pacman.d/hope2333-mirrorlist.conf' "$PACMAN_CONF"; then
293-
printf '\n[hope2333]\nServer = https://hope2333.github.io/repo/Termux/pacman/\nSigLevel = Optional TrustAll\n' >> "$PACMAN_CONF"
293+
{ printf '\n[hope2333]\n'
294+
printf 'Server = https://github.com/Hope2333/codegraph-termux/releases/latest/download/\n'
295+
printf 'Server = https://github.com/Hope2333/opencode-termux/releases/latest/download/\n'
296+
printf 'Server = https://github.com/Hope2333/MiMoCode-Termux/releases/download/Push260829/\n'
297+
printf 'Server = https://github.com/Hope2333/freebuff-termux/releases/latest/download/\n'
298+
printf 'Server = https://github.com/Hope2333/codebuff-termux/releases/latest/download/\n'
299+
printf 'Server = https://hope2333.github.io/repo/Termux/pacman/\n'
300+
printf 'SigLevel = Optional TrustAll\n'; } >> "$PACMAN_CONF"
294301
fi
295302

296303
# ── C. 刷新源 ─────────────────────────────────────────────────────────

‎wiki/tpl/lang-map.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,28 @@
340340
"es": "es/wiki/opencode-termux/release/Push261005"
341341
}
342342
},
343+
"wiki/opencode-termux/release/Push261013": {
344+
"title": "Push261013 Release (stable)",
345+
"status": "full",
346+
"alternates": {
347+
"en": "en/wiki/opencode-termux/release/Push261013",
348+
"zh_CN": "zh_CN/wiki/opencode-termux/release/Push261013",
349+
"zh_TW": "zh_TW/wiki/opencode-termux/release/Push261013",
350+
"ja": "ja/wiki/opencode-termux/release/Push261013",
351+
"es": "es/wiki/opencode-termux/release/Push261013"
352+
}
353+
},
354+
"wiki/opencode-termux/release/Push261016": {
355+
"title": "Push261016 Release (stable)",
356+
"status": "full",
357+
"alternates": {
358+
"en": "en/wiki/opencode-termux/release/Push261016",
359+
"zh_CN": "zh_CN/wiki/opencode-termux/release/Push261016",
360+
"zh_TW": "zh_TW/wiki/opencode-termux/release/Push261016",
361+
"ja": "ja/wiki/opencode-termux/release/Push261016",
362+
"es": "es/wiki/opencode-termux/release/Push261016"
363+
}
364+
},
343365
"wiki/docs": {
344366
"title": "Docs",
345367
"status": "full",

0 commit comments

Comments
 (0)