Skip to content

Version 0.5.2

Version 0.5.2 #46

Workflow file for this run

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Publish Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
build-sourcedist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install --upgrade pip
pip install wheel pybind11 auditwheel build
- name: Build package
run: |
python -m build --sdist -o dist
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
build-ubuntu:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
strategy:
fail-fast: false
matrix:
python-version: ["cp36-cp36m", "cp37-cp37m", "cp38-cp38", "cp39-cp39", "cp310-cp310", "cp311-cp311", "cp312-cp312"]
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: |
git config --global --add safe.directory '*'
git submodule update --init --recursive
- name: Install dependencies
run: |
/opt/python/${{ matrix.python-version }}/bin/python -m pip install --upgrade pip
/opt/python/${{ matrix.python-version }}/bin/python -m pip install wheel pybind11 auditwheel
- name: Build package
run: |
/opt/python/${{ matrix.python-version }}/bin/python -m pip wheel . -w dist
- name: Audit wheel
run: |
/opt/python/${{ matrix.python-version }}/bin/python -m auditwheel repair --strip --plat manylinux2014_x86_64 --exclude libgomp.so.1 dist/*.whl
rm -r dist
mv wheelhouse dist
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init --recursive
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel pybind11
- name: Build package
run: python setup.py bdist_wheel
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
build-mac:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Update submodules
run: git submodule update --init --recursive
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel pybind11
- name: Build package
run: python setup.py bdist_wheel
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
publish-pypi:
needs: [build-ubuntu, build-windows, build-mac, build-sourcedist]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: dist
path: ./dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}