Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup binary builds for Alpine and MacOS arm #6139

Merged
merged 10 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 59 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
- name: Install cython
uses: py-actions/py-dependency-install@v2
with:
submodules: true
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
path: requirements/cython.txt
- name: Cythonize
run: |
make cythonize
Expand All @@ -172,113 +172,76 @@ jobs:
name: dist
path: dist

build-linux:
name: Linux
build-wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.qemu }}
runs-on: ${{ matrix.os }}-latest
needs: pre-deploy
strategy:
matrix:
pyver: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
arch: [x86_64, aarch64, i686, ppc64le, s390x]
fail-fast: false
runs-on: ubuntu-latest
env:
py: /opt/python/${{ matrix.pyver }}/bin/python
img: quay.io/pypa/manylinux2014_${{ matrix.arch }}
needs: pre-deploy
os: [ubuntu, windows, macos]
qemu: ['']
include:
# Split ubuntu job for the sake of speed-up
- os: ubuntu
qemu: aarch64
- os: ubuntu
qemu: ppc64le
- os: ubuntu
qemu: s390x
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: true
- name: Set up QEMU
id: qemu
if: ${{ matrix.qemu }}
uses: docker/setup-qemu-action@v1
- name: Available platforms
run: echo ${{ steps.qemu.outputs.platforms }}
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cythonize
if: ${{ matrix.no-extensions == '' }}
run: |
make cythonize
- name: Install tools
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} ${{ env.py }} -m pip install -U setuptools wheel
- name: Make wheel
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} ${{ env.py }} setup.py bdist_wheel
- name: Repair wheel wheel
run: |
docker run --rm -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
${{ env.img }} auditwheel repair dist/*.whl --wheel-dir wheelhouse/
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: wheelhouse/*

build-binary:
name: Binary wheels
strategy:
matrix:
pyver: [3.7, 3.8, 3.9, '3.10']
os: [macos, windows]
arch: [x86, x64]
exclude:
- os: macos
arch: x86
fail-fast: false
runs-on: ${{ matrix.os }}-latest
needs: pre-deploy
steps:
- name: Checkout
uses: actions/[email protected]
with:
submodules: true
- name: Setup Python 3.8
uses: actions/setup-python@v2
platforms: all
id: qemu
- name: Prepare emulation
run: |
if [[ -n "${{ matrix.qemu }}" ]]; then
# Build emulated architectures only if QEMU is set,
# use default "auto" otherwise
echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV
fi
shell: bash
- name: Setup Python
uses: actions/[email protected]
- name: Install cython
uses: py-actions/py-dependency-install@v2
with:
python-version: ${{ matrix.pyver }}
architecture: ${{ matrix.arch }}
path: requirements/cython.txt
- name: Cythonize
if: ${{ matrix.no-extensions == '' }}
run: |
make cythonize
- name: Install dependencies
run: |
python -m pip install -U setuptools wheel
- name: Make wheel
run:
python setup.py bdist_wheel
- name: Upload artifacts
uses: actions/upload-artifact@v2
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist
path: ./wheelhouse/*.whl

deploy:
name: Deploy
needs: [build-linux, build-binary, build-tarball]
environment: release
needs: [build-tarball, build-wheels]
runs-on: ubuntu-latest
steps:
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install twine
run: |
python -m pip install twine
- name: Download dists
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: PyPI upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
- name: Checkout
uses: actions/[email protected]
- name: Login
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
- name: Make Release
uses: aio-libs/[email protected]
with:
changes_file: CHANGES.rst
name: aiohttp
version_file: aiohttp/__init__.py
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
artifact: dist
fix_issue_regex: "`#(\\d+) <https://github.com/aio-libs/aiohttp/issues/\\1>`"
fix_issue_repl: "(#\\1)"
1 change: 1 addition & 0 deletions CHANGES/6139.1.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started shipping platform-specific arm64 wheels for Apple Silicon — :user:`asvetlov`.
1 change: 1 addition & 0 deletions CHANGES/6139.2.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Started shipping platform-specific wheels with the ``musl`` tag targeting typical Alpine Linux runtimes — :user:`asvetlov`.