diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..e9b9162 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,41 @@ +name: Publish to NPM +on: + push: + branches: + - main + paths: + - 'package.json' + - 'CHANGELOG.md' + +jobs: + publish: + name: Publish to NPM + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + - run: npm install -g pnpm + - run: pnpm install + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + dry-run: true + + release: + name: Create Github Release + needs: publish + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets. GITHUB_TOKEN }} + with: + tag_name: v${{ github.ref }} + release_name: v${{ github.ref }} + body_path: CHANGELOG.md + draft: false + prerelease: false + dry-run: true