@@ -14,55 +14,66 @@ jobs:
1414 with :
1515 fetch-depth : 0
1616
17- # - name: Setup node
18- # uses: actions/setup-node@v2
19- # with:
20- # node-version: '16'
21- # registry-url: https://registry.npmjs.org/
17+ - name : Setup node
18+ uses : actions/setup-node@v2
19+ with :
20+ node-version : ' 16'
21+ registry-url : https://registry.npmjs.org/
2222
23- # - name: Install pnpm
24- # uses: pnpm/action-setup@v2
25- # with:
26- # version: 7
27- # run_install: false
23+ - name : Install pnpm
24+ uses : pnpm/action-setup@v2
25+ with :
26+ version : 7
27+ run_install : false
2828
29- # # Use cache to reduce installation time
30- # - name: Get pnpm store directory
31- # id: pnpm-cache
32- # shell: bash
33- # run: |
34- # echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
29+ # Use cache to reduce installation time
30+ - name : Get pnpm store directory
31+ id : pnpm-cache
32+ shell : bash
33+ run : |
34+ echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3535
36- # - uses: actions/cache@v3
37- # name: Setup pnpm cache
38- # with:
39- # path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40- # key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41- # restore-keys: |
42- # ${{ runner.os }}-pnpm-store-
36+ - uses : actions/cache@v3
37+ name : Setup pnpm cache
38+ with :
39+ path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
40+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
41+ restore-keys : |
42+ ${{ runner.os }}-pnpm-store-
4343
44- # - name: Install dependencies
45- # run: pnpm install --frozen-lockfile
44+ - name : Install dependencies
45+ run : pnpm install --frozen-lockfile
4646
47- # - name: Build
48- # run: pnpm run build
47+ - name : Build
48+ run : pnpm run build
4949
50- # - name: publish
51- # working-directory: 'packages/core'
52- # env:
53- # NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
54- # run: npm publish
50+ - name : publish
51+ working-directory : ' packages/core'
52+ env :
53+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
54+ run : npm publish
5555
56- # 下面主要是创建 github 的release
57- # 需要手动修改 package.json 版本
5856 # 使用 tyankatsu0105/read-package-version-actions@v1 工具来读取对应的package.json 数据
5957 - name : Read package.json
6058 uses : tyankatsu0105/read-package-version-actions@v1
6159 with :
6260 path : ' ./packages/core'
6361 id : package-version
6462
65- # 关于创建 release 的更多参数,可以查看 actions/create-release@v1
63+ # 生成 Changelog
64+ - name : Changelog
65+ run : pnpm run changlog
66+
67+ # 提交 Changelog
68+ - name : Commit Changelog
69+ run : git add . && git commit -m"docs:update CHANGELOG.md && git push"
70+
71+ # 打 tag
72+ - name : Tag
73+ run : git tag v${{ steps.package-version.outputs.version }} && git push origin v${{ steps.package-version.outputs.version }}
74+
75+ # 下面主要是创建 github 的release
76+ # 关于创建 release 的更多参数,可以查看 actions/create-release@v1
6677 - name : Create Release for Tag
6778 id : release_tag
6879 uses : actions/create-release@v1
0 commit comments