Skip to content

ci: update version script #2

ci: update version script

ci: update version script #2

Workflow file for this run

name: publish
on:
push:
tags:
- v*
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install --frozen-lockfile
- run: |
yarn build
VERSION='${{ github.ref_name }}'
PACKAGE_JSON=$(node -p "const p = require('./package'); p.version = '${VERSION:1}'; JSON.stringify(p, null, 2)")
echo $PACKAGE_JSON > package.json
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}