File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 4242 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4343 TAG : ${{ env.TAG }}
4444 TAP_GITHUB_TOKEN : ${{ secrets.TAP_GITHUB_TOKEN }}
45+
46+ - uses : actions/setup-node@v4
47+ with :
48+ node-version : " 20"
49+ registry-url : " https://registry.npmjs.org"
50+
51+ - name : Publish to npm
52+ working-directory : npm
53+ env :
54+ VERSION : ${{ github.ref_name }}
55+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
56+ run : |
57+ bash prepare.sh
58+ npm publish
Original file line number Diff line number Diff line change 33set -euxo pipefail
44cp -r ../README.md ../dist/* .
55
6- # bump version
7- LATEST_TAG=$( gh api repos/:owner/:repo/tags --jq ' .[0].name' | sed ' s/^v//' )
8- jq --arg ver " $LATEST_TAG " ' .version = $ver' package.json > package.json.tmp && mv package.json.tmp package.json
6+ # Use VERSION env var if set (CI), otherwise fetch from GitHub API (local)
7+ if [ -z " ${VERSION:- } " ]; then
8+ VERSION=$( gh api repos/:owner/:repo/tags --jq ' .[0].name' )
9+ fi
10+
11+ # Strip 'v' prefix and bump version
12+ VERSION=" ${VERSION# v} "
13+ jq --arg ver " $VERSION " ' .version = $ver' package.json > package.json.tmp && mv package.json.tmp package.json
You can’t perform that action at this time.
0 commit comments