From 745a7249e979bc4e30637c66530a50ae8c8cfc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Fri, 5 Jun 2026 00:33:25 +0000 Subject: [PATCH] fix(publish): purge jsDelivr cache after stable release --- .github/workflows/publish.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dc17b8d012..f6c1c906d8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -184,3 +184,18 @@ jobs: fi gh release create "v${VERSION}" "${FLAGS[@]}" fi + + - name: Purge jsDelivr cache for latest-tagged packages + if: steps.version.outputs.prerelease == 'false' + run: | + # jsDelivr caches unversioned URLs against the npm `latest` tag. + # After publishing a new stable release, purge so the unversioned + # CDN URLs immediately serve the new version instead of stale content. + urls=( + "https://purge.jsdelivr.net/npm/@hyperframes/core/dist/hyperframe.runtime.iife.js" + "https://purge.jsdelivr.net/npm/@hyperframes/core/dist/hyperframe.runtime.mjs" + ) + for url in "${urls[@]}"; do + resp=$(curl -sf "$url" 2>/dev/null || echo '{"status":"error"}') + echo "Purged $url: $resp" + done