diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5a738a1..0ad7e65 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,20 +1,39 @@ name: Publish to NPM on: - release: - types: [published] + push: + tags: + - 'v*' jobs: npm: + name: Publish to NPM runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12 + node-version: 14 registry-url: https://registry.npmjs.org/ - run: npm ci - - run: npm audit && npm test - - run: npm publish + - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + gpr: + name: Publish to GitHub Package Registry + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://npm.pkg.github.com/ + scope: '@jakejarvis' + - run: npm ci + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}