Skip to content

Merge pull request #14 from aboutcode-org/release-arm-wheels #54

Merge pull request #14 from aboutcode-org/release-arm-wheels

Merge pull request #14 from aboutcode-org/release-arm-wheels #54

Workflow file for this run

name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch
# This is executed automatically on a tag in the main branch
# Summary of the steps:
# - build wheels and sdist
# - upload wheels and sdist to PyPI
# - create gh-release and upload wheels and dists there
# TODO: smoke test wheels and sdist
# TODO: add changelog to release text body
# WARNING: this is designed only for packages building as pure Python wheels
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
permissions: {}
jobs:
build-wheels:
name: Build unicode wheels ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
arch: [auto64]
build: ["cp{310,311,312,313,314}-*"]
include:
- os: ubuntu-latest
arch: auto64
type: manylinux2014
build: "cp{310,311,312,313,314}-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
- os: ubuntu-24.04-arm
arch: aarch64
build: "cp{310,311,312,313,314}-*"
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
- os: macos-latest
arch: universal2
build: "cp{310,311,312,313,314}-*"
- os: windows-latest
arch: auto64
build: "cp{310,311,312,313,314}-*"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Build wheels and run tests
uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084
env:
CIBW_BUILD: ${{ matrix.build }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.CIBW_MANYLINUX_X86_64_IMAGE }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.CIBW_MANYLINUX_AARCH64_IMAGE }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest -vvs {project}/tests
- name: Collect built wheels
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: cyseq-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Checkout and install reqs
run: |
pip install --upgrade --user build twine pkginfo packaging pip setuptools cython
pip install setuptools-scm==10.0.4
- name: Build sdist
run: |
python setup.py sdist
twine check dist/*
- name: Collect built sdist
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: cyseq-sdist
path: dist/*.tar.gz
merge:
runs-on: ubuntu-latest
needs: [build-sdist, build-wheels]
steps:
- name: Merge created wheels and sdist in a single zip
uses: actions/upload-artifact/merge@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: cyseq-build
pattern: cyseq-*
check-dist:
name: Check distributions are PyPi-correct
needs: merge
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
path: cyseq-build
- run: find . -ls
- run: pipx run twine check --strict cyseq-build/*/*
create-gh-release:
name: Create GH release
needs:
- check-dist
runs-on: ubuntu-24.04
steps:
- name: Download builds
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: cyseq-build
path: cyseq-build
- name: Create GH release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
with:
draft: true
files: cyseq-build/*
create-pypi-release:
name: Create PyPI release
needs:
- create-gh-release
runs-on: ubuntu-24.04
environment: pypi-publish
permissions:
id-token: write
steps:
- name: Download builds
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
with:
name: cyseq-build
path: dist/
- name: Mock PyPI upload
run: |
ls -al dist
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b