Skip to content

Commit 0419a9f

Browse files
committed
fix: review
1 parent e4a8d58 commit 0419a9f

File tree

2 files changed

+55
-11
lines changed

2 files changed

+55
-11
lines changed

.github/workflows/release-beta.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
name: Release 3x Beta
22

33
on:
4-
# pull_request:
5-
push:
4+
pull_request:
5+
# push:
66
branches:
77
- feat_v3.x
8+
workflow_dispatch:
89

910
jobs:
1011
release-3.x-beta:
1112
env:
1213
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1314
NPM_CONFIG_PROVENANCE: true
15+
RELEASE_TAG: beta
1416

1517
runs-on: ubuntu-latest
1618
steps:
1719
- uses: actions/checkout@v4
1820
with:
1921
fetch-depth: 0
20-
# ref: ${{ github.event.pull_request.head.sha }}
22+
ref: ${{ github.event.pull_request.head.sha }}
2123

2224
- name: Get commit message
2325
run: |
2426
COMMIT_MESSAGE=$(git log --format=%s -n 1)
25-
echo "COMMIT_MESSAGE=${COMMIT_MESSAGE}" >> $GITHUB_ENV
27+
FILTERED_MESSAGE="${COMMIT_MESSAGE//[^a-zA-Z0-9.()_:, -]/}"
28+
echo "COMMIT_MESSAGE=${FILTERED_MESSAGE}" >> $GITHUB_ENV
2629
- name: Show commit message
2730
run: echo "$COMMIT_MESSAGE"
2831

2932
- name: Commit message compliance verification
30-
if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true && contains( env.COMMIT_MESSAGE , '-beta' ) != true
33+
if: |
34+
!startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) ||
35+
!contains( env.COMMIT_MESSAGE , '-beta' )
3136
run: echo "ABORT=true" >> $GITHUB_ENV
3237

3338
- name: Get Tag message
@@ -48,12 +53,30 @@ jobs:
4853

4954
- name: Run Build
5055
if: env.ABORT != 'true'
51-
run: pnpm build && pnpm build:taro
56+
run: |
57+
if ! pnpm build; then
58+
echo "构建 nutui-react 失败"
59+
exit 1
60+
fi
61+
if ! pnpm build:taro; then
62+
echo "构建 nutui-react-taro 失败"
63+
exit 1
64+
fi
5265
5366
- name: Run Release @nutui/nutui-react
5467
if: env.ABORT != 'true'
55-
run: cd ./release/h5 && npm publish --dry-run --tag beta
68+
run: |
69+
cd ./release/h5 || exit 1
70+
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
71+
echo "发布 @nutui/nutui-react 失败"
72+
exit 1
73+
fi
5674
5775
- name: Run Releases @nutui/nutui-react-taro
5876
if: env.ABORT != 'true'
59-
run: cd ./release/taro && npm publish --dry-run --tag beta
77+
run: |
78+
cd ./release/taro || exit 1
79+
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
80+
echo "发布 @nutui/nutui-react-taro 失败"
81+
exit 1
82+
fi

.github/workflows/release.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,31 @@ jobs:
2727
run: pnpm install --no-frozen-lockfile
2828

2929
- name: Run Build
30-
run: pnpm build & pnpm build:taro
30+
if: env.ABORT != 'true'
31+
run: |
32+
if ! pnpm build; then
33+
echo "构建 nutui-react 失败"
34+
exit 1
35+
fi
36+
if ! pnpm build:taro; then
37+
echo "构建 nutui-react-taro 失败"
38+
exit 1
39+
fi
3140
3241
- name: Run Release @nutui/nutui-react
33-
run: cd ./release/h5 && npm publish
42+
if: env.ABORT != 'true'
43+
run: |
44+
cd ./release/h5 || exit 1
45+
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
46+
echo "发布 @nutui/nutui-react 失败"
47+
exit 1
48+
fi
3449
3550
- name: Run Releases @nutui/nutui-react-taro
36-
run: cd ./release/taro && npm publish
51+
if: env.ABORT != 'true'
52+
run: |
53+
cd ./release/taro || exit 1
54+
if ! npm publish --dry-run --tag ${{ env.RELEASE_TAG }}; then
55+
echo "发布 @nutui/nutui-react-taro 失败"
56+
exit 1
57+
fi

0 commit comments

Comments
 (0)