-
Notifications
You must be signed in to change notification settings - Fork 544
64 lines (56 loc) · 2.01 KB
/
pr-preview-build.yml
File metadata and controls
64 lines (56 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
# =============================================================================
# PR Preview: Build — 构建所有预览产物
#
# 触发时机: PR 打开 / 有新推送 / 重开时自动运行
# 功能:
# 1. playground 构建 — 用于 surge.sh 在线预览(所有 PR 均触发)
# 2. Client 全平台构建 — packages/cherry-markdown 或 packages/client 变更时触发
# 3. VSCode Plugin 打包 — packages/cherry-markdown 或 packages/vscodePlugin 变更时触发
# 所有构建产物上传为 artifact,由 pr-preview-deploy 统一处理
# 注意: Client 和 VSCode Plugin 构建失败不影响主流程 (continue-on-error)
# 并发控制: 连续提交取消旧运行
# =============================================================================
name: 'PR Preview: Build'
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
detect-changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
client: ${{ steps.filter.outputs.client }}
vscode-plugin: ${{ steps.filter.outputs.vscode-plugin }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
client:
- 'packages/cherry-markdown/**'
- 'packages/client/**'
vscode-plugin:
- 'packages/cherry-markdown/**'
- 'packages/vscodePlugin/**'
playground:
uses: ./.github/workflows/reusable-playground-build.yml
client:
needs: detect-changes
if: needs.detect-changes.outputs.client == 'true'
uses: ./.github/workflows/reusable-client-build.yml
with:
mode: preview
vscode-plugin:
needs: detect-changes
if: needs.detect-changes.outputs.vscode-plugin == 'true'
uses: ./.github/workflows/reusable-vscode-plugin.yml
with:
mode: package
pr_number: ${{ github.event.pull_request.number }}