Skip to content

Commit

Permalink
Merge release workflow updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarshall committed Apr 23, 2024
2 parents 8ab5287 + 75654b6 commit 5754de3
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 23 deletions.
10 changes: 8 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build_wheels_task:

- name: Build ARM macOS wheels
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
image: ghcr.io/cirruslabs/macos-sonoma-base:latest
env:
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"

Expand All @@ -26,11 +26,17 @@ build_wheels_task:
env:
CIRRUS_CLONE_DEPTH: 1

VENV: $HOME/relenv
PATH: $VENV/bin:$PATH

CIBW_SKIP: "*-musllinux_*"
CIBW_BUILD_VERBOSITY: 1

CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28

install_script: |
python3 -m pip install cibuildwheel==2.16.2
python3 -m venv $VENV
pip3 install cibuildwheel==2.17.0
build_script: |
cibuildwheel
Expand Down
39 changes: 23 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ jobs:
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
Expand All @@ -32,7 +34,8 @@ jobs:
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_SKIP: "*musllinux*"
CIBW_SKIP: "*-musllinux_*"
CIBW_BUILD_VERBOSITY: 1

CIBW_ARCHS_LINUX: x86_64
CIBW_ARCHS_MACOS: x86_64
Expand All @@ -41,42 +44,46 @@ jobs:
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@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifactname }}
path: wheelhouse/*.whl

build_sdist:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos]
python-version: [3.9]
runs-on: ubuntu-latest
env:
job_python_version: "3.10"

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ env.job_python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.job_python_version }}

- name: Install prerequisite Python libraries
run: pip install cython pytest pytest-pep8
run: pip install cython

- name: Install build prerequisites
if: runner.os == 'Linux'
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
run: python setup.py sdist --owner=root --group=root

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: sdist
path: dist/pysam-*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
Expand All @@ -88,9 +95,9 @@ jobs:

steps:
- name: Get artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact
merge-multiple: true
path: dist

- name: Publish distribution to Test PyPI
Expand Down
25 changes: 25 additions & 0 deletions devtools/artifactname.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3

import os
import re
import sys

pattern = re.compile(r'-cp([^-]*)-cp[^-]*-([^_]*)[0-9_]*_([^.]*)')
vers = set()
plats = set()
arches = set()

for fname in sys.argv[1:]:
m = pattern.search(fname)
vers.add(int(m[1]))
plats.add(m[2])
arches.add(m[3])

plat = '-'.join(sorted(plats))
arch = '-'.join(sorted(arches))
ver = '-'.join(map(str, sorted(vers)))

tag = os.environ.get('NAMETAG', 'none')
tag = f'-{tag}' if tag != 'none' else ''

print(f'artifactname=wheels-{plat}-{arch}-{ver}{tag}')
10 changes: 5 additions & 5 deletions devtools/install-prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
if test -x /usr/bin/dnf; then
echo Installing prerequisites via dnf...
dnf -y install epel-release
dnf -y install zlib-devel bzip2-devel xz-devel curl-devel samtools bcftools htslib-tools
dnf -y install zlib-devel bzip2-devel xz-devel curl-devel openssl-devel samtools bcftools htslib-tools

elif test -x /usr/bin/yum; then
if yum -y install epel-release; then
echo Installing prerequisites via yum...
yum -y install zlib-devel bzip2-devel xz-devel curl-devel samtools bcftools htslib-tools
yum -y install zlib-devel bzip2-devel xz-devel curl-devel openssl-devel samtools bcftools htslib-tools
else
echo Installing non-test prerequisites via yum...
yum -y install zlib-devel bzip2-devel xz-devel curl-devel
yum -y install zlib-devel bzip2-devel xz-devel curl-devel openssl-devel
fi

elif test -d /etc/dpkg; then
echo Installing prerequisites via apt-get...
apt-get update
apt-get install -y --no-install-recommends --no-install-suggests libcurl4-openssl-dev zlib1g-dev libbz2-dev liblzma-dev samtools bcftools tabix
apt-get install -y --no-install-recommends --no-install-suggests libcurl4-openssl-dev libssl-dev zlib1g-dev libbz2-dev liblzma-dev samtools bcftools tabix

elif test -x /sbin/apk; then
echo Installing non-test prerequisites via apk...
apk update
apk add zlib-dev bzip2-dev xz-dev curl-dev
apk add zlib-dev bzip2-dev xz-dev curl-dev openssl-dev

elif test -x ${HOMEBREW_PREFIX-/usr/local}/bin/brew; then
echo Installing prerequisites via brew...
Expand Down

0 comments on commit 5754de3

Please sign in to comment.