try to use cibuildwheel #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.16.5 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }} | |
path: ./wheelhouse/*.whl | |
upload: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip build setuptools cython numpy scipy ase jax jaxlib | |
pip install -r requirements.txt | |
- name: Create source dist | |
run: python3 -m build --sdist | |
- name: Stage Linux | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-ubuntu-latest | |
- runs: mv -v wheels-ubuntu-latest/* dist/ | |
- name: Stage Windows | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-windows-latest | |
- runs: mv -v wheels-windows-latest/* dist/ | |
- name: Stage MacOS 13 | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-13 | |
- runs: mv -v wheels-macos-13/* dist/ | |
- name: Stage MacOS 14 | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheels-macos-14 | |
- runs: mv -v wheels-macos-14/* dist/ | |
- name: Upload with twine | |
env: | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
run: | | |
ls -l dist/* | |
pip install twine | |
twine upload dist/* |