fix(ext-ci): add diagnostic tracing to commit step to surface why run #309 reported success without producing the XPI side-commit — Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -45,34 +45,52 @@ jobs:
|
|||||||
WEB_EXT_API_SECRET: ${{ secrets.MOZILLA_AMO_JWT_SECRET }}
|
WEB_EXT_API_SECRET: ${{ secrets.MOZILLA_AMO_JWT_SECRET }}
|
||||||
- name: Commit signed XPI to frontend/public/extension/
|
- name: Commit signed XPI to frontend/public/extension/
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -ex
|
||||||
# AMO renames signed XPIs using its internal addon-id-safe-string
|
# AMO renames signed XPIs using its internal addon-id-safe-string
|
||||||
# (e.g. 997017ca3e104e30a75a-1.0.1.xpi), NOT our gecko ID. The
|
# (e.g. 997017ca3e104e30a75a-1.0.1.xpi), NOT our gecko ID. Match
|
||||||
# original 'fabledcurator-*' glob never matched and the step
|
# any *.xpi in the artifacts dir — fresh CI runner means there's
|
||||||
# exited 1 even on a successful sign (operator-flagged
|
# exactly one — and rename it on copy so the FC server's
|
||||||
# 2026-05-25). Match any *.xpi in the artifacts dir — fresh
|
# whitelist (backend/app/frontend.py expects 'fabledcurator-*.xpi')
|
||||||
# CI runner means there's exactly one — and rename it on copy
|
# keeps working.
|
||||||
# so the FC server's whitelist (backend/app/frontend.py expects
|
# Diagnostic instrumentation 2026-05-25: a prior run (id 1731)
|
||||||
# 'fabledcurator-*.xpi') keeps working.
|
# reported success without producing an `ext: publish signed XPI`
|
||||||
|
# commit on main. Tracing the cwd, artifacts dir, version
|
||||||
|
# extraction, staging state, and push response so the next run's
|
||||||
|
# log explains the gap.
|
||||||
|
echo "=== cwd ==="
|
||||||
|
pwd
|
||||||
|
echo "=== ref / branch ==="
|
||||||
|
echo "ref: ${GITHUB_REF:-unset} sha: ${GITHUB_SHA:-unset}"
|
||||||
|
git log --oneline -3 || true
|
||||||
|
echo "=== artifacts dir ==="
|
||||||
|
ls -la extension/web-ext-artifacts/ 2>&1 || echo "(dir missing)"
|
||||||
XPI=$(ls extension/web-ext-artifacts/*.xpi 2>/dev/null | head -1)
|
XPI=$(ls extension/web-ext-artifacts/*.xpi 2>/dev/null | head -1)
|
||||||
|
echo "XPI=$XPI"
|
||||||
if [ -z "$XPI" ]; then
|
if [ -z "$XPI" ]; then
|
||||||
echo "No XPI produced by web-ext sign — exiting"
|
echo "No XPI produced by web-ext sign — exiting"
|
||||||
ls -la extension/web-ext-artifacts/ || true
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
VERSION=$(grep -E '"version"' extension/package.json | head -1 | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/')
|
VERSION=$(grep -E '"version"' extension/package.json | head -1 | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/')
|
||||||
|
echo "VERSION=$VERSION"
|
||||||
DEST="frontend/public/extension/fabledcurator-${VERSION}.xpi"
|
DEST="frontend/public/extension/fabledcurator-${VERSION}.xpi"
|
||||||
|
echo "DEST=$DEST"
|
||||||
mkdir -p frontend/public/extension
|
mkdir -p frontend/public/extension
|
||||||
# Wipe any prior versions so the directory doesn't grow each release.
|
# Wipe any prior versions so the directory doesn't grow each release.
|
||||||
rm -f frontend/public/extension/fabledcurator-*.xpi
|
rm -f frontend/public/extension/fabledcurator-*.xpi
|
||||||
cp "$XPI" "$DEST"
|
cp "$XPI" "$DEST"
|
||||||
cp "$XPI" "frontend/public/extension/fabledcurator-latest.xpi"
|
cp "$XPI" "frontend/public/extension/fabledcurator-latest.xpi"
|
||||||
|
echo "=== frontend/public/extension/ after copy ==="
|
||||||
|
ls -la frontend/public/extension/
|
||||||
git config user.name "FC extension CI"
|
git config user.name "FC extension CI"
|
||||||
git config user.email "noreply@fabledsword.com"
|
git config user.email "noreply@fabledsword.com"
|
||||||
git add frontend/public/extension/
|
git add frontend/public/extension/
|
||||||
|
echo "=== git status after add ==="
|
||||||
|
git status --short
|
||||||
|
echo "=== diff --cached --stat ==="
|
||||||
|
git diff --cached --stat || true
|
||||||
if git diff --cached --quiet; then
|
if git diff --cached --quiet; then
|
||||||
echo "No changes to commit"
|
echo "No changes to commit (frontend/public/extension/ matches HEAD)"
|
||||||
else
|
else
|
||||||
git commit -m "ext: publish signed XPI fabledcurator-${VERSION}.xpi"
|
git commit -m "ext: publish signed XPI fabledcurator-${VERSION}.xpi"
|
||||||
git push origin HEAD:main
|
git push -v origin HEAD:main
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user