Skip to content

Commit 5d5de33

Browse files
committed
multi dist repo #1
1 parent c7083bd commit 5d5de33

File tree

3 files changed

+7
-32
lines changed

3 files changed

+7
-32
lines changed

.github/workflows/test-all.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,8 @@ on:
66

77
jobs:
88
test:
9-
uses: ./.github/workflows/validation.yml
9+
uses: ./.github/workflows/test.yml
1010
secrets: inherit
11-
with:
12-
cd_path: "test/ci"
13-
cd_branch: "main_-_cd_-_test"
14-
dist_path: "test/src"
15-
dist_branch: "main_-_dist_-_test"
1611
test2:
17-
uses: ./.github/workflows/validation.yml
18-
secrets: inherit
19-
with:
20-
cd_path: "test2/ci"
21-
cd_branch: "main_-_cd_-_test2"
22-
dist_path: "test2/src"
23-
dist_branch: "main_-_dist_-_test2"
12+
uses: ./.github/workflows/test2.yml
13+
secrets: inherit

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: test
22

33
# 这里通过主分支的 push 和手动触发器触发,也可以自定义其他触发方式
44
on:
5+
workflow_call:
56
workflow_dispatch:
67
push:
78
branches:

.github/workflows/test2.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,14 @@ name: test2
22

33
# 这里通过主分支的 push 和手动触发器触发,也可以自定义其他触发方式
44
on:
5+
workflow_call:
56
workflow_dispatch:
67
push:
78
branches:
89
- main
9-
env:
10-
cd_branch_prefix: ${{ github.ref }}_-_cd_-_
11-
dist_branch_prefix: ${{ github.ref }}_-_dist_-_
1210
jobs:
13-
setup:
14-
runs-on: ubuntu-latest
15-
outputs:
16-
# ::set-output 命令将被弃用,而 env 又不能直接在下面非 steps 中使用,而 steps 又不支持 uses 使用 action yml 文件……因此这里转发使用 env
17-
cd_branch_prefix: ${{ env.cd_branch_prefix }}
18-
dist_branch_prefix: ${{ env.dist_branch_prefix }}
19-
steps:
20-
- id: nothing-step
21-
run: |
22-
echo "这一步是必要的,去掉会报错"
2311
build:
24-
needs: setup
25-
uses: ./.github/workflows/validation.yml
12+
uses: ./.github/workflows/validation-proxy.yml
2613
secrets: inherit
2714
with:
28-
cd_path: "test2/ci"
29-
cd_branch: "${{ needs.setup.outputs.cd_branch_prefix }}test2"
30-
dist_path: "test2/src"
31-
dist_branch: "${{ needs.setup.outputs.dist_branch_prefix }}test2"
15+
name: "test2"

0 commit comments

Comments
 (0)