-
Notifications
You must be signed in to change notification settings - Fork 297
76 lines (65 loc) · 2.01 KB
/
release-beta.yml
File metadata and controls
76 lines (65 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Release 3x Beta
on:
# pull_request:
push:
branches:
- feat_v3.x
workflow_dispatch:
jobs:
release-3x-beta:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# ref: ${{ github.event.pull_request.head.sha }}
- name: Get commit message
run: |
COMMIT_MESSAGE=$(git log --format=%s -n 1)
FILTERED_MESSAGE="${COMMIT_MESSAGE//[^a-zA-Z0-9.()_:, -]/}"
echo "COMMIT_MESSAGE=${FILTERED_MESSAGE}" >> $GITHUB_ENV
- name: Show commit message
run: echo "$COMMIT_MESSAGE"
- name: Commit message compliance verification
if: |
!startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) ||
!contains( env.COMMIT_MESSAGE , '-beta' )
run: echo "ABORT=true" >> $GITHUB_ENV
- name: Get Tag message
if: contains( env.COMMIT_MESSAGE , '-beta')
run: echo "RELEASE_TAG=beta" >> $GITHUB_ENV
#
- name: Install pnpm
run: npm i -g pnpm@10
- uses: actions/setup-node@v6
with:
registry-url: 'https://registry.npmjs.org'
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
if: env.ABORT != 'true'
run: pnpm install --frozen-lockfile
- name: Run Build
if: env.ABORT != 'true'
run: |
if ! pnpm build; then
echo "构建 nutui-react 失败"
exit 1
fi
if ! pnpm build:taro; then
echo "构建 nutui-react-taro 失败"
exit 1
fi
- name: Run Release @nutui/nutui-react
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: env.ABORT != 'true'
run: pnpm --dir ./release/h5 publish:beta
- name: Run Releases @nutui/nutui-react-taro
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: env.ABORT != 'true'
run: pnpm --dir ./release/taro publish:beta