Skip to content

Manylinux wheels

Manylinux wheels #1877

name: Manylinux wheels
on:
push:
pull_request:
create:
schedule:
- cron: '23 1 * * *'
env:
KIVY_SPLIT_EXAMPLES: 1
SERVER_IP: '159.203.106.198'
jobs:
kivy_examples_create:
# we need examples wheel for tests, but only windows actually uploads kivy-examples to pypi/server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
install_kivy_test_wheel_run_pip_deps
- name: Create wheel
run: |
source .ci/ubuntu_ci.sh
create_kivy_examples_wheel
- name: Upload kivy-examples wheel as artifact
uses: actions/upload-artifact@v3
with:
name: linux_examples_wheel
path: dist
manylinux_wheel_create:
env:
CIBW_ENVIRONMENT_LINUX: "KIVY_SPLIT_EXAMPLES=1 USE_X11=1 USE_SDL2=1 USE_PANGOFT2=0 USE_GSTREAMER=0 KIVY_DEPS_ROOT=$(pwd)/kivy-dependencies LD_LIBRARY_PATH=$(pwd)/kivy-dependencies/dist/lib:$(pwd)/kivy-dependencies/dist/lib64"
CIBW_BUILD_VERBOSITY_LINUX: 3
CIBW_BUILD: ${{ matrix.cibw_build }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BEFORE_ALL_LINUX: >
source .ci/ubuntu_ci.sh &&
install_manylinux_build_deps
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubuntu-latest
cibw_archs: x86_64
cibw_build: 'cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64'
- os: ubuntu-latest
cibw_archs: aarch64
cibw_build: 'cp37-manylinux_aarch64 cp38-manylinux_aarch64 cp39-manylinux_aarch64 cp310-manylinux_aarch64 cp311-manylinux_aarch64 cp312-manylinux_aarch64'
if: github.event_name == 'schedule' || (github.event_name == 'create' && github.event.ref_type == 'tag') || contains(github.event.head_commit.message, '[build wheel]') || contains(github.event.head_commit.message, '[build wheel linux]') || contains(github.event.pull_request.title, '[build wheel]') || contains(github.event.pull_request.title, '[build wheel linux]')
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Set up QEMU
if: ${{ matrix.cibw_archs == 'aarch64' }}
uses: docker/setup-qemu-action@v1
- uses: actions/cache@v3
id: deps-cache
with:
path: kivy-dependencies
key: ${{ runner.os }}-${{ matrix.cibw_archs }}-deps-cache-${{ hashFiles('./tools/build_linux_dependencies.sh') }}
- name: Build dependencies
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: |
docker run --rm -v `pwd`:/root:rw --workdir=/root \
quay.io/pypa/manylinux2014_${{ matrix.cibw_archs }} \
bash -ec 'source .ci/ubuntu_ci.sh && install_manylinux_build_deps && ./tools/build_linux_dependencies.sh'
- name: Generate version metadata
run: |
source .ci/ubuntu_ci.sh
update_version_metadata
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.17.0
- name: Make wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Upload wheels as artifact
uses: actions/upload-artifact@v3
with:
name: manylinux_wheels
path: ./wheelhouse/*.whl
manylinux_wheel_upload:
runs-on: ubuntu-latest
needs: [manylinux_wheel_create, kivy_examples_create]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/download-artifact@v3
with:
name: manylinux_wheels
path: dist
- name: Rename wheels
if: github.event.ref_type != 'tag'
run: |
source .ci/ubuntu_ci.sh
rename_wheels
- name: Upload wheels to server
env:
UBUNTU_UPLOAD_KEY: ${{ secrets.UBUNTU_UPLOAD_KEY }}
run: |
source .ci/ubuntu_ci.sh
upload_file_to_server "$SERVER_IP" "linux/kivy/"
- name: Upload to GitHub Release
uses: softprops/action-gh-release@v0.1.14
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
draft: true
- name: Publish to PyPI
if: github.event_name == 'create' && github.event.ref_type == 'tag'
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
source .ci/ubuntu_ci.sh
upload_artifacts_to_pypi
manylinux_wheel_test:
runs-on: ubuntu-latest
needs: [manylinux_wheel_create, kivy_examples_create]
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12' ]
env:
DISPLAY: ':99.0'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v3
with:
name: manylinux_wheels
path: dist
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
prepare_env_for_unittest
- name: Install Kivy
run: |
source .ci/ubuntu_ci.sh
install_kivy_wheel dev
- uses: actions/download-artifact@v3
with:
name: linux_examples_wheel
path: dist
- name: Install kivy-examples wheel
run: |
source .ci/ubuntu_ci.sh
install_kivy_examples_wheel dev
- name: Test Kivy
run: |
source .ci/ubuntu_ci.sh
test_kivy_install
- name: Test Kivy benchmarks
if: matrix.python == '3.x' && (github.event_name == 'schedule' || (github.event_name == 'create' && github.event.ref_type == 'tag'))
run: |
source .ci/ubuntu_ci.sh
test_kivy_benchmark
- name: Upload benchmarks as artifact
uses: actions/upload-artifact@v3
with:
name: benchmarks
path: .benchmarks-kivy
sdist_test:
runs-on: ubuntu-latest
env:
DISPLAY: ':99.0'
KIVY_SPLIT_EXAMPLES: 0
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Generate sdist
run: |
source .ci/ubuntu_ci.sh
generate_sdist
- name: Install dependencies
run: |
source .ci/ubuntu_ci.sh
install_ubuntu_build_deps
./tools/build_linux_dependencies.sh
install_kivy_test_wheel_run_pip_deps
- name: Setup env
run: |
source .ci/ubuntu_ci.sh
prepare_env_for_unittest
- name: Install Kivy
run: |
source .ci/ubuntu_ci.sh
export KIVY_DEPS_ROOT=$(pwd)/kivy-dependencies
install_kivy_sdist
- name: Test Kivy
run: |
source .ci/ubuntu_ci.sh
test_kivy_install