Bump version number (for testing) and build only sdist #90
Workflow file for this run
This file contains hidden or 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: | |
- release/* | |
tags: | |
- v[0-9]+.* | |
jobs: | |
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 libbz2-dev libcurl4-openssl-dev liblzma-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_sdist] | |
runs-on: ubuntu-latest | |
environment: ${{ github.ref_type == 'tag' && '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.ref_type == 'branch' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish distribution to PyPI | |
if: github.ref_type == 'tag' | |
uses: pypa/gh-action-pypi-publish@release/v1 |