@@ -2,77 +2,76 @@ name: Release and Publish to TestPyPI
2
2
3
3
on :
4
4
workflow_run :
5
- workflows : [" Build Macos ", "Build linux ", "Build win "]
5
+ workflows : [Build linux ", "Build win ", "Build Macos "]
6
6
types :
7
7
- completed
8
- push :
9
- branches :
10
- - sep-workflows # or whatever your default branch name is
11
- tags :
12
- - " v*"
13
8
14
9
jobs :
15
- debug_job :
16
- name : Debug Job
10
+ wait_for_workflows :
17
11
runs-on : ubuntu-latest
12
+ if : >
13
+ github.event.workflow_run.conclusion == 'success' &&
14
+ startsWith(github.event.workflow_run.head_branch, 'v')
18
15
steps :
19
- - name : Dump GitHub context
20
- env :
21
- GITHUB_CONTEXT : ${{ toJson(github) }}
22
- run : echo "$GITHUB_CONTEXT"
23
- - name : Dump job context
24
- env :
25
- JOB_CONTEXT : ${{ toJson(job) }}
26
- run : echo "$JOB_CONTEXT"
27
- - name : Dump steps context
28
- env :
29
- STEPS_CONTEXT : ${{ toJson(steps) }}
30
- run : echo "$STEPS_CONTEXT"
31
- - name : Dump runner context
32
- env :
33
- RUNNER_CONTEXT : ${{ toJson(runner) }}
34
- run : echo "$RUNNER_CONTEXT"
35
- - name : Dump strategy context
36
- env :
37
- STRATEGY_CONTEXT : ${{ toJson(strategy) }}
38
- run : echo "$STRATEGY_CONTEXT"
39
- - name : Dump matrix context
40
- env :
41
- MATRIX_CONTEXT : ${{ toJson(matrix) }}
42
- run : echo "$MATRIX_CONTEXT"
16
+ - name : Wait for Linux workflow
17
+ uses : lewagon/wait-on-check-action@v1.3.1
18
+ with :
19
+ ref : ${{ github.event.workflow_run.head_sha }}
20
+ check-name : " Build wheels on Linux"
21
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
22
+ wait-interval : 10
23
+
24
+ - name : Wait for Windows workflow
25
+ uses : lewagon/wait-on-check-action@v1.3.1
26
+ with :
27
+ ref : ${{ github.event.workflow_run.head_sha }}
28
+ check-name : " Build wheels on Windows"
29
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
30
+ wait-interval : 10
31
+
32
+ - name : Wait for macOS-13 workflow
33
+ uses : lewagon/wait-on-check-action@v1.3.1
34
+ with :
35
+ ref : ${{ github.event.workflow_run.head_sha }}
36
+ check-name : " Build wheels on macos-13"
37
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
38
+ wait-interval : 10
39
+
40
+ - name : Wait for macOS-14 workflow
41
+ uses : lewagon/wait-on-check-action@v1.3.1
42
+ with :
43
+ ref : ${{ github.event.workflow_run.head_sha }}
44
+ check-name : " Build wheels on macos-14"
45
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
46
+ wait-interval : 10
43
47
44
48
release_and_publish :
49
+ needs : wait_for_workflows
45
50
name : Release and Publish
46
- needs : debug_job
47
51
runs-on : ubuntu-latest
48
- if : always()
49
52
steps :
50
53
- name : Checkout code
51
54
uses : actions/checkout@v3
52
55
53
- - name : Download macOS artifacts
54
- continue-on-error : true
56
+ - name : Download macOS artifacts (macos-13)
55
57
uses : actions/download-artifact@v3
56
58
with :
57
59
name : wheels-macos-13
58
60
path : dist/macos-13
59
61
60
- - name : Download macOS artifacts
61
- continue-on-error : true
62
+ - name : Download macOS artifacts (macos-14)
62
63
uses : actions/download-artifact@v3
63
64
with :
64
65
name : wheels-macos-14
65
66
path : dist/macos-14
66
67
67
68
- name : Download Linux artifacts
68
- continue-on-error : true
69
69
uses : actions/download-artifact@v3
70
70
with :
71
71
name : wheels-linux
72
72
path : dist/linux
73
73
74
74
- name : Download Windows artifacts
75
- continue-on-error : true
76
75
uses : actions/download-artifact@v3
77
76
with :
78
77
name : wheels-windows-x64
83
82
working-directory : dist
84
83
85
84
- name : Publish to TestPyPI
86
- if : startsWith(github.ref, 'refs/tags/')
87
85
uses : pypa/gh-action-pypi-publish@v1.8.5
88
86
with :
89
87
user : __token__
92
90
packages-dir : dist
93
91
94
92
- name : Create Release
95
- if : startsWith(github.ref, 'refs/tags/')
96
93
env :
97
94
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98
95
uses : softprops/action-gh-release@v1
99
96
with :
100
97
files : ./dist/**/*.whl
98
+ tag_name : ${{ github.event.workflow_run.head_branch }}
0 commit comments