Prepare browser RUM alpha release #1
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
| name: Alpha Release | |
| on: | |
| push: | |
| branches: | |
| - petyosi/browser-rum-alpha-release | |
| workflow_dispatch: {} | |
| jobs: | |
| publish-alpha: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| environment: | |
| name: npm | |
| env: | |
| CI: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Vite+ | |
| uses: voidzero-dev/setup-vp@v1 | |
| with: | |
| node-version: '24' | |
| cache: true | |
| - name: Install dependencies | |
| run: vp install --frozen-lockfile | |
| - name: Build packages | |
| run: vp run --filter "./packages/*" build | |
| - name: Configure npm authentication | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| test -n "$NPM_TOKEN" || { echo "NPM_TOKEN secret is not available"; exit 1; } | |
| npm config set //registry.npmjs.org/:_authToken "$NPM_TOKEN" | |
| - name: Publish alpha packages | |
| run: | | |
| set -euo pipefail | |
| publish_alpha() { | |
| local package_name="$1" | |
| local package_json="$2" | |
| local version | |
| version="$(node -p "require('./${package_json}').version")" | |
| if npm view "${package_name}@${version}" version >/dev/null 2>&1; then | |
| echo "${package_name}@${version} already exists; ensuring alpha dist-tag" | |
| npm dist-tag add "${package_name}@${version}" alpha | |
| else | |
| echo "Publishing ${package_name}@${version} with alpha dist-tag" | |
| vp pm publish -r --filter "${package_name}" --access public --tag alpha --no-git-checks | |
| fi | |
| } | |
| publish_alpha "@pydantic/logfire-session-replay" "packages/logfire-session-replay/package.json" | |
| publish_alpha "@pydantic/logfire-browser" "packages/logfire-browser/package.json" | |
| env: | |
| NPM_CONFIG_PROVENANCE: false |