Skip to content

Merge pull request #16 from 3DFin/develop_v0_3_0 #34

Merge pull request #16 from 3DFin/develop_v0_3_0

Merge pull request #16 from 3DFin/develop_v0_3_0 #34

Workflow file for this run

name: build wheels
# Trigger on PR and only if something is tagged on branches
on:
push:
branches: ["*"]
tags: ["*"]
pull_request:
branches: ["*"]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: True
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.20.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
publish:
name: Publish to PyPI
needs: build_wheels
runs-on: ubuntu-latest
# Only publish to PyPI when a commit is tagged
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
with:
submodules: True
- uses: actions/setup-python@v5
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# construct the source package and upload src and wheels to PiPy
run: |
python -m pip install twine build --upgrade
python -m build --sdist
twine upload dist/*