Release PyPi #82
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 PyPi | |
on: | |
workflow_dispatch: | |
# release: | |
# types: | |
# - created | |
pull_request: | |
branches: [main] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# FIXME: rather do one job by OS | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
# - name: Set up Rust | |
# uses: dtolnay/rust-toolchain@stable | |
# - uses: Swatinem/rust-cache@v2 | |
- name: Build wheels with Maturin | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: build | |
args: --release --out dist # --features python-bindings | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.whl | |
name: wheels-${{ matrix.os }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
path: dist | |
- run: ls -R dist | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Build sdist with Maturin | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
name: sdist | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
path: dist | |
- run: ls -R dist | |
# release: | |
# name: Release to PyPI | |
# needs: [build_wheels, build_sdist] | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# pattern: wheels-* | |
# merge-multiple: true | |
# path: dist | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: sdist | |
# path: dist | |
# - run: ls -R dist | |
# - name: Publish to PyPI | |
# uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_SECRET }} |