diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index aa608ef2d..f9d5a6823 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -69,30 +69,78 @@ jobs: linux: runs-on: ubuntu-latest - # Add permissions to job permissions: id-token: write contents: read strategy: matrix: + target: [x86_64, i686] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - target: [x86_64] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install build dependencies run: | - python -m pip install --user cffi - python -m pip install --user patchelf + python -m pip install --upgrade pip + python -m pip install --upgrade maturin pytest click + sudo apt-get update + sudo apt-get install -y build-essential pkg-config libssl-dev - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} manylinux: auto - args: --release --out dist + args: --release --out dist --features python sccache: 'true' + - name: Test wheel + if: matrix.target == 'x86_64' + run: | + python -m pip install --no-index --find-links dist self_encryption + python -c "import self_encryption; print(self_encryption.__file__)" + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist/*.whl + if-no-files-found: error + + linux-cross: + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + strategy: + matrix: + target: [aarch64, armv7, s390x, ppc64le] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: auto + args: --release --out dist --features python + sccache: 'true' + - uses: uraimo/run-on-arch-action@v2.8.1 + if: matrix.target != 'ppc64' + name: Test wheel + with: + arch: ${{ matrix.target }} + distro: ubuntu20.04 + githubToken: ${{ github.token }} + install: | + apt-get update + apt-get install -y --no-install-recommends python3 python3-pip + pip3 install -U pip + run: | + pip3 install --no-index --find-links dist/ self_encryption + python3 -c "import self_encryption; print(self_encryption.__file__)" - name: Upload wheels uses: actions/upload-artifact@v3 with: