@krx3d/tizentube2 1.30.0 → 1.30.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -377,6 +377,35 @@ jobs:
|
|
|
377
377
|
# --------------------
|
|
378
378
|
# PUBLISH
|
|
379
379
|
# --------------------
|
|
380
|
+
# --------------------
|
|
381
|
+
# Guard: never publish a tarball whose dist does not match its version
|
|
382
|
+
# --------------------
|
|
383
|
+
# Confirmed on 1.30.0: the tarball carried package.json 1.30.0 alongside a
|
|
384
|
+
# dist/userScript.js stamped 1.16.10, so every TV pulling the CDN got a
|
|
385
|
+
# build five releases old while the settings menu reported the new number.
|
|
386
|
+
#
|
|
387
|
+
# It came from re-running a failed run. A re-run replays the ORIGINAL
|
|
388
|
+
# commit, so it bumped and built at the old version, and then the
|
|
389
|
+
# `git rebase origin/main` below took main's newer package.json while
|
|
390
|
+
# keeping the dist it had already built. package.json and dist are only
|
|
391
|
+
# guaranteed to agree when a run builds them together, and nothing checked
|
|
392
|
+
# that they still did by the time publish happened.
|
|
393
|
+
- name: Verify dist matches package.json version
|
|
394
|
+
if: success()
|
|
395
|
+
run: |
|
|
396
|
+
set -euo pipefail
|
|
397
|
+
VER="$(node -p "require('./package.json').version")"
|
|
398
|
+
echo "package.json version: ${VER}"
|
|
399
|
+
for f in dist/userScript.js dist/service.js; do
|
|
400
|
+
test -f "$f" || { echo "::error::${f} is missing"; exit 1; }
|
|
401
|
+
done
|
|
402
|
+
if ! grep -qF "\"${VER}\"" dist/userScript.js; then
|
|
403
|
+
FOUND="$(grep -aoE '\"[0-9]+\.[0-9]+\.[0-9]+\"' dist/userScript.js | sort -u | head -3 | xargs echo)"
|
|
404
|
+
echo "::error::dist/userScript.js was not built from this version. package.json says ${VER}; the bundle contains ${FOUND:-no version string}. Re-run the workflow from a fresh push rather than re-running an old run, so the bump and the build happen together."
|
|
405
|
+
exit 1
|
|
406
|
+
fi
|
|
407
|
+
echo "dist/userScript.js carries ${VER}"
|
|
408
|
+
|
|
380
409
|
- name: Publish package to npm
|
|
381
410
|
if: success()
|
|
382
411
|
id: publish_npm
|