diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86e8ba51..0b2d94e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,38 +1,68 @@ --- name: CI -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] permissions: - contents: read + contents: write jobs: - distros: - name: "Ubuntu with Python ${{ matrix.python-version }}" - runs-on: "ubuntu-20.04" + build: + name: "${{ matrix.os }} with Python ${{ matrix.python-version }}" + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3"] + python-version: ["cp310", "cp311", "pp310"] + os: ["ubuntu-latest", "macos-latest"] steps: - name: Checkout - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: Install apt dependencies run: | set -ex sudo apt update sudo apt install -y ldap-utils slapd enchant-2 libldap2-dev libsasl2-dev apparmor-utils + if: runner.os == 'Linux' - name: Disable AppArmor run: sudo aa-disable /usr/sbin/slapd - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + if: runner.os == 'Linux' + - name: Set up QEMU for multi-arch build + # Check https://github.com/docker/setup-qemu-action for newer versions. + uses: docker/setup-qemu-action@v2 + if: runner.os == 'Linux' with: - python-version: ${{ matrix.python-version }} - - name: "Install Python dependencies" - run: | - set -xe - python -V - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade tox tox-gh-actions - - name: "Test tox with Python ${{ matrix.python-version }}" - run: "python -m tox" + # Note: 6.2.0 is buggy: make sure to avoid it. + # See https://github.com/pypa/cibuildwheel/issues/1250 + image: tonistiigi/binfmt:qemu-v7.0.0 + - name: Build wheels + uses: pypa/cibuildwheel@v2.14.1 + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + CIBW_BUILD: ${{matrix.python-version}}-* + CIBW_SKIP: "*musllinux*" + CIBW_ARCHS_LINUX: x86_64 aarch64 + CIBW_ARCHS_MACOS: x86_64 arm64 universal2 + CIBW_BEFORE_ALL_LINUX: >- + yum -y groupinstall "Development tools" + && yum -y install openldap-devel python-devel + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3 + with: + # A file, directory or wildcard pattern that describes what to upload + path: wheelhouse/*.whl + release: + name: "Release" + needs: build + runs-on: ubuntu-latest + steps: + - name: Download Artifacts + # will download and upack all files from the default artifact named 'artifact' + uses: actions/download-artifact@v3 + - name: GH Release + uses: softprops/action-gh-release@v0.1.15 + with: + tag_name: latest + files: | + artifact/*.whl