minor import bug fixed #28
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: Publish to NPM | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- package.json | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 21 | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests (If exists) | |
run: | | |
if [[ ! -z $(npm show . scripts.test) ]]; then | |
npm run test | |
fi | |
- name: Build the project | |
run: npm run build | |
- name: Set Npm Token | |
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Publish package to NPM | |
run: npm publish || true | |
- name: Unset Npm Token | |
run: npm config delete //registry.npmjs.org/:_authToken |