Skip to content

chore: bump version to 5.2.0 #2

chore: bump version to 5.2.0

chore: bump version to 5.2.0 #2

Workflow file for this run

name: Publish
on:
push:
tags:
- "v*"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
environment: publish
permissions:
id-token: write # for npm provenance
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Run build
run: npm run build
- name: Run test
run: npm run test
- name: Check version
if: startsWith(github.ref, 'refs/tags/v')
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
TAG_VERSION=${GITHUB_REF#refs/tags/v}
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
echo "Error: Version mismatch!"
echo "package.json version: $PACKAGE_VERSION"
echo "Git tag version: $TAG_VERSION"
exit 1
fi
echo "Version check passed: $PACKAGE_VERSION"
- name: Dry run publish
run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}