bump: version 0.0.1a0 → 0.0.1a1 #1
Workflow file for this run
This file contains 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: Node.js Package | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npm test | |
- run: npm run build | |
- name: Check version | |
run: | | |
# Extract the tag version from the GITHUB_REF environment variable, removing the 'refs/tags/' prefix | |
TAG_VERSION=${GITHUB_REF#refs/tags/} | |
PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then | |
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)" | |
exit 1 | |
fi | |
- run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |