Skip to content

docs: mention pip package #60

docs: mention pip package

docs: mention pip package #60

name: build_and_publish
on:
push:
tags:
branches:
pull_request:
branches:
repository_dispatch:
types: build
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
run_cpp_tests:
name: "Run C++ tests"
runs-on: ubuntu-22.04
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- name: "Install dependencies"
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -qq --yes >/dev/null
sudo apt-get install -qq --yes build-essential gsl-bin libboost-all-dev libgsl-dev >/dev/null
- name: "Build C++ tests"
run: |
make tests
- name: "Run C++ tests"
run: |
make run-tests
build_wheels:
name: "Build wheel (${{ matrix.os }}, py${{ matrix.python-version }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macOS-11 ]
python-version: [ 36, 37, 38, 39, 310, 311 ]
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- name: "Build wheel (${{ matrix.os }}, py${{ matrix.python-version }})"
uses: pypa/cibuildwheel@v2.11.1
with:
config-file: cibuildwheel.toml
env:
CIBW_BUILD: "cp${{ matrix.python-version}}-*"
- name: "Upload build artifacts (${{ matrix.os }}, py${{ matrix.python-version }})"
uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl
make_sdist:
name: "Make source distribution"
runs-on: ubuntu-22.04
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- name: "Build sdist"
run: |
pip3 install pipx ppsetuptools
pipx run build --sdist
- name: "Upload build artifacts"
uses: actions/upload-artifact@v3
with:
name: "dist"
path: "dist/*.tar.gz"
publish_to_pypi:
name: "Publish to PyPI"
if: startsWith(github.ref, 'refs/tags')
needs: [ run_cpp_tests, build_wheels, make_sdist ]
runs-on: ubuntu-22.04
strategy:
fail-fast: true
steps:
- name: "Download build artifacts"
uses: actions/download-artifact@v3
with:
name: "dist"
path: "dist"
- name: "Publish to PyPI"
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}