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
46
path : ./dist/*.whl
47
47
59
59
submodules : true
60
60
61
61
- name : Setup Python ${{ matrix.python-version }}
62
- uses : actions/setup-python@v2
62
+ uses : actions/setup-python@v4
63
63
with :
64
64
python-version : ' 3.11'
65
65
78
78
ls -R dist
79
79
80
80
- name : Place wheels in artifacts folder
81
- uses : actions/upload-artifact@v2
81
+ uses : actions/upload-artifact@v4
82
82
with :
83
83
path : ./dist/*.whl
84
84
@@ -97,12 +97,12 @@ jobs:
97
97
with :
98
98
submodules : true
99
99
- name : Setup Python ${{ matrix.python-version }}
100
- uses : actions/setup-python@v2
100
+ uses : actions/setup-python@v4
101
101
with :
102
102
python-version : ${{ matrix.python-version }}
103
103
104
104
- name : Retrieve packages
105
- uses : actions/download-artifact@v2
105
+ uses : actions/download-artifact@v4
106
106
with :
107
107
path : dist
108
108
@@ -130,35 +130,64 @@ jobs:
130
130
pip install ${file}
131
131
python extern/nlopt/test/t_python.py
132
132
133
- deploy :
134
- name : deploy packages
133
+ deploy-test :
134
+ name : Deploy packages to TestPyPI
135
135
runs-on : ubuntu-latest
136
136
needs : test-wheels
137
- if : startsWith(github.ref, 'refs/tags/')
137
+ if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
138
138
139
139
steps :
140
140
- name : Setup Python ${{ matrix.python-version }}
141
- uses : actions/setup-python@v2
141
+ uses : actions/setup-python@v4
142
+ with :
143
+ python-version : ${{ matrix.python-version }}
144
+ - name : Setup Python ${{ matrix.python-version }}
145
+ uses : actions/setup-python@v4
142
146
with :
143
147
python-version : ${{ matrix.python-version }}
144
148
145
149
- name : Retrieve packages
146
- uses : actions/download-artifact@v2
150
+ uses : actions/download-artifact@v4
147
151
with :
148
152
name : artifact
149
153
path : dist
150
154
151
155
- name : Install twine
152
156
run : pip install twine
153
157
158
+ - name : List directory
159
+ run : |
160
+ ls -ltR
161
+
154
162
- name : Upload packages to testpypi
155
163
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/*
164
+ TWINE_USERNAME : ${{ secrets.PYPI_TEST_TOKEN_NAME }}
165
+ TWINE_PASSWORD : ${{ secrets.PYPI_TEST_API_TOKEN }}
166
+ run : python -m twine upload --skip-existing --repository testpypi dist/* --verbose
167
+
168
+ deploy :
169
+ name : Deploy packages to PyPI
170
+ runs-on : ubuntu-latest
171
+ needs : test-wheels
172
+ if : startsWith(github.ref, 'refs/tags/')
173
+
174
+ steps :
175
+ - name : Setup Python ${{ matrix.python-version }}
176
+ uses : actions/setup-python@v4
177
+ with :
178
+ python-version : ${{ matrix.python-version }}
179
+
180
+ - name : Retrieve packages
181
+ uses : actions/download-artifact@v4
182
+ with :
183
+ name : artifact
184
+ path : dist
185
+
186
+ - name : Install twine
187
+ run : pip install twine
159
188
160
189
- name : Upload packages to pypi
161
190
env :
162
- TWINE_USERNAME : ${{ secrets.PYPI_UID }}
163
- TWINE_PASSWORD : ${{ secrets.PYPI_PWD }}
164
- run : python -m twine upload --skip-existing dist/*
191
+ TWINE_USERNAME : ${{ secrets.PYPI_PROD_TOKEN_NAME }}
192
+ TWINE_PASSWORD : ${{ secrets.PYPI_PROD_API_TOKEN }}
193
+ run : python -m twine upload --skip-existing dist/* --verbose
0 commit comments