1
1
name : Release and Publish to TestPyPI
2
2
3
3
on :
4
- push :
5
- branches :
6
- - sep-workflows
7
- tags :
8
- - " v*"
9
- workflow_dispatch :
4
+ workflow_run :
5
+ workflows : ["Build Macos", "Build linux", "Build win"]
6
+ types :
7
+ - completed
10
8
11
9
jobs :
12
- wait_for_builds :
13
- name : Wait for build workflows
10
+ release_and_publish :
11
+ name : Release and Publish
14
12
runs-on : ubuntu-latest
13
+ if : ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/') }}
15
14
steps :
16
- - name : Wait for Windows build
17
- uses : lewagon/wait-on-check-action@v1.3.1
18
- with :
19
- ref : ${{ github.ref }}
20
- check-name : " build_windows.yml"
21
- repo-token : ${{ secrets.GITHUB_TOKEN }}
22
- wait-interval : 10
15
+ - name : Checkout code
16
+ uses : actions/checkout@v3
23
17
24
- - name : Wait for macOS build
25
- uses : lewagon/wait-on-check-action@v1.3.1
18
+ - name : Download macOS artifacts
19
+ uses : actions/download-artifact@v3
26
20
with :
27
- ref : ${{ github.ref }}
28
- check-name : " build_macos.yml"
29
- repo-token : ${{ secrets.GITHUB_TOKEN }}
30
- wait-interval : 10
21
+ name : wheels-macos-13
22
+ path : dist/macos-13
31
23
32
- - name : Wait for Linux build
33
- uses : lewagon/wait-on-check-action@v1.3.1
24
+ - name : Download macOS artifacts
25
+ uses : actions/download-artifact@v3
34
26
with :
35
- ref : ${{ github.ref }}
36
- check-name : " build_linux.yml"
37
- repo-token : ${{ secrets.GITHUB_TOKEN }}
38
- wait-interval : 10
27
+ name : wheels-macos-14
28
+ path : dist/macos-14
39
29
40
- publish_to_testpypi :
41
- name : Publish to TestPyPI
42
- needs : wait_for_builds
43
- runs-on : ubuntu-latest
44
- if : startsWith(github.ref, 'refs/tags/')
45
- steps :
46
- - name : Checkout code
47
- uses : actions/checkout@v3
30
+ - name : Download Linux artifacts
31
+ uses : actions/download-artifact@v3
32
+ with :
33
+ name : wheels-linux
34
+ path : dist/linux
48
35
49
- - name : Download all workflow run artifacts
36
+ - name : Download Windows artifacts
50
37
uses : actions/download-artifact@v3
51
38
with :
52
- path : dist
39
+ name : wheels-windows-x64
40
+ path : dist/windows
53
41
54
42
- name : Display structure of downloaded files
55
43
run : ls -R
@@ -61,29 +49,11 @@ jobs:
61
49
user : __token__
62
50
password : ${{ secrets.PYPI_API_TOKEN }}
63
51
repository-url : https://test.pypi.org/legacy/
64
- packages-dir : dist/*
65
-
66
- create_release :
67
- name : Create Release
68
- needs : publish_to_testpypi
69
- runs-on : ubuntu-latest
70
- if : startsWith(github.ref, 'refs/tags/')
71
- steps :
72
- - name : Checkout code
73
- uses : actions/checkout@v3
74
-
75
- - name : Download all workflow run artifacts
76
- uses : actions/download-artifact@v3
77
- with :
78
- path : artifacts
79
-
80
- - name : Display structure of downloaded files
81
- run : ls -R
82
- working-directory : artifacts
52
+ packages-dir : dist
83
53
84
54
- name : Create Release
85
55
env :
86
- GITHUB_TOKEN : ${{ secrets.ACCESS_TOKEN }}
56
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
87
57
uses : softprops/action-gh-release@v1
88
58
with :
89
- files : ./artifacts /**/*.whl
59
+ files : ./dist /**/*.whl
0 commit comments