What if I move this here? #8
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 to NPM | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Install | |
run: yarn | |
- name: Test | |
run: yarn test | |
- name: Check publish status | |
id: check | |
uses: tehpsalmist/npm-publish-status-action@v1 | |
- name: Publish if necessary | |
if: ${{ steps.check.outputs.exists == '0' }} | |
run: yarn npm publish |