forked from mudassir0909/jsonresume-theme-elegant
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 1.3 KB
/
npm-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 }}