Merge pull request #22 from makindajack/main #15
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: Test and Publish 🚀 | |
on: | |
push: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [15.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install library dependency | |
run: npm install | |
- name: Run Tests | |
run: npm test | |
publish: | |
runs-on: ubuntu-latest | |
needs: [test] | |
strategy: | |
matrix: | |
node-version: [15.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
- name: Install library dependency | |
run: npm install | |
- name: Build Library | |
run: npm run build | |
- name: Publish Library to NPM | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |