Skip to content

Commit 3e8442b

Browse files
committed
feat(ci): 添加获取和构建链接依赖的步骤
1 parent ca04f06 commit 3e8442b

3 files changed

Lines changed: 136 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,41 @@ jobs:
139139
with:
140140
run_install: false
141141

142+
- name: Get linked dependency versions
143+
id: dep-versions
144+
shell: bash
145+
run: |
146+
SM_SHA=$(git ls-remote https://github.com/AQBot-Desktop/stream-monaco.git refs/heads/main | cut -f1)
147+
MS_SHA=$(git ls-remote https://github.com/AQBot-Desktop/markstream-vue.git refs/heads/aqbot-custom | cut -f1)
148+
echo "cache-key=linked-deps-${SM_SHA:0:12}-${MS_SHA:0:12}" >> $GITHUB_OUTPUT
149+
150+
- name: Cache linked dependencies
151+
id: cache-linked-deps
152+
uses: actions/cache@v4
153+
with:
154+
path: |
155+
../stream-monaco
156+
../markstream-vue
157+
key: ${{ steps.dep-versions.outputs.cache-key }}
158+
159+
- name: Build linked dependencies
160+
if: steps.cache-linked-deps.outputs.cache-hit != 'true'
161+
shell: bash
162+
run: |
163+
cd ..
164+
165+
git clone --depth 1 https://github.com/AQBot-Desktop/stream-monaco.git stream-monaco
166+
cd stream-monaco && pnpm install --frozen-lockfile && pnpm build
167+
rm -rf node_modules .git
168+
cd ..
169+
170+
git clone --depth 1 -b aqbot-custom https://github.com/AQBot-Desktop/markstream-vue.git markstream-vue
171+
cd markstream-vue && pnpm install --frozen-lockfile
172+
pnpm run build:parser
173+
cd packages/markstream-react && pnpm build && cd ../..
174+
rm -rf node_modules packages/*/node_modules playground*/node_modules .git
175+
cd ..
176+
142177
- name: Install frontend dependencies
143178
run: pnpm install --frozen-lockfile
144179

@@ -239,6 +274,39 @@ jobs:
239274
with:
240275
run_install: false
241276

277+
- name: Get linked dependency versions
278+
id: dep-versions
279+
run: |
280+
SM_SHA=$(git ls-remote https://github.com/AQBot-Desktop/stream-monaco.git refs/heads/main | cut -f1)
281+
MS_SHA=$(git ls-remote https://github.com/AQBot-Desktop/markstream-vue.git refs/heads/aqbot-custom | cut -f1)
282+
echo "cache-key=linked-deps-${SM_SHA:0:12}-${MS_SHA:0:12}" >> $GITHUB_OUTPUT
283+
284+
- name: Cache linked dependencies
285+
id: cache-linked-deps
286+
uses: actions/cache@v4
287+
with:
288+
path: |
289+
../stream-monaco
290+
../markstream-vue
291+
key: ${{ steps.dep-versions.outputs.cache-key }}
292+
293+
- name: Build linked dependencies
294+
if: steps.cache-linked-deps.outputs.cache-hit != 'true'
295+
run: |
296+
cd ..
297+
298+
git clone --depth 1 https://github.com/AQBot-Desktop/stream-monaco.git stream-monaco
299+
cd stream-monaco && pnpm install --frozen-lockfile && pnpm build
300+
rm -rf node_modules .git
301+
cd ..
302+
303+
git clone --depth 1 -b aqbot-custom https://github.com/AQBot-Desktop/markstream-vue.git markstream-vue
304+
cd markstream-vue && pnpm install --frozen-lockfile
305+
pnpm run build:parser
306+
cd packages/markstream-react && pnpm build && cd ../..
307+
rm -rf node_modules packages/*/node_modules playground*/node_modules .git
308+
cd ..
309+
242310
- name: Install frontend dependencies
243311
run: pnpm install --frozen-lockfile
244312

.github/workflows/test-build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,39 @@ jobs:
4949
with:
5050
run_install: false
5151

52+
- name: Get linked dependency versions
53+
id: dep-versions
54+
run: |
55+
SM_SHA=$(git ls-remote https://github.com/AQBot-Desktop/stream-monaco.git refs/heads/main | cut -f1)
56+
MS_SHA=$(git ls-remote https://github.com/AQBot-Desktop/markstream-vue.git refs/heads/aqbot-custom | cut -f1)
57+
echo "cache-key=linked-deps-${SM_SHA:0:12}-${MS_SHA:0:12}" >> $GITHUB_OUTPUT
58+
59+
- name: Cache linked dependencies
60+
id: cache-linked-deps
61+
uses: actions/cache@v4
62+
with:
63+
path: |
64+
../stream-monaco
65+
../markstream-vue
66+
key: ${{ steps.dep-versions.outputs.cache-key }}
67+
68+
- name: Build linked dependencies
69+
if: steps.cache-linked-deps.outputs.cache-hit != 'true'
70+
run: |
71+
cd ..
72+
73+
git clone --depth 1 https://github.com/AQBot-Desktop/stream-monaco.git stream-monaco
74+
cd stream-monaco && pnpm install --frozen-lockfile && pnpm build
75+
rm -rf node_modules .git
76+
cd ..
77+
78+
git clone --depth 1 -b aqbot-custom https://github.com/AQBot-Desktop/markstream-vue.git markstream-vue
79+
cd markstream-vue && pnpm install --frozen-lockfile
80+
pnpm run build:parser
81+
cd packages/markstream-react && pnpm build && cd ../..
82+
rm -rf node_modules packages/*/node_modules playground*/node_modules .git
83+
cd ..
84+
5285
- name: Install frontend dependencies
5386
run: pnpm install --frozen-lockfile
5487

.github/workflows/test-windows-build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,41 @@ jobs:
5050
with:
5151
run_install: false
5252

53+
- name: Get linked dependency versions
54+
id: dep-versions
55+
shell: bash
56+
run: |
57+
SM_SHA=$(git ls-remote https://github.com/AQBot-Desktop/stream-monaco.git refs/heads/main | cut -f1)
58+
MS_SHA=$(git ls-remote https://github.com/AQBot-Desktop/markstream-vue.git refs/heads/aqbot-custom | cut -f1)
59+
echo "cache-key=linked-deps-${SM_SHA:0:12}-${MS_SHA:0:12}" >> $GITHUB_OUTPUT
60+
61+
- name: Cache linked dependencies
62+
id: cache-linked-deps
63+
uses: actions/cache@v4
64+
with:
65+
path: |
66+
../stream-monaco
67+
../markstream-vue
68+
key: ${{ steps.dep-versions.outputs.cache-key }}
69+
70+
- name: Build linked dependencies
71+
if: steps.cache-linked-deps.outputs.cache-hit != 'true'
72+
shell: bash
73+
run: |
74+
cd ..
75+
76+
git clone --depth 1 https://github.com/AQBot-Desktop/stream-monaco.git stream-monaco
77+
cd stream-monaco && pnpm install --frozen-lockfile && pnpm build
78+
rm -rf node_modules .git
79+
cd ..
80+
81+
git clone --depth 1 -b aqbot-custom https://github.com/AQBot-Desktop/markstream-vue.git markstream-vue
82+
cd markstream-vue && pnpm install --frozen-lockfile
83+
pnpm run build:parser
84+
cd packages/markstream-react && pnpm build && cd ../..
85+
rm -rf node_modules packages/*/node_modules playground*/node_modules .git
86+
cd ..
87+
5388
- name: Install frontend dependencies
5489
run: pnpm install --frozen-lockfile
5590

0 commit comments

Comments
 (0)