Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aadya940 committed Jul 18, 2024
1 parent 55c861c commit 6cec7e7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 55 deletions.
88 changes: 34 additions & 54 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,65 @@
name: Build and Publish Wheels
name: Build and Release Wheels

on:
release:
types: [published]
types: [created]

jobs:
build_wheel_multiplatform:
name: Build wheels on ${{ matrix.os }}
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["cp39", "cp310", "cp311", "cp312"]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements_dev.txt
- name: Build extensions in place
run: |
python -m pip install setuptools wheel
python setup.py build_ext --inplace
pip install cibuildwheel
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2

- name: Build wheels
run: |
python -m cibuildwheel --output-dir dist
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
CIBW_BUILD: "${{ matrix.python }}-*"
CIBW_BUILD: cp3?-*
CIBW_SKIP: "pp*"

- uses: actions/upload-artifact@v4
- name: Upload wheels to GitHub
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./dist/*.whl
name: wheels-${{ runner.os }}-${{ matrix.python-version }}
path: wheelhouse/

publish_wheels:
needs: [build_wheel_multiplatform]
upload_to_pypi:
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Download Linux wheels
uses: actions/download-artifact@v3
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: wheels-ubuntu-latest
path: ./dist
name: wheels-*

- name: Download Windows wheels
uses: actions/download-artifact@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
name: wheels-windows-latest
path: ./dist
python-version: "3.9"

- name: Download MacOS 13 wheels
uses: actions/download-artifact@v3
with:
name: wheels-macos-13
path: ./dist

- name: Download MacOS 14 wheels
uses: actions/download-artifact@v3
with:
name: wheels-macos-14
path: ./dist
- name: Install twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Publish wheels to PyPI
run: |
twine upload wheelhouse/*.whl
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python3 -m pip install twine
twine upload dist/*.whl
3 changes: 2 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
repairwheel
wheel
wheel
cibuildwheel

0 comments on commit 6cec7e7

Please sign in to comment.