1
1
name : Release and Publish to TestPyPI
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - sep-workflows
7
+ tags :
8
+ - " v*"
4
9
workflow_run :
5
- workflows : [Build linux", "Build win", "Build Macos"]
10
+ workflows : [" Build linux", "Build win", "Build Macos"]
6
11
types :
7
12
- completed
8
13
9
14
jobs :
15
+ check_tag :
16
+ runs-on : ubuntu-latest
17
+ if : startsWith(github.ref, 'refs/tags/v')
18
+ steps :
19
+ - name : Check if tag
20
+ run : echo "This is a tag push"
21
+
10
22
wait_for_workflows :
23
+ needs : check_tag
11
24
runs-on : ubuntu-latest
12
25
if : >
26
+ github.event_name == 'workflow_run' &&
13
27
github.event.workflow_run.conclusion == 'success' &&
14
28
startsWith(github.event.workflow_run.head_branch, 'v')
15
29
steps :
@@ -18,40 +32,41 @@ jobs:
18
32
with :
19
33
ref : ${{ github.event.workflow_run.head_sha }}
20
34
check-name : " Build wheels on Linux"
21
- repo-token : ${{ secrets.GITHUB_TOKEN }}
35
+ repo-token : ${{ secrets.ACCESS_TOKEN }}
22
36
wait-interval : 10
23
37
24
38
- name : Wait for Windows workflow
25
39
uses : lewagon/wait-on-check-action@v1.3.1
26
40
with :
27
41
ref : ${{ github.event.workflow_run.head_sha }}
28
42
check-name : " Build wheels on Windows"
29
- repo-token : ${{ secrets.GITHUB_TOKEN }}
43
+ repo-token : ${{ secrets.ACCESS_TOKEN }}
30
44
wait-interval : 10
31
45
32
46
- name : Wait for macOS-13 workflow
33
47
uses : lewagon/wait-on-check-action@v1.3.1
34
48
with :
35
49
ref : ${{ github.event.workflow_run.head_sha }}
36
50
check-name : " Build wheels on macos-13"
37
- repo-token : ${{ secrets.GITHUB_TOKEN }}
51
+ repo-token : ${{ secrets.ACCESS_TOKEN }}
38
52
wait-interval : 10
39
53
40
54
- name : Wait for macOS-14 workflow
41
55
uses : lewagon/wait-on-check-action@v1.3.1
42
56
with :
43
57
ref : ${{ github.event.workflow_run.head_sha }}
44
58
check-name : " Build wheels on macos-14"
45
- repo-token : ${{ secrets.GITHUB_TOKEN }}
59
+ repo-token : ${{ secrets.ACCESS_TOKEN }}
46
60
wait-interval : 10
47
61
48
62
release_and_publish :
49
63
needs : wait_for_workflows
50
- name : Release and Publish
51
64
runs-on : ubuntu-latest
52
65
steps :
53
66
- name : Checkout code
54
67
uses : actions/checkout@v3
68
+ with :
69
+ fetch-depth : 0
55
70
56
71
- name : Download macOS artifacts (macos-13)
57
72
uses : actions/download-artifact@v3
91
106
92
107
- name : Create Release
93
108
env :
94
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
109
+ GITHUB_TOKEN : ${{ secrets.ACCESS_TOKEN }}
95
110
uses : softprops/action-gh-release@v1
96
111
with :
97
112
files : ./dist/**/*.whl
98
- tag_name : ${{ github.event.workflow_run.head_branch }}
113
+ tag_name : ${{ github.ref_name }}
0 commit comments