Skip to content

Release 0.13

Release 0.13 #28

Workflow file for this run

name: Wheel builder and uploader
# Update on every push and PR to main, and upon release creation
on:
push:
branches:
- main
paths:
- '**'
- '!*'
- '*.py'
- '!tests/**'
- '!.github/**'
- '.github/workflows/wheels.yml'
pull_request:
branches:
- main
release:
types: [created]
jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
run: |
pip install build
python -m build --wheel --outdir wheelhouse/
- uses: actions/upload-artifact@v4
with:
name: Wheel
path: ./wheelhouse/*.whl
build_sdist:
name: Build source directory for release
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
# check-out this repository
- uses: actions/checkout@v4
# Setup python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build sdist
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
# Deploy wheels and sdist to PyPI (upon release creation)
deploy_pypi:
name: Deploy to PyPI
needs: [build_wheel, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- uses: actions/checkout@v4
- run: |
mkdir tmp_wheelhouse
mkdir wheelhouse
- uses: actions/download-artifact@v4
with:
path: tmp_wheelhouse/
- run: find tmp_wheelhouse/ -mindepth 2 -type f -exec mv -i '{}' wheelhouse/ ';'
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}
packages_dir: wheelhouse/