npm... #4
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: | |
push: | |
branches: | |
- main # adjust to your main branch name | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' # adjust to your Node.js version | |
- name: Install dependencies | |
run: npm install | |
- name: Run tests # optional, add if you have tests to run | |
run: npm test | |
- name: Publish to npm | |
run: npm publish --access public # adjust --access as needed for public/private packages | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |