bump version to 5.3.1 #5
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: 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 }} |