Skip to content

Commit f9174cc

Browse files
committed
update build
1 parent 5d72677 commit f9174cc

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

.github/workflows/build.yml

+46-17
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
submodules: true
3131

3232
- name: Setup Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v2
33+
uses: actions/setup-python@v4
3434
with:
3535
python-version: ${{ matrix.python-version }}
3636

@@ -41,7 +41,7 @@ jobs:
4141
ls -al ./dist
4242
4343
- name: Place wheels in artifacts folder
44-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v4
4545
with:
4646
path: ./dist/*.whl
4747

@@ -59,7 +59,7 @@ jobs:
5959
submodules: true
6060

6161
- name: Setup Python ${{ matrix.python-version }}
62-
uses: actions/setup-python@v2
62+
uses: actions/setup-python@v4
6363
with:
6464
python-version: '3.11'
6565

@@ -78,7 +78,7 @@ jobs:
7878
ls -R dist
7979
8080
- name: Place wheels in artifacts folder
81-
uses: actions/upload-artifact@v2
81+
uses: actions/upload-artifact@v4
8282
with:
8383
path: ./dist/*.whl
8484

@@ -97,12 +97,12 @@ jobs:
9797
with:
9898
submodules: true
9999
- name: Setup Python ${{ matrix.python-version }}
100-
uses: actions/setup-python@v2
100+
uses: actions/setup-python@v4
101101
with:
102102
python-version: ${{ matrix.python-version }}
103103

104104
- name: Retrieve packages
105-
uses: actions/download-artifact@v2
105+
uses: actions/download-artifact@v4
106106
with:
107107
path: dist
108108

@@ -130,35 +130,64 @@ jobs:
130130
pip install ${file}
131131
python extern/nlopt/test/t_python.py
132132
133-
deploy:
134-
name: deploy packages
133+
deploy-test:
134+
name: Deploy packages to TestPyPI
135135
runs-on: ubuntu-latest
136136
needs: test-wheels
137-
if: startsWith(github.ref, 'refs/tags/')
137+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
138138

139139
steps:
140140
- 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
142146
with:
143147
python-version: ${{ matrix.python-version }}
144148

145149
- name: Retrieve packages
146-
uses: actions/download-artifact@v2
150+
uses: actions/download-artifact@v4
147151
with:
148152
name: artifact
149153
path: dist
150154

151155
- name: Install twine
152156
run: pip install twine
153157

158+
- name: List directory
159+
run: |
160+
ls -ltR
161+
154162
- name: Upload packages to testpypi
155163
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
159188

160189
- name: Upload packages to pypi
161190
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

setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
from extensions import NLOptBuild, NLOptBuildExtension
77

8-
from wheel.bdist_wheel import bdist_wheel
9-
108
with open("README.md") as f:
119
long_description = f.read()
1210

0 commit comments

Comments
 (0)