diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7482a03 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish +on: + release: + types: [published] + +jobs: + publish: + name: Publish NPM package + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Publish package + uses: JS-DevTools/npm-publish@v2 + with: + token: ${{ secrets.NPM_TOKEN_ORG }}