@@ -22,15 +22,15 @@ jobs:
22
22
strategy :
23
23
fail-fast : False
24
24
matrix :
25
- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12']
25
+ python-version : [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
26
26
steps :
27
27
- name : Checkout repository
28
28
uses : actions/checkout@v4
29
29
with :
30
30
submodules : true
31
31
32
32
- name : Setup Python ${{ matrix.python-version }}
33
- uses : actions/setup-python@v2
33
+ uses : actions/setup-python@v4
34
34
with :
35
35
python-version : ${{ matrix.python-version }}
36
36
41
41
ls -al ./dist
42
42
43
43
- name : Place wheels in artifacts folder
44
- uses : actions/upload-artifact@v2
44
+ uses : actions/upload-artifact@v4
45
45
with :
46
+ name : windows-${{ matrix.python-version }}
46
47
path : ./dist/*.whl
47
48
48
49
build_wheels_unix :
59
60
submodules : true
60
61
61
62
- name : Setup Python ${{ matrix.python-version }}
62
- uses : actions/setup-python@v2
63
+ uses : actions/setup-python@v4
63
64
with :
64
65
python-version : ' 3.11'
65
66
78
79
ls -R dist
79
80
80
81
- name : Place wheels in artifacts folder
81
- uses : actions/upload-artifact@v2
82
+ uses : actions/upload-artifact@v4
82
83
with :
84
+ name : ${{ matrix.os }}
83
85
path : ./dist/*.whl
84
86
85
87
test-wheels :
@@ -89,23 +91,27 @@ jobs:
89
91
strategy :
90
92
matrix :
91
93
os : [ windows-latest, ubuntu-latest, macos-latest ]
92
- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12']
94
+ python-version : [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
93
95
94
96
steps :
95
97
- name : Checkout repository
96
98
uses : actions/checkout@v4
97
99
with :
98
100
submodules : true
99
101
- name : Setup Python ${{ matrix.python-version }}
100
- uses : actions/setup-python@v2
102
+ uses : actions/setup-python@v4
101
103
with :
102
104
python-version : ${{ matrix.python-version }}
103
105
104
106
- name : Retrieve packages
105
- uses : actions/download-artifact@v2
107
+ uses : actions/download-artifact@v4
106
108
with :
107
109
path : dist
108
110
111
+ - name : List items
112
+ run : |
113
+ ls -alR dist
114
+
109
115
- name : Test Package Installation
110
116
run : |
111
117
python -m pip install --upgrade pip
@@ -131,34 +137,52 @@ jobs:
131
137
python extern/nlopt/test/t_python.py
132
138
133
139
deploy :
134
- name : deploy packages
140
+ name : Deploy packages
135
141
runs-on : ubuntu-latest
136
142
needs : test-wheels
137
- if : startsWith(github.ref, 'refs/tags/')
143
+ if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
138
144
139
145
steps :
140
146
- name : Setup Python ${{ matrix.python-version }}
141
- uses : actions/setup-python@v2
147
+ uses : actions/setup-python@v4
142
148
with :
143
149
python-version : ${{ matrix.python-version }}
144
150
145
151
- name : Retrieve packages
146
- uses : actions/download-artifact@v2
152
+ uses : actions/download-artifact@v4
147
153
with :
148
- name : artifact
149
154
path : dist
150
155
151
156
- name : Install twine
152
157
run : pip install twine
153
158
159
+ - name : Move files to top level directory
160
+ run : |
161
+ ls -ltR dist
162
+ python - << EOF
163
+ from pathlib import Path
164
+ import shutil
165
+
166
+ d = Path('dist')
167
+ for f in d.rglob('*.whl'):
168
+ shutil.move(f, d / f.name)
169
+
170
+ for f in d.iterdir():
171
+ if f.is_dir():
172
+ shutil.rmtree(f)
173
+
174
+ EOF
175
+
154
176
- name : Upload packages to testpypi
177
+ if : ${{ !startsWith(github.ref, 'refs/tags/') }}
155
178
env :
156
- TWINE_USERNAME : ${{ secrets.PYPI_TEST_UID }}
157
- TWINE_PASSWORD : ${{ secrets.PYPI_TEST_PWD }}
158
- run : python -m twine upload --skip-existing --repository testpypi dist/*
179
+ TWINE_USERNAME : ${{ secrets.PYPI_TEST_TOKEN_NAME }}
180
+ TWINE_PASSWORD : ${{ secrets.PYPI_TEST_API_TOKEN }}
181
+ run : python -m twine upload --skip-existing --repository testpypi dist/* --verbose
159
182
160
183
- name : Upload packages to pypi
184
+ if : startsWith(github.ref, 'refs/tags/')
161
185
env :
162
- TWINE_USERNAME : ${{ secrets.PYPI_UID }}
163
- TWINE_PASSWORD : ${{ secrets.PYPI_PWD }}
164
- run : python -m twine upload --skip-existing dist/*
186
+ TWINE_USERNAME : ${{ secrets.PYPI_PROD_TOKEN_NAME }}
187
+ TWINE_PASSWORD : ${{ secrets.PYPI_PROD_API_TOKEN }}
188
+ run : python -m twine upload --skip-existing dist/* --verbose
0 commit comments