diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..edf235c8 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,73 @@ +build_wheels_task: + only_if: $CIRRUS_BRANCH =~ "release/.*" || $CIRRUS_TAG =~ "v0\..*" + + matrix: + - compute_engine_instance: + image_project: cirrus-images + image: family/docker-builder-arm64 + architecture: arm64 + platform: linux + matrix: + - name: Build ARM Linux py3.6-9 wheels + env: + CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*" + - name: Build ARM Linux py3.10-12 wheels + env: + CIBW_BUILD: "cp310-* cp311-* cp312-*" + + - name: Build ARM macOS wheels + macos_instance: + image: ghcr.io/cirruslabs/macos-ventura-base:latest + env: + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + + alias: build_wheels + + env: + CIRRUS_CLONE_DEPTH: 1 + + CIBW_SKIP: "*-musllinux_*" + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 + + install_script: | + python3 -m pip install cibuildwheel==2.16.2 + + build_script: | + cibuildwheel + + wheels_artifacts: + path: wheelhouse/*.whl + +upload_pypi_task: + only_if: $CIRRUS_BRANCH =~ "release/.*" || $CIRRUS_TAG =~ "v0\..*" + depends_on: build_wheels + + name: Publish ARM wheels + + container: + image: python:latest + + env: + CIRRUS_CLONE_DEPTH: 1 + API_BASEURL: https://api.cirrus-ci.com/v1 + TWINE_USERNAME: __token__ + + install_script: | + python3 -m pip install twine + + get_artifacts_script: | + curl -sSLO $API_BASEURL/artifact/build/$CIRRUS_BUILD_ID/wheels.zip + unzip -q wheels.zip + + upload_script: | + case "$CIRRUS_TAG" in + v0.*) + export TWINE_REPOSITORY=pypi TWINE_PASSWORD=$PYPI_TOKEN ;; + *) + export TWINE_REPOSITORY=testpypi TWINE_PASSWORD=$TESTPYPI_TOKEN ;; + esac + + echo Uploading wheels to $TWINE_REPOSITORY... + + python3 -m twine check wheelhouse/*.whl + python3 -m twine upload --disable-progress-bar wheelhouse/*.whl diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a6d2b077..9b7efdb2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,14 +15,11 @@ jobs: runs-on: ${{ matrix.os }}-latest strategy: matrix: - os: [ubuntu] - build: ["cp36-* cp37-*", "cp38-* cp39-*", "cp310-* cp311-*", "cp312-*"] + os: [ubuntu, macos] + build: ["cp36-* cp37-* cp38-* cp39-*", "cp310-* cp311-* cp312-*"] x64image: [manylinux_2_28] include: - - os: macos - build: "cp36-* cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*" - - os: ubuntu build: "cp38-manylinux_x86_64" x64image: manylinux2014 @@ -31,31 +28,23 @@ jobs: - name: Checkout pysam uses: actions/checkout@v3 - - name: Set up QEMU - if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v2 - with: - platforms: arm64 - - name: Build wheels - uses: pypa/cibuildwheel@v2.16.1 + uses: pypa/cibuildwheel@v2.16.2 env: CIBW_BUILD: ${{ matrix.build }} CIBW_SKIP: "*musllinux*" - CIBW_ARCHS_LINUX: auto aarch64 - CIBW_ARCHS_MACOS: x86_64 arm64 + 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 - CIBW_TEST_SKIP: "*-*linux_i686 *-*linux_aarch64 *-macosx_arm64" - - name: Upload artifacts uses: actions/upload-artifact@v3 with: - path: ./wheelhouse/*.whl + path: wheelhouse/*.whl build_sdist: runs-on: ${{ matrix.os }}-latest diff --git a/pyproject.toml b/pyproject.toml index 45bef40a..1f89f9b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ dynamic = [ ] [project.urls] -"Documentation" = "https://pysam.readthedocs.io/en/stable/" +"Documentation" = "https://pysam.readthedocs.io/" "Release notes" = "https://pysam.readthedocs.io/en/stable/release.html" [build-system] @@ -23,6 +23,8 @@ build-backend = "setuptools.build_meta:__legacy__" [tool.cibuildwheel] before-all = "{project}/devtools/install-prerequisites.sh" +# Necessary until we build libhts.a out-of-tree from within build_temp +before-build = "make -C {project}/htslib distclean" test-requires = ["pytest"] test-command = "REF_PATH=: pytest {project}/tests"