diff --git a/.github/workflows/sync-about.yml b/.github/workflows/sync-about.yml index 5f62c378..af0a7437 100644 --- a/.github/workflows/sync-about.yml +++ b/.github/workflows/sync-about.yml @@ -9,7 +9,8 @@ name: Sync indicator count # 2. GitHub repo "About" description — synced on push to main / v* tag # 3. Docs site: index.md / overview.md / Indicators-Overview.md # (wickra-lib/wickra-docs) — synced on push to main / v* tag* -# 4. site/index.md (local-only marketing site, not synced from CI) +# 4. Marketing site count (wickra-lib/webpage: index.md / +# .vitepress/config.ts / public/hero.svg) — push to main / v* tag* # 5. org profile README count (wickra-lib/.github, profile/README.md) # — synced on push to main / v* tag* # 6. org description ("… N indicators, install-free.") @@ -17,13 +18,15 @@ name: Sync indicator count # 7. docs site published version (wickra-lib/wickra-docs: the # "Published versions" table in overview.md + the Rust quickstart prose) # — synced on v* tag only* +# 8. Marketing site version (wickra-lib/webpage: api/*.md "Latest" lines, the +# nav version label, and the wickra-wasm dep) — synced on v* tag only* # # *Surfaces 3 + 7 need the ABOUT_SYNC_TOKEN to have write on -# wickra-lib/wickra-docs; surfaces 5 + 6 need write on wickra-lib/.github and -# admin:org for the org-description PATCH. Until that scope is granted these -# steps emit a ::warning:: and soft-skip — they never fail the run. The repo -# "About" homepage URL is also enforced in step 2 (constant value, no extra -# scope); it points at docs.wickra.org. +# wickra-lib/wickra-docs, surfaces 4 + 8 on wickra-lib/webpage; surfaces 5 + 6 +# need write on wickra-lib/.github and admin:org for the org-description PATCH. +# Until that scope is granted these steps emit a ::warning:: and soft-skip — +# they never fail the run. The repo "About" homepage URL is also enforced in +# step 2 (constant value, no extra scope); it points at docs.wickra.org. # # Note: surface 7 carries the release *version*, not the indicator count, so # it is driven by the v* tag (which is the version) rather than the count. @@ -332,3 +335,75 @@ jobs: else echo "Docs version synced to ${version}." fi + + # ----- webpage (marketing site) self-update (findings P12.1) ------------ + # + # The marketing site (wickra-lib/webpage) carries the same indicator count + # and published version as the docs. Mirrors the docs steps above: the + # count syncs on push-to-main + tag, the version syncs on v* tags only. + # Distinct clone dirs (webpage-count / webpage-ver) avoid any collision on + # a tag run. Soft-skips with a ::warning:: if the token can't reach the + # repo, so the run never fails. + - name: Sync webpage indicator count (wickra-lib/webpage) + if: github.event_name != 'pull_request' + continue-on-error: true + env: + GH_TOKEN: ${{ secrets.ABOUT_SYNC_TOKEN }} + run: | + n="${{ steps.count.outputs.count }}" + if ! git clone "https://x-access-token:${GH_TOKEN}@github.com/wickra-lib/webpage.git" webpage-count 2>/dev/null; then + echo "::warning::cannot clone wickra-lib/webpage — ABOUT_SYNC_TOKEN likely lacks write on that repo (findings P10.0a). Skipping webpage count sync." + exit 0 + fi + cd webpage-count + sed -i -E "s/[0-9]+ (streaming-first )?indicators/${n} \1indicators/g" index.md .vitepress/config.ts public/hero.svg + if git diff --quiet; then + echo "Webpage indicator count unchanged." + exit 0 + fi + git config user.name "wickra-bot" + git config user.email "wickra-bot@users.noreply.github.com" + git add index.md .vitepress/config.ts public/hero.svg + git commit -m "chore: sync indicator count to ${n}" + if ! git push 2>/dev/null; then + echo "::warning::push to wickra-lib/webpage failed — ABOUT_SYNC_TOKEN likely lacks write (findings P10.0a)." + else + echo "Webpage indicator count synced to ${n}." + fi + + - name: Sync webpage version (wickra-lib/webpage) + if: startsWith(github.ref, 'refs/tags/v') + continue-on-error: true + env: + GH_TOKEN: ${{ secrets.ABOUT_SYNC_TOKEN }} + run: | + version="${GITHUB_REF#refs/tags/v}" + if ! printf '%s' "$version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then + echo "::warning::tag '${GITHUB_REF}' is not a plain vMAJOR.MINOR.PATCH release; skipping webpage version sync." + exit 0 + fi + if ! git clone "https://x-access-token:${GH_TOKEN}@github.com/wickra-lib/webpage.git" webpage-ver 2>/dev/null; then + echo "::warning::cannot clone wickra-lib/webpage — ABOUT_SYNC_TOKEN likely lacks write (findings P10.0a). Skipping webpage version sync." + exit 0 + fi + cd webpage-ver + # api/*.md "Latest" lines, the nav version label, and the wickra-wasm + # dep pin. The '.' anchors match the backtick / quote / caret without a + # literal in this shell string; historical "Since X.Y.Z" prose has no + # such anchor and is never matched. + sed -i -E "s/(Latest:\*\* \[.wickra(-wasm)? )[0-9]+\.[0-9]+\.[0-9]+/\1${version}/" api/*.md + sed -i -E "s/(text: .v)[0-9]+\.[0-9]+\.[0-9]+/\1${version}/" .vitepress/config.ts + sed -i -E "s/(.wickra-wasm.: .\^)[0-9]+\.[0-9]+\.[0-9]+/\1${version}/" package.json + if git diff --quiet; then + echo "Webpage version already at ${version}." + exit 0 + fi + git config user.name "wickra-bot" + git config user.email "wickra-bot@users.noreply.github.com" + git add api/*.md .vitepress/config.ts package.json + git commit -m "chore: sync published version to ${version}" + if ! git push 2>/dev/null; then + echo "::warning::push to wickra-lib/webpage failed — ABOUT_SYNC_TOKEN likely lacks write (findings P10.0a)." + else + echo "Webpage version synced to ${version}." + fi