v0.20.0: Wire Transfer #44
Workflow file for this run
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
| # Publishes renderer packages to npm on release. | |
| # | |
| # @prefecthq/prefab-ui — CDN renderer (loaded by MCP hosts via get_renderer_html) | |
| # @prefecthq/prefab-ui-docs — shadow DOM preview renderer for docs (loaded by Mintlify) | |
| # @prefecthq/prefab-ui-playground — interactive playground (loaded by docs + prefab CLI) | |
| # | |
| # docs/renderer.js is a stable loader committed to the repo that imports | |
| # from @prefecthq/prefab-ui-docs@latest on the CDN via a stable embed.mjs shim. | |
| # New releases are picked up automatically — no docs rebuild needed. | |
| name: Publish renderer to npm | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| publish: | |
| name: "Build & publish npm packages" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| cache-dependency-path: renderer/package-lock.json | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Set npm version from git tag | |
| working-directory: renderer | |
| run: | | |
| # Strip PEP 440 pre-release suffix: v0.1.0a1 → 0.1.0 | |
| RAW="${{ github.ref_name }}" | |
| VERSION="${RAW#v}" | |
| VERSION=$(echo "$VERSION" | sed -E 's/(a|b|rc)[0-9]+$//') | |
| npm version "$VERSION" --no-git-tag-version | |
| cd docs-package && npm version "$VERSION" --no-git-tag-version | |
| cd ../playground-package && npm version "$VERSION" --no-git-tag-version | |
| - name: Install renderer dependencies | |
| working-directory: renderer | |
| run: | | |
| node ../.github/scripts/check-npm-package-age.mjs --lockfile package-lock.json --days 7 | |
| npm ci | |
| - run: npm run build:publish | |
| working-directory: renderer | |
| # Prepare satellite packages with build output | |
| - name: Prepare docs package | |
| working-directory: renderer | |
| run: | | |
| mkdir -p docs-package/dist | |
| cp dist/renderer.js docs-package/dist/ | |
| cp -r dist/_renderer docs-package/dist/ | |
| - name: Prepare playground package | |
| working-directory: renderer | |
| run: cp dist/playground.html playground-package/ | |
| - name: Publish @prefecthq/prefab-ui | |
| working-directory: renderer | |
| run: npm publish --access public --tag latest | |
| - name: Publish @prefecthq/prefab-ui-docs | |
| working-directory: renderer/docs-package | |
| run: npm publish --access public --tag latest | |
| - name: Publish @prefecthq/prefab-ui-playground | |
| working-directory: renderer/playground-package | |
| run: npm publish --access public --tag latest | |
| - name: Purge jsDelivr caches | |
| run: | | |
| # The docs and playground use @latest, so purge the CDN cache | |
| # so it picks up the new version immediately. | |
| for f in dist/_renderer/*.mjs dist/renderer.js; do | |
| echo "Purging prefab-ui-docs $f" | |
| curl -s "https://purge.jsdelivr.net/npm/@prefecthq/prefab-ui-docs@latest/$f" > /dev/null | |
| done | |
| echo "Purging prefab-ui-playground playground.html" | |
| curl -s "https://purge.jsdelivr.net/npm/@prefecthq/prefab-ui-playground@latest/playground.html" > /dev/null | |
| working-directory: renderer |