Merge pull request #17 from AdaSupport/hcoles/bump_package_version #6
This file contains hidden or 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: NPM publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| NODE_VERSION: 20 | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write # allow GITHUB_TOKEN to publish packages | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v4 | |
| - name: "Setup" | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: https://npm.pkg.github.com/ | |
| - uses: JS-DevTools/npm-publish@v3 | |
| id: publish | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| registry: "https://npm.pkg.github.com" | |
| outputs: | |
| type: ${{ steps.publish.outputs.type }} | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| if: needs.publish.outputs.type | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v4 | |
| - name: "Get package version" | |
| id: package-version | |
| uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
| - name: "Create release" | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: v${{ steps.package-version.outputs.current-version }} | |
| commit: "main" | |
| generateReleaseNotes: true |