fix: use latest steps versions #16
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: Increment version and publish package to NPM registry | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
increment-and-publish-to-npm-registry: | |
runs-on: ubuntu-latest | |
if: "startsWith(github.event.head_commit.message, 'fix') || startsWith(github.event.head_commit.message, 'feat')" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
registry-url: https://registry.npmjs.org | |
- run: yarn install --frozen-lockfile | |
- run: grunt build | |
- run: git config --global user.name "Maksym Gendin" | |
- run: git config --global user.email "[email protected]" | |
- run: npm version patch | |
if: "startsWith(github.event.head_commit.message, 'fix:')" | |
- run: npm version minor | |
if: "startsWith(github.event.head_commit.message, 'feat:')" | |
- run: npm version major | |
if: "startsWith(github.event.head_commit.message, 'feat!:') || startsWith(github.event.head_commit.message, 'fix!:')" | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM_TOKEN}} | |
- run: git push | |
- run: echo NPM_PACKAGE_VERSION=$(npm pkg get version) >> $GITHUB_ENV | |
- run: git push origin ${{ env.NPM_PACKAGE_VERSION }} |