| … | … | @@ -40,8 +40,16 @@ steps: |
| 40 | 40 | # Untracked files WARN rather than block: cp -rL ships them too, but they are usually probe |
| 41 | 41 | # scripts, and blocking on them would make the build unusable. Escape hatch for an emergency: |
| 42 | 42 | # PGV3_ALLOW_UNPUSHED_SIBLINGS=1. |
| 43 | # |
| 44 | # The list is DERIVED from package.json's file: deps — never hardcoded. It used to be |
| 45 | # spelled out here AND in the vendor step AND in a third hyper-svc-only step, and nothing |
| 46 | # kept the three in sync. Adding favela-community to package.json (0.9.36) without touching |
| 47 | # the other two broke `pgh publish` for every build after it, silently, for ~10 days. |
| 48 | SIBS=$(node -e 'const d=require("./package.json");const a={...d.dependencies,...d.devDependencies};console.log(Object.entries(a).filter(([,v])=>String(v).startsWith("file:")).map(([k])=>k).join(" "))') |
| 49 | echo "siblings (derived from package.json): $SIBS" |
| 50 | [ -n "$SIBS" ] || { echo "no file: siblings found — package.json unreadable?"; exit 1; } |
| 43 | 51 | rc=0 |
| 44 | | for pkg in hyper-svc atproto-repo atproto-identity atproto-store atproto-did-peer; do |
| 52 | for pkg in $SIBS; do |
| 45 | 53 | SRC=/storage/projects/code/hypercore-kb/hyper-fleeky/$pkg |
| 46 | 54 | [ -d "$SRC" ] || SRC="$HOME/hyper-fleeky/$pkg" |
| 47 | 55 | [ -d "$SRC/.git" ] || { echo " $pkg: not a git checkout — skipped"; continue; } |
| … | … | @@ -65,24 +73,29 @@ steps: |
| 65 | 73 | exit $rc |
| 66 | 74 | timeout: 60 |
| 67 | 75 | |
| 68 | | - name: vendor hyper-svc sibling into the closure |
| 69 | | run: | |
| 70 | | SRC=/storage/projects/code/hypercore-kb/hyper-fleeky/hyper-svc |
| 71 | | [ -d "$SRC" ] || SRC="$HOME/hyper-fleeky/hyper-svc" |
| 72 | | rm -rf node_modules/hyper-svc && cp -rL "$SRC" node_modules/hyper-svc && echo "vendored hyper-svc from $SRC" |
| 73 | | timeout: 120 |
| 74 | | |
| 75 | | # atproto-repo + atproto-identity were extracted to sibling repos (peer/bridge split) |
| 76 | | # and are file:../ deps — same git-archive gap as hyper-svc. Vendor dereferenced copies. |
| 77 | | # NOTE: requires the sibling repos present on the build machine (KB path or $HOME). |
| 78 | | - name: vendor extracted atproto-repo + atproto-identity siblings |
| 76 | # WHY THIS STEP EXISTS: the CI git-archives ONLY atproto-bridge into /tmp, so every `file:../` |
| 77 | # sibling is left as a BROKEN SYMLINK and the published tree lacks it — the daemon then |
| 78 | # crash-loops MODULE_NOT_FOUND on import. `cp -rL` dereferences a real copy into the closure. |
| 79 | # |
| 80 | # ONE list, derived from package.json, matching the guard step above. Previously this was three |
| 81 | # hardcoded lists (guard / hyper-svc / the rest) that drifted apart; see the note in the guard. |
| 82 | # NB: the name is QUOTED — an unquoted "file:" here is a second colon and YAML reads it as a |
| 83 | # nested mapping ("mapping values are not allowed here"). Same trap #26 hit. |
| 84 | - name: "vendor file: siblings into the closure" |
| 79 | 85 | run: | |
| 80 | | for pkg in atproto-repo atproto-identity atproto-store atproto-did-peer; do |
| 86 | SIBS=$(node -e 'const d=require("./package.json");const a={...d.dependencies,...d.devDependencies};console.log(Object.entries(a).filter(([,v])=>String(v).startsWith("file:")).map(([k])=>k).join(" "))') |
| 87 | [ -n "$SIBS" ] || { echo "no file: siblings found — refusing to publish a tree with unresolved deps"; exit 1; } |
| 88 | rc=0 |
| 89 | for pkg in $SIBS; do |
| 81 | 90 | SRC=/storage/projects/code/hypercore-kb/hyper-fleeky/$pkg |
| 82 | 91 | [ -d "$SRC" ] || SRC="$HOME/hyper-fleeky/$pkg" |
| 83 | | rm -rf "node_modules/$pkg" && cp -rL "$SRC" "node_modules/$pkg" && echo "vendored $pkg from $SRC" |
| 92 | if [ ! -d "$SRC" ]; then echo " $pkg: NOT FOUND on this build machine — refuse"; rc=1; continue; fi |
| 93 | rm -rf "node_modules/$pkg" && cp -rL "$SRC" "node_modules/$pkg" && echo " vendored $pkg from $SRC" |
| 84 | 94 | done |
| 85 | | timeout: 120 |
| 95 | # Fail LOUD rather than let `pgh publish` discover the gap: publish's own refusal is correct |
| 96 | # but it reports one sibling at a time and reads like a publish bug, not a vendoring bug. |
| 97 | exit $rc |
| 98 | timeout: 180 |
| 86 | 99 | |
| 87 | 100 | - name: pgh publish (content-addressed → installable app) |
| 88 | 101 | run: pgh publish . --accept-conflict "automated CI publish; dep version-splits inherited from per-app lockfiles across the pgh ecosystem" |