1- name : Release to NPM when a tag is pushed
1+ name : Release
22
33on :
44 push :
55 tags :
6- - ' v*.*.*'
7- - ' v*.*.*-rc.*'
6+ - " v*.*.*"
87
98jobs :
109 release :
1615 uses : actions/checkout@v3
1716 with :
1817 fetch-depth : 0
19-
20- - name : Check Branch and Tag
21- run : |
22- BRANCH=$(git branch -r --contains ${{ github.ref }})
23- TAG=${{ github.ref_name }}
24-
25- if [[ $BRANCH =~ origin/main$ ]]; then
26- if [[ $TAG =~ -rc\. ]]; then
27- echo "[SKIPPED] Release candidate tags (v*.*.*-rc.*) are only allowed on develop branch"
28- exit 0
29- fi
30- elif [[ $BRANCH =~ origin/develop$ ]]; then
31- if [[ ! $TAG =~ -rc\. ]]; then
32- echo "[SKIPPED] Release tags (v*.*.*) are only allowed on main branch. Use release candidate tags (v*.*.*-rc.*)"
33- exit 1
34- fi
35- else
36- echo "[SKIPPED] Tags can only be pushed from main or develop branches"
37- exit 1
38- fi
18+ ref : main
3919
4020 - name : Setup pnpm 9
4121 uses : pnpm/action-setup@v4
@@ -48,12 +28,12 @@ jobs:
4828 node-version : 18.x
4929
5030 - name : Install Dependencies 🔧
51- run : pnpm install
31+ run : pnpm i
5232
5333 - name : Build Step 🔧
5434 env :
5535 CI : " "
56- run : pnpm run ci:build
36+ run : npm run ci:build
5737
5838 - name : Create .npmrc
5939 run : |
@@ -64,23 +44,14 @@ jobs:
6444 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
6545
6646 - name : Bump Package Version
67- run : pnpm run bump-version
47+ run : npm run bump-version
6848 working-directory : ./packages/raystack
6949 env :
7050 GIT_REFNAME : ${{ github.ref_name }}
7151
7252 - name : Run Release 🚀
73- run : pnpm run release:ci
53+ run : npm run release:ci
7454 working-directory : ./packages/raystack
7555 env :
7656 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
78-
79- - name : Generate GitHub Release Notes 📓
80- env :
81- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
82- run : |
83- gh release create "$GITHUB_REF_NAME" \
84- --repo "$GITHUB_REPOSITORY" \
85- --generate-notes \
86- --verify-tag
57+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments