2.0.6 #7
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 Package | |
on: | |
push: | |
branches: | |
- master # This triggers the workflow on pushes to the master branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '22' # Specify the Node.js version | |
registry-url: 'https://registry.npmjs.org/' # npm registry | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: npm run build # Assuming you have a build script in your package.json | |
- name: Run tests | |
run: npm test | |
- name: Publish to npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Use the npm token from secrets | |
run: npm publish |