Skip to content

Commit

Permalink
work on build wheel ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeliza committed Jun 27, 2024
1 parent 7ddaa1f commit 08ba73e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Build wheels

# on: [push, pull_request]
on: [push, pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
release:
types:
- published
# on:
# release:
# types:
# - published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.16
uses: pypa/cibuildwheel@v2.18
env:
CIBW_ARCHS_MACOS: auto universal2
CIBW_ARCHS_MACOS: auto
CIBW_SKIP: pp*win_amd64
with:
package-dir: .
Expand All @@ -32,6 +32,7 @@ jobs:
shell: bash
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.runs-on }}
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -45,22 +46,29 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: artifact-source
path: dist/*.tar.gz

upload_pypi:
name: Upload on release
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: all-files
pattern: artifact-*

- uses: actions/download-artifact@v4
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
name: all-files
path: dist

- uses: pypa/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "numpy>=1.19.5", "cython>=0.29"]
requires = ["setuptools", "wheel", "numpy>=1.19.5,<2", "cython>=0.29"]

0 comments on commit 08ba73e

Please sign in to comment.