Merge pull request #4 from energiency/1-add-semantic-release #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 registry | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
name: publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'yarn' | |
registry-url: 'https://registry.npmjs.org/' | |
- run: yarn install --frozen-lockfile | |
- run: yarn prettier-check | |
- run: yarn test | |
- name: Check for vulnerabilities | |
run: yarn audit | |
- run: yarn build | |
- name: Publish package | |
if: success() | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: yarn semantic-release |