ci: add Surface Tag release+purge (Step 2) + drop the stale bundle-guard - #74
Open
vighnesh-radhakrishnan wants to merge 4 commits into
Open
ci: add Surface Tag release+purge (Step 2) + drop the stale bundle-guard#74vighnesh-radhakrishnan wants to merge 4 commits into
vighnesh-radhakrishnan wants to merge 4 commits into
Conversation
…guard surface-forms (packages/surface-scripts) now owns the tag source and pushes the built surface_tag.js / surface_embed_v1.js to this repo. Add the release-and-purge workflow: on a push to main that changes those files, cut the next semver release (so jsDelivr @latest advances) and purge the CDN (raw + .min.js) fail-loud. Remove the ci.yml 'Bundle is up to date' step — it rebuilds from this repo's now non-authoritative src/ and would diff against the pushed bytes and red main.
|
A malformed or pre-release latest tag (e.g. v1.1.9-beta, nightly) would otherwise split into non-numeric fields and produce an invalid/duplicate tag that silently stops @latest from advancing. Validate ^v?N.N.N and fail loud on a bad shape.
gh api releases/latest exits non-zero on 404 (no releases yet) AND on auth/rate-limit/network/5xx. The old '|| echo v1.1.0' treated both the same, so a transient API error derived v1.1.1 — which either collides with an existing tag (hard fail after the bytes are already on main, so @latest is stuck) or, when below the true latest, silently fails to advance @latest while the job goes green. Only fall back to v1.1.0 on a genuine 404; fail loud on any other error.
The tag validation accepted zero-padded numeric components (e.g. v1.1.008),
whose patch is then read by Bash arithmetic as octal ("008" -> value too
great for base), aborting release creation and leaving @latest stale.
Tighten the regex to reject leading zeros (no-leading-zero semver), so a
malformed latest tag fails loudly and early, and force base-10 on the
increment as defense-in-depth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Step 2 of the two-step Surface Tag publish pipeline (surface-forms now owns the tag source).
release-and-purge.yml: on a push tomainthat changessurface_tag.js/surface_embed_v1.js, cut the next semver release (bump PATCH of the latest, e.g.v1.1.8→v1.1.9, target = the pushed commit) so jsDelivr@latestadvances to exactly these bytes, then purge the jsDelivr cache for both the raw and.min.jsfiles at@latest/@main, fail-loud if any purge fails. Uses this repo's ownGITHUB_TOKEN(contents: write) — no provisioned token.ci.yml"Bundle is up to date" step:surface-forms(packages/surface-scripts) now builds and pushes the two artifacts here, so rebuilding from this repo's (now non-authoritative)src/would diff against the pushed bytes and red main. Typecheck + unit tests stay.Why
Source of truth is moving into
surface-forms; this repo becomes the public jsDelivr serving shelf. Step 1 (in surface-forms) pushes the built files; this Step 2 reacts to that push to release + cache-bust so customers get the update.Pipeline
surface-formsedit → build → Step 1 push (GitHub App) → this repo'smain→ Step 2 (this PR): release + purge → jsDelivr@latest→ customers.Notes
cdn-cutover-testbranch (Step 2 ismain-only, so it won't fire there; the release + pinned-URL purge are done by hand during the rehearsal). This PR is for the realmaincutover.@latest= highest stable semver; date tags with leading zeros aren't valid semver.ci.ymlguard removal was reviewed manually.Pairs with surface-forms PR #5745 (SURF-1936).