Publish Wheels #255
Workflow file for this run
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: Publish Wheels | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
version_number: | |
name: Versioning for wheels | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{env.VERSION_NUMBER}} | |
steps: | |
- name: Set Version Number | |
run: | | |
VERSION_NUMBER=${GITHUB_REF_NAME:1} | |
if [ $(echo "${VERSION_NUMBER##*.}") == "test" ]; then | |
VERSION_NUMBER=${VERSION_NUMBER%.*} | |
fi | |
echo VERSION_NUMBER=${VERSION_NUMBER} | |
echo VERSION_NUMBER=${VERSION_NUMBER} >> $GITHUB_ENV | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
needs: version_number | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-22.04] | |
env: | |
INSTALL_PREFIX: ${{ github.workspace }}/prereqs | |
MACOSX_DEPLOYMENT_TARGET: 12.1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: "x86_64" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_BEFORE_ALL: "INSTALL_PREFIX=${{ env.INSTALL_PREFIX }} .github/scripts/install_prereqs.sh release" | |
CIBW_BEFORE_BUILD: "pip install -r {package}/requirements_dev.txt && cd {package}" | |
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | |
CIBW_SKIP: "*musllinux*" | |
CIBW_CONFIG_SETTINGS: "--global-option=--with-version=${{ needs.version_number.outputs.version }} --build-option=--with-genomicsdb=${{ env.INSTALL_PREFIX }}" | |
CIBW_ENVIRONMENT: CMAKE_PREFIX_PATH=${{ env.INSTALL_PREFIX }} | |
CIBW_ENVIRONMENT_MACOS: DYLD_LIBRARY_PATH=${{ env.INSTALL_PREFIX }}/lib | |
CIBW_ENVIRONMENT_LINUX: > | |
LD_LIBRARY_PATH=${{ env.INSTALL_PREFIX }}/lib64:${{ env.INSTALL_PREFIX }}/lib:$LD_LIBRARY_PATH | |
PKG_CONFIG_PATH=${{ env.INSTALL_PREFIX }}/lib64/pkgconfig:${{ env.INSTALL_PREFIX }}/lib/pkgconfig | |
CC=/opt/rh/devtoolset-11/root/usr/bin/gcc | |
CXX=/opt/rh/devtoolset-11/root/usr/bin/g++ | |
CIBW_TEST_REQUIRES: pytest | |
- uses: actions/upload-artifact@v4 | |
name: Upload Wheel artifacts | |
with: | |
name: wheel_artifacts-${{ matrix.os }} | |
path: ./wheelhouse/*.whl | |
# Cross building arm64 on a macos-12 x64_64 box | |
# Note: No testing from CIBW available for cross builds. | |
build_macos_arm64_wheels: | |
name: Build wheels for macOS arm64 | |
needs: version_number | |
runs-on: macos-13 | |
env: | |
INSTALL_PREFIX: ${{ github.workspace }}/prereqs_arm64 | |
MACOSX_DEPLOYMENT_TARGET: 12.1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS: "arm64" | |
CIBW_BEFORE_ALL: "OSX_ARCH='arm64' INSTALL_PREFIX=${{ env.INSTALL_PREFIX }} .github/scripts/install_prereqs.sh release" | |
CIBW_BEFORE_BUILD: "pip install -r {package}/requirements_dev.txt && cd {package}" | |
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | |
CIBW_CONFIG_SETTINGS: "--global-option=--with-version=${{ needs.version_number.outputs.version }} --build-option=--with-genomicsdb=${{ env.INSTALL_PREFIX }}" | |
CIBW_ENVIRONMENT: DYLD_LIBRARY_PATH=${{ env.INSTALL_PREFIX }}/lib | |
- uses: actions/upload-artifact@v4 | |
name: Upload Wheel artifacts | |
with: | |
name: wheel_artifacts-macos-12-arm64 | |
path: ./wheelhouse/*.whl | |
upload_all: | |
name: Publish wheels | |
needs: [build_wheels, build_macos_arm64_wheels] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: wheel_artifacts-* | |
merge-multiple: true | |
path: dist | |
- name: Publish package to TestPyPI | |
if: ${{ contains(github.ref_name,'.test') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish package to PyPI | |
if: ${{ !contains(github.ref_name,'.test') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 |