File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed
Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 66 - " v*"
77
88 workflow_dispatch :
9+ inputs :
10+ version :
11+ description : 输入您将要发布的版本号(默认使用 packages/fluent-editor/package.json 中的版本号),例如:`0.1.0`。
12+ required : false
13+ type : string
914
1015jobs :
1116 build :
3944 ${{ runner.os }}-pnpm-store-
4045 - name : Install dependencies
4146 run : pnpm i --no-frozen-lockfile
47+ - name : Get version
48+ id : ver
49+ run : |
50+ # 优先用手动输入的版本号
51+ if [ -n "${{ inputs.version }}" ]; then
52+ VERSION="${{ inputs.version }}"
53+ else
54+ VERSION="$(node -p "require('./packages/fluent-editor/package.json').version")"
55+ fi
56+ echo "version: $VERSION"
57+ echo "value=$VERSION" >> $GITHUB_OUTPUT
4258
43- - name : Run Build search-box
44- run : pnpm build:lib
59+ - name : Build lib
60+ run : |
61+ pnpm build:lib
62+ cd packages/fluent-editor
63+ echo "version: ${{ steps.ver.outputs.value }}"
64+ pnpm pre-release -v ${{ steps.ver.outputs.value }}
4565
4666 - name : Parse Publish tag
4767 id : parse_tag
5878 fi
5979
6080 - name : Publish @opentiny/fluent-editor
61- run : pnpm pub
81+ run : |
82+ echo "ls"
83+ ls
84+ cd packages/fluent-editor/dist
85+ if [ "${{ steps.parse_tag.outputs.dist_tag }}" = "latest" ]; then
86+ echo "npm publish"
87+ else
88+ echo "npm publish --tag ${{ steps.parse_tag.outputs.dist_tag }}"
89+ fi
6290 env :
6391 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
6492
Original file line number Diff line number Diff line change 2828 "types" : " dist/types/index.d.ts" ,
2929 "scripts" : {
3030 "dev" : " vite build --watch" ,
31- "build" : " vite build && node scripts/pre-release.cjs" ,
31+ "build" : " vite build" ,
32+ "pre-release" : " node scripts/pre-release.cjs" ,
3233 "test" : " jest" ,
3334 "pub" : " cd dist && npm publish"
3435 },
You can’t perform that action at this time.
0 commit comments