1+ # This workflow will release the packages.
2+
3+ name : 🚀 Release
4+
5+ on :
6+ workflow_dispatch :
7+
8+
9+ env :
10+ GH_TOKEN : ${{ secrets.RELEASE_BOT_TOKEN }}
11+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
12+
13+ jobs :
14+ release :
15+ name : 📦 Release
16+ if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
17+ runs-on : ubuntu-latest
18+ strategy :
19+ matrix :
20+ node-version : [lts/*]
21+ steps :
22+ - name : ⬇️ Checkout
23+ id : checkout
24+ 25+ with :
26+ fetch-depth : 0
27+ token : ${{ env.GH_TOKEN }}
28+
29+ - name : 🟢 Setup node
30+ id : setup-node
31+ uses : actions/setup-node@v2
32+ with :
33+ node-version : ${{ matrix.node-version }}
34+
35+ - name : 🥡 Setup pnpm
36+ id : setup-pnpm
37+ 38+ with :
39+ version : latest
40+ run_install : false
41+
42+ - name : 🎈 Get pnpm store directory
43+ id : get-pnpm-cache-dir
44+ run : |
45+ echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
46+ - name : 🧩 Install Dependencies
47+ id : install-dependencies
48+ run : pnpm install
49+
50+ - name : 📣 Create Release Pull Request or Publish to npm
51+ id : changesets
52+ uses : changesets/action@v1
53+ with :
54+ title : " [Release] [GitHub Action] Update package versions"
55+ publish : pnpm publish:packages
56+ version : pnpm version:packages
57+ commit : " [WSO2 Release] [GitHub Action] [Release] [skip ci] update package versions"
58+ env :
59+ GITHUB_TOKEN : ${{ env.GH_TOKEN }}
60+
61+ - name : 🏗️ Build
62+ id : build
63+ run : pnpm build
64+
65+ - name : 📢 Release & Publish
66+ id : release-and-publish
67+ run : |
68+ git config user.name "wso2-ui-bot"
69+ git config user.email "[email protected] " 70+ echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" >> ~/.npmrc
71+ env :
72+ NPM_TOKEN : ${{ env.NPM_TOKEN }}
73+ GITHUB_TOKEN : ${{ env.GH_TOKEN }}
74+
75+
0 commit comments