Skip to content

Commit 49fbaef

Browse files
committed
test macos build
1 parent 0dc4da6 commit 49fbaef

File tree

1 file changed

+91
-86
lines changed

1 file changed

+91
-86
lines changed

.github/workflows/build.yml

+91-86
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,44 @@ defaults:
1616
shell: bash
1717

1818
jobs:
19-
build_wheels_windows:
20-
name: Build wheels on Windows
21-
runs-on: windows-latest
22-
strategy:
23-
fail-fast: False
24-
matrix:
25-
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
26-
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v4
29-
with:
30-
submodules: true
31-
32-
- name: Setup Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v4
34-
with:
35-
python-version: ${{ matrix.python-version }}
36-
37-
- name: Build wheels
38-
run: |
39-
python -m pip install -U pip numpy swig wheel setuptools
40-
python setup.py bdist_wheel -d dist
41-
ls -al ./dist
42-
43-
- name: Place wheels in artifacts folder
44-
uses: actions/upload-artifact@v4
45-
with:
46-
name: windows-${{ matrix.python-version }}
47-
path: ./dist/*.whl
19+
# build_wheels_windows:
20+
# name: Build wheels on Windows
21+
# runs-on: windows-latest
22+
# strategy:
23+
# fail-fast: False
24+
# matrix:
25+
# python-version: [ '3.9', '3.10', '3.11', '3.12' ]
26+
# steps:
27+
# - name: Checkout repository
28+
# uses: actions/checkout@v4
29+
# with:
30+
# submodules: true
31+
#
32+
# - name: Setup Python ${{ matrix.python-version }}
33+
# uses: actions/setup-python@v4
34+
# with:
35+
# python-version: ${{ matrix.python-version }}
36+
#
37+
# - name: Build wheels
38+
# run: |
39+
# python -m pip install -U pip numpy swig wheel setuptools
40+
# python setup.py bdist_wheel -d dist
41+
# ls -al ./dist
42+
#
43+
# - name: Place wheels in artifacts folder
44+
# uses: actions/upload-artifact@v4
45+
# with:
46+
# name: windows-${{ matrix.python-version }}
47+
# path: ./dist/*.whl
4848

4949
build_wheels_unix:
5050
name: Build wheels on ${{ matrix.os }}
5151
runs-on: ${{ matrix.os }}
5252
strategy:
5353
fail-fast: False
5454
matrix:
55-
os: [ ubuntu-latest, macos-latest ]
55+
# os: [ ubuntu-latest, macos-latest, macos-14 ]
56+
os: [ macos-latest, macos-14 ]
5657
steps:
5758
- name: Checkout repository
5859
uses: actions/checkout@v4
@@ -66,15 +67,17 @@ jobs:
6667

6768
- name: Build wheels
6869
env:
69-
# only build CPython-3.8+ and skip 32-bit builds
70-
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
70+
# only build CPython-3.9+ and skip 32-bit builds
71+
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
7172
CIBW_SKIP: "*-manylinux_i686 *-musllinux*"
7273
# use latest build
7374
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64
7475
CIBW_BEFORE_ALL_MACOS: brew install swig
75-
CIBW_BEFORE_BUILD: pip install numpy swig
76+
CIBW_BEFORE_BUILD: |
77+
pip install --upgrade pip
78+
pip install numpy swig==4.0.0
7679
run: |
77-
python -m pip install -U pip cibuildwheel
80+
python -m pip install -U pip cibuildwheel==2.18.1
7881
python -m cibuildwheel --output-dir dist
7982
ls -R dist
8083
@@ -86,12 +89,14 @@ jobs:
8689

8790
test-wheels:
8891
name: Test wheels
89-
needs: [ build_wheels_windows, build_wheels_unix ]
92+
# needs: [ build_wheels_windows, build_wheels_unix ]
93+
needs: [ build_wheels_unix ]
9094
runs-on: ${{ matrix.os }}
9195
strategy:
9296
matrix:
93-
os: [ windows-latest, ubuntu-latest, macos-latest ]
94-
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
97+
# os: [ windows-latest, ubuntu-latest, macos-latest, macos-14 ]
98+
os: [ macos-latest, macos-14 ]
99+
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
95100

96101
steps:
97102
- name: Checkout repository
@@ -136,52 +141,52 @@ jobs:
136141
pip install ${file}
137142
python extern/nlopt/test/t_python.py
138143
139-
deploy:
140-
name: Deploy packages
141-
runs-on: ubuntu-latest
142-
needs: test-wheels
143-
144-
steps:
145-
- name: Setup Python ${{ matrix.python-version }}
146-
uses: actions/setup-python@v4
147-
with:
148-
python-version: ${{ matrix.python-version }}
149-
150-
- name: Retrieve packages
151-
uses: actions/download-artifact@v4
152-
with:
153-
path: dist
154-
155-
- name: Install twine
156-
run: pip install twine
157-
158-
- name: Move files to top level directory
159-
run: |
160-
ls -ltR dist
161-
python - << EOF
162-
from pathlib import Path
163-
import shutil
164-
165-
d = Path('dist')
166-
for f in d.rglob('*.whl'):
167-
shutil.move(f, d / f.name)
168-
169-
for f in d.iterdir():
170-
if f.is_dir():
171-
shutil.rmtree(f)
172-
173-
EOF
174-
175-
- name: Upload packages to testpypi
176-
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
177-
env:
178-
TWINE_USERNAME: ${{ secrets.PYPI_TEST_TOKEN_NAME }}
179-
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
180-
run: python -m twine upload --skip-existing --repository testpypi dist/* --verbose
181-
182-
- name: Upload packages to pypi
183-
if: startsWith(github.ref, 'refs/tags/')
184-
env:
185-
TWINE_USERNAME: ${{ secrets.PYPI_PROD_TOKEN_NAME }}
186-
TWINE_PASSWORD: ${{ secrets.PYPI_PROD_API_TOKEN }}
187-
run: python -m twine upload --skip-existing dist/* --verbose
144+
# deploy:
145+
# name: Deploy packages
146+
# runs-on: ubuntu-latest
147+
# needs: test-wheels
148+
#
149+
# steps:
150+
# - name: Setup Python ${{ matrix.python-version }}
151+
# uses: actions/setup-python@v4
152+
# with:
153+
# python-version: ${{ matrix.python-version }}
154+
#
155+
# - name: Retrieve packages
156+
# uses: actions/download-artifact@v4
157+
# with:
158+
# path: dist
159+
#
160+
# - name: Install twine
161+
# run: pip install twine
162+
#
163+
# - name: Move files to top level directory
164+
# run: |
165+
# ls -ltR dist
166+
# python - << EOF
167+
# from pathlib import Path
168+
# import shutil
169+
#
170+
# d = Path('dist')
171+
# for f in d.rglob('*.whl'):
172+
# shutil.move(f, d / f.name)
173+
#
174+
# for f in d.iterdir():
175+
# if f.is_dir():
176+
# shutil.rmtree(f)
177+
#
178+
# EOF
179+
#
180+
# - name: Upload packages to testpypi
181+
# if: ${{ !startsWith(github.ref, 'refs/tags/') }}
182+
# env:
183+
# TWINE_USERNAME: ${{ secrets.PYPI_TEST_TOKEN_NAME }}
184+
# TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }}
185+
# run: python -m twine upload --skip-existing --repository testpypi dist/* --verbose
186+
#
187+
# - name: Upload packages to pypi
188+
# if: startsWith(github.ref, 'refs/tags/')
189+
# env:
190+
# TWINE_USERNAME: ${{ secrets.PYPI_PROD_TOKEN_NAME }}
191+
# TWINE_PASSWORD: ${{ secrets.PYPI_PROD_API_TOKEN }}
192+
# run: python -m twine upload --skip-existing dist/* --verbose

0 commit comments

Comments
 (0)