From 4d3f82da8c1c8010d50e78350c21b50adc7e7fb6 Mon Sep 17 00:00:00 2001 From: Facundo Tuesca Date: Tue, 15 Oct 2024 15:46:11 +0200 Subject: [PATCH] Fix manylinux and musllinux CI builds --- .github/workflows/CI.yml | 172 +++++++++++++++++++++++++++++++++++++++ rust/Cargo.toml | 4 +- 2 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..2ea4a1d --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,172 @@ +# This file is autogenerated by maturin v1.7.1 +# To update, run +# +# maturin generate-ci github +# +name: CI + +on: + push: + branches: + - main + - master + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + runs-on: ubuntu-latest + strategy: + matrix: + platform: + - target: x86_64 + - target: x86 + - target: aarch64 + - target: armv7 + - target: s390x + - target: ppc64le + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + manylinux: auto + before-script-linux: | + if command -v yum 2>&1 >/dev/null + then + yum update + yum install -y perl-core cpanminus devtoolset-10-libatomic-devel + # Workaround for OpenSSL not building on Centos 7 (manylinux2014) + # Remove once `openssl-src` builds OpenSSL > 3.3.2 by default + # Ref: https://github.com/openssl/openssl/pull/25367#issuecomment-2327177830 + cpanm --verbose --notest install Sub::Util + # else + # apt update + # apt install -y perl-core + fi + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist + + musllinux: + runs-on: ubuntu-latest + strategy: + matrix: + platform: + - target: x86_64 + - target: x86 + - target: aarch64 + - target: armv7 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + manylinux: musllinux_1_2 + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-musllinux-${{ matrix.platform.target }} + path: dist + + windows: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + architecture: ${{ matrix.platform.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist + + macos: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: macos-12 + target: x86_64 + - runner: macos-14 + target: aarch64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist + + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + - name: Upload sdist + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: dist + + release: + name: Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [linux, musllinux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v4 + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing wheels-*/* diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 27ce57c..7063662 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -21,7 +21,7 @@ hex = "0.4" sha2 = "0.10.8" rand = "0.8.5" cryptography-x509 = { git = "https://github.com/pyca/cryptography.git"} -openssl = "0.10.66" +openssl = { version = "0.10.66", features = ["vendored"] } [features] -extension-module = ["pyo3/extension-module"] \ No newline at end of file +extension-module = ["pyo3/extension-module"]