Skip to content

Commit 6c4df5f

Browse files
优化 web build 流程,只打包一次
1 parent 7e33010 commit 6c4df5f

File tree

1 file changed

+47
-25
lines changed

1 file changed

+47
-25
lines changed

.github/workflows/run-tqsdk.yml

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,40 @@ jobs:
4343
echo "files size check failed"
4444
exit 1
4545
46-
test-and-build:
46+
build-web:
47+
name: build web packages
48+
runs-on: ubuntu-latest
4749
needs: setup
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
with:
54+
repository: shinnytech/tqsdk-python-private
55+
ref: ${{ github.event.client_payload.ref }}
56+
token: ${{ secrets.GH_PAT }}
57+
submodules: 'recursive'
58+
59+
- name: Setup Node.js 12.x
60+
uses: actions/setup-node@v1
61+
with:
62+
node-version: 12.x
63+
64+
- name: Package web
65+
run: |
66+
cd ./web/
67+
yarn install --frozen-lockfile
68+
yarn run build
69+
env:
70+
CI: true
71+
72+
- name: Upload web package
73+
uses: actions/upload-artifact@v2
74+
with:
75+
name: web-files
76+
path: tqsdk/web/*
77+
78+
test-and-build:
79+
needs: build-web
4880
strategy:
4981
matrix:
5082
envinfo:
@@ -82,20 +114,12 @@ jobs:
82114
repository: shinnytech/tqsdk-python-private
83115
ref: ${{ github.event.client_payload.ref }}
84116
token: ${{ secrets.GH_PAT }}
85-
submodules: 'recursive'
86117

87-
- name: Setup Node.js 12.x
88-
uses: actions/setup-node@v1
118+
- name: Download web-files
119+
uses: actions/download-artifact@v2
89120
with:
90-
node-version: 12.x
91-
92-
- name: Package web
93-
run: |
94-
cd ./web/
95-
yarn install --frozen-lockfile
96-
yarn run build
97-
env:
98-
CI: true
121+
name: web-files
122+
path: ./tqsdk/web
99123

100124
- name: Set up Python
101125
uses: actions/setup-python@v2
@@ -171,20 +195,12 @@ jobs:
171195
repository: shinnytech/tqsdk-python-private
172196
ref: ${{ github.event.client_payload.ref }}
173197
token: ${{ secrets.GH_PAT }}
174-
submodules: 'recursive'
175198

176-
- name: Setup Node.js 12.x
177-
uses: actions/setup-node@v1
199+
- name: Download web-files
200+
uses: actions/download-artifact@v2
178201
with:
179-
node-version: 12.x
180-
181-
- name: Package web
182-
run: |
183-
cd ./web/
184-
yarn install --frozen-lockfile
185-
yarn run build
186-
env:
187-
CI: true
202+
name: web-files
203+
path: ./tqsdk/web
188204

189205
- name: Set up Python
190206
uses: actions/setup-python@v2
@@ -233,6 +249,12 @@ jobs:
233249
name: bdist-file
234250
path: dist/*.whl
235251

252+
- name: Upload sdist package
253+
uses: actions/upload-artifact@v2
254+
with:
255+
name: sdist-file
256+
path: dist/*.tar.gz
257+
236258
- name: Upload doc package
237259
uses: actions/upload-artifact@v2
238260
with:

0 commit comments

Comments
 (0)