Skip to content

Fix _ThermoAnalysis._set_globals_and_seq_args for improper checks o… #15

Fix _ThermoAnalysis._set_globals_and_seq_args for improper checks o…

Fix _ThermoAnalysis._set_globals_and_seq_args for improper checks o… #15

name: Build Cross platform / architecture wheels and upload to PyPi
# See https://github.com/pypa/cibuildwheel for details
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+b[0-9]+"
- "test[0-9]+.[0-9]+.[0-9]+"
- "test[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- "test[0-9]+.[0-9]+.[0-9]+b[0-9]+"
# Trigger on request.
workflow_dispatch:
jobs:
build_wheels:
name: Build wheel for ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-latest, windows-2022]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: checkout
uses: actions/[email protected]
# NOTE: Use QEMU block to build Linux aarch64 builds. Its SUPER SLOW
# so it is commented out and left as a reference
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
# - name: Set up QEMU
# if: runner.os == 'Linux'
# uses: docker/setup-qemu-action@v2
# with:
# platforms: 'arm64'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: "==${{ matrix.python-version }}.*"
# Skip musl linux and PyPy versions
CIBW_SKIP: "{*-musllinux_*,pp*}"
# Build only on 64-bit architectures.
CIBW_ARCHS_MACOS: "${{ matrix.python-version > 3.8 && 'x86_64 arm64' || 'x86_64' }}"
# NOTE: Commented out to be used with QEMU block above
# CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_ARCHS_LINUX: "auto64"
CIBW_ARCHS_WINDOWS: "auto64"
# Configure environment variables.
MACOSX_DEPLOYMENT_TARGET: "10.14"
CIBW_BEFORE_BUILD: 'python3 -m pip install cython pytest "setuptools>=67.1.0" && python3 setup.py build_ext --inplace'
# Test the wheels.
CIBW_TEST_COMMAND_MACOS: "pytest {project}/tests/test_thermoanalysis.py -v"
CIBW_TEST_COMMAND_LINUX: "pytest {project}/tests/test_thermoanalysis.py -v"
CIBW_TEST_COMMAND_WINDOWS: "pytest {project}\\tests\\test_thermoanalysis.py"
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
name: Install Python
with:
python-version: '3.10'
- name: Install wheel
run: python3 -m pip install wheel
- name: Build sdist
run: python3 setup.py sdist --formats=gztar
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.gz
upload_pypi:
name: Upload wheels and sdist tar.gz to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Check files
run: ls -lR dist
- name: Upload to PyPI
# upload to PyPI on every tag starting with 'v'
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PRIMER3_PYPI_API_TOKEN }}
- name: Upload to TestPyPI
# upload to TestPyPI PyPI on every tag starting with 'test'
if: startsWith(github.ref, 'refs/tags/test')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PRIMER3_TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true