Skip to content

Release

Release #203

Workflow file for this run

name: Release
on:
workflow_dispatch:
push:
tags:
- v*
pull_request:
branches:
- main
types:
- closed
jobs:
wheels_on_PR:
if: ${{ github.event.pull_request.merged == true }}
name: ${{ matrix.py }} ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [auto]
py: [cp313]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
- name: Setup gfortran for Linux
uses: awvwgk/setup-fortran@main
id: setup-fortran
with:
compiler: gcc
version: 13
- name: cibuildwheel on Linux
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_PASS_LINUX: CI
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: wheel-${{ matrix.py }}-${{ matrix.os }}-${{ matrix.arch }}
wheels:
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') }}
name: ${{ matrix.py }} ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-14] # windows-latest: Disable windows for now
arch: [auto, aarch64]
py: [cp39, cp310, cp311, cp312, cp313]
exclude:
- os: windows-latest
arch: aarch64
- os: macos-13
arch: aarch64
- os: macos-14
arch: aarch64
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@latest
- name: Setup gfortran
uses: awvwgk/setup-fortran@v1.6.1
id: setup-fortran
with:
compiler: gcc
version: 13
- if: ${{ matrix.os != 'macos-13' }}
uses: ts-graphviz/setup-graphviz@v2
name: Install Graphviz
- if: ${{ matrix.os == 'windows-latest' }}
name: cibuildwheel on Windows
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS: ${{ matrix.arch }}
CMAKE_GENERATOR: "MinGW Makefiles"
FC: ${{ steps.setup-fortran.outputs.fc }}
- if: ${{ matrix.os == 'ubuntu-latest' }}
name: cibuildwheel on Linux
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_ENVIRONMENT_PASS_LINUX: CI
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# Will avoid testing on emulated architectures
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x,armv7l}"
- if: ${{ matrix.os == 'macos-13'}}
name: cibuildwheel on MacOS-13
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS: ${{ matrix.arch }}
no_proxy: '*'
CHROMO_SKIP_GRAPHVIZ: 1
- if: ${{ matrix.os == 'macos-14' }}
name: cibuildwheel on MacOS-14
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: ${{ matrix.py }}-*
CIBW_ARCHS: ${{ matrix.arch }}
no_proxy: '*'
MACOSX_DEPLOYMENT_TARGET: 14.0
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.py }}-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
sdist:
name: source package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Dump GitHub context
run: echo '${{ toJSON(github) }}'
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.12'
- uses: tlylt/install-graphviz@v2
name: Install Graphviz
- run: python -m pip install --upgrade pip wheel setuptools
- run: pipx run build --sdist
- run: python -m pip install --prefer-binary -v `echo dist/chromo-*`[test]
- run: python -m pytest -v
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
upload_to_PyPI:
name: Upload to PyPI
needs: [wheels, sdist]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download files in artifact to "dist/" directory
uses: actions/download-artifact@v4.1.7
with:
name: artifact
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}