Publish wheels #78
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: | |
branches: | |
- v[0-9]+.* | |
tags: | |
- v[0-9]+.* | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: [ubuntu, macos] | |
build: ["cp36-* cp37-* cp38-* cp39-*", "cp310-* cp311-* cp312-*"] | |
x64image: [manylinux_2_28] | |
nametag: [none] | |
include: | |
- os: ubuntu | |
build: "cp38-manylinux_x86_64" | |
x64image: manylinux2014 | |
nametag: focal | |
steps: | |
- name: Checkout pysam | |
uses: actions/checkout@v4 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD: ${{ matrix.build }} | |
CIBW_SKIP: "*-musllinux_*" | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_ARCHS_LINUX: x86_64 | |
CIBW_ARCHS_MACOS: x86_64 | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.x64image }} | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 | |
- name: Check wheelhouse | |
run: devtools/artifactname.py wheelhouse/*.whl >> $GITHUB_ENV | |
env: | |
NAMETAG: ${{ matrix.nametag }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.artifactname }} | |
path: wheelhouse/*.whl | |
build_sdist: | |
runs-on: ubuntu-latest | |
env: | |
job_python_version: "3.10" | |
steps: | |
- name: Checkout pysam | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.job_python_version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.job_python_version }} | |
- name: Install prerequisite Python libraries | |
run: pip install cython | |
- name: Install build prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev | |
- name: Create source distribution | |
run: python setup.py sdist --owner=root --group=root | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist/pysam-*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
environment: ${{ github.event_name == 'release' && 'pypi' || 'testpypi' }} | |
permissions: | |
id-token: write | |
steps: | |
- name: Get artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
path: dist | |
- name: Publish distribution to Test PyPI | |
if: github.event_name == 'push' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish distribution to PyPI | |
if: github.event_name == 'release' && github.event.action == 'published' | |
uses: pypa/gh-action-pypi-publish@release/v1 |