File tree Expand file tree Collapse file tree 2 files changed +59
-23
lines changed
Expand file tree Collapse file tree 2 files changed +59
-23
lines changed Original file line number Diff line number Diff line change 1+ name : Release to NPM when a tag is pushed
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*.*.*-rc.*"
7+
8+ jobs :
9+ release :
10+ name : Release
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 10
13+ steps :
14+ - name : Checkout 🛎️
15+ uses : actions/checkout@v3
16+ with :
17+ fetch-depth : 0
18+ ref : develop
19+
20+ - name : Setup pnpm 9
21+ uses : pnpm/action-setup@v4
22+ with :
23+ version : 9.3.0
24+
25+ - name : Setup Node.js 18.x
26+ uses : actions/setup-node@v2
27+ with :
28+ node-version : 18.x
29+
30+ - name : Install Dependencies 🔧
31+ run : pnpm install
32+
33+ - name : Build Step 🔧
34+ env :
35+ CI : " "
36+ run : pnpm run ci:build
37+
38+ - name : Create .npmrc
39+ run : |
40+ cat << EOF > "$HOME/.npmrc"
41+ //registry.npmjs.org/:_authToken=$NPM_TOKEN
42+ EOF
43+ env :
44+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
45+
46+ - name : Bump Package Version
47+ run : pnpm run bump-version
48+ working-directory : ./packages/raystack
49+ env :
50+ GIT_REFNAME : ${{ github.ref_name }}
51+
52+ - name : Run Release 🚀
53+ run : pnpm run release:ci
54+ working-directory : ./packages/raystack
55+ env :
56+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ name: Release to NPM when a tag is pushed
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- ref : ${{ github.ref }}
20-
21- - name : Check Branch and Tag
22- run : |
23- BRANCH=$(git branch -r --contains ${{ github.ref }})
24- TAG=${{ github.ref_name }}
25-
26- if [[ $BRANCH =~ origin/main$ ]]; then
27- if [[ $TAG =~ -rc\. ]]; then
28- echo "[SKIPPED] Release candidate tags (v*.*.*-rc.*) are only allowed on develop branch"
29- exit 0
30- fi
31- elif [[ $BRANCH =~ origin/develop$ ]]; then
32- if [[ ! $TAG =~ -rc\. ]]; then
33- echo "[SKIPPED] Release tags (v*.*.*) are only allowed on main branch. Use release candidate tags (v*.*.*-rc.*)"
34- exit 1
35- fi
36- else
37- echo "[SKIPPED] Tags can only be pushed from main or develop branches"
38- exit 1
39- fi
18+ ref : main
4019
4120 - name : Setup pnpm 9
4221 uses : pnpm/action-setup@v4
You can’t perform that action at this time.
0 commit comments