@@ -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 }}
0 commit comments