diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index f076431..712ca67 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -43,29 +43,29 @@ jobs: run: | uv run pytest test_cloudcheck.py -v - publish: - runs-on: ubuntu-latest - needs: test - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' - steps: - - uses: actions/checkout@v6 - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.x" - - name: Set up Rust - uses: dtolnay/rust-toolchain@stable - - name: Set up uv - uses: astral-sh/setup-uv@v7 - - name: Build PyPi package - run: uv run maturin build --release --out dist - - name: Publish PyPi package - # TODO: Remove || true - run: uv run maturin publish --username __token__ --password ${{ secrets.PYPI_TOKEN }} || true + # publish: + # runs-on: ubuntu-latest + # needs: test + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # steps: + # - uses: actions/checkout@v6 + # - name: Set up Python + # uses: actions/setup-python@v6 + # with: + # python-version: "3.x" + # - name: Set up Rust + # uses: dtolnay/rust-toolchain@stable + # - name: Set up uv + # uses: astral-sh/setup-uv@v7 + # - name: Build PyPi package + # run: uv run maturin build --release --out dist + # - name: Publish PyPi package + # # TODO: Remove || true + # run: uv run maturin publish --username __token__ --password ${{ secrets.PYPI_TOKEN }} || true linux: runs-on: ${{ matrix.platform.runner }} - needs: publish - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # needs: publish + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' strategy: matrix: platform: @@ -89,10 +89,6 @@ jobs: python-version: 3.x - name: Build wheels uses: PyO3/maturin-action@v1 - env: - # Fix ARM cross-compilation: define __ARM_ARCH for assembly files - CFLAGS_aarch64_unknown_linux_gnu: "-march=armv8-a" - CFLAGS_armv7_unknown_linux_gnueabihf: "-march=armv7-a -mfpu=neon" with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter @@ -119,8 +115,8 @@ jobs: musllinux: runs-on: ${{ matrix.platform.runner }} - needs: publish - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # needs: publish + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' strategy: matrix: platform: @@ -145,16 +141,19 @@ jobs: sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: musllinux_1_2 before-script-linux: | - if command -v apt-get >/dev/null 2>&1; then + if command -v apk >/dev/null 2>&1; then + # Alpine (musllinux) + apk add --no-cache openssl-dev pkgconfig perl make musl-dev + elif command -v apt-get >/dev/null 2>&1; then # Debian-based sudo apt-get update - sudo apt-get install -y pkg-config libssl-dev + sudo apt-get install -y pkg-config libssl-dev perl make gcc g++ binutils elif command -v yum >/dev/null 2>&1; then # CentOS-based yum update -y - yum install -y openssl openssl-devel + yum install -y openssl openssl-devel perl perl-core make gcc gcc-c++ binutils else - echo "Error: Neither apt-get nor yum found" + echo "Error: No supported package manager found" exit 1 fi @@ -166,8 +165,8 @@ jobs: windows: runs-on: ${{ matrix.platform.runner }} - needs: publish - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # needs: publish + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' strategy: matrix: platform: @@ -195,8 +194,8 @@ jobs: macos: runs-on: ${{ matrix.platform.runner }} - needs: publish - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # needs: publish + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' strategy: matrix: platform: @@ -223,8 +222,8 @@ jobs: sdist: runs-on: ubuntu-latest - needs: publish - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # needs: publish + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' steps: - uses: actions/checkout@v6 - name: Build sdist @@ -238,28 +237,28 @@ jobs: name: wheels-sdist path: dist - release: - name: Release - runs-on: ubuntu-latest - needs: [linux, musllinux, windows, macos, sdist] - if: github.event_name == 'push' && github.ref == 'refs/heads/stable' - permissions: - # Use to sign the release artifacts - id-token: write - # Used to upload release artifacts - contents: write - # Used to generate artifact attestation - attestations: write - steps: - - uses: actions/download-artifact@v7 - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v3 - with: - subject-path: 'wheels-*/*' - - name: Publish to PyPI - uses: PyO3/maturin-action@v1 - env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - with: - command: upload - args: --non-interactive --skip-existing wheels-*/* \ No newline at end of file + # release: + # name: Release + # runs-on: ubuntu-latest + # needs: [linux, musllinux, windows, macos, sdist] + # if: github.event_name == 'push' && github.ref == 'refs/heads/stable' + # permissions: + # # Use to sign the release artifacts + # id-token: write + # # Used to upload release artifacts + # contents: write + # # Used to generate artifact attestation + # attestations: write + # steps: + # - uses: actions/download-artifact@v7 + # - name: Generate artifact attestation + # uses: actions/attest-build-provenance@v3 + # with: + # subject-path: 'wheels-*/*' + # - name: Publish to PyPI + # uses: PyO3/maturin-action@v1 + # env: + # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + # with: + # command: upload + # args: --non-interactive --skip-existing wheels-*/* \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 7816218..65f9ba5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,6 +237,7 @@ dependencies = [ "clap", "env_logger", "log", + "openssl", "pyo3", "pyo3-async-runtimes", "radixtarget", @@ -1036,6 +1037,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-src" +version = "300.5.4+3.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.111" @@ -1044,6 +1054,7 @@ checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index 01626d2..ab54bdb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1", features = ["full"] } reqwest = { version = "0.13", default-features = false, features = ["json", "native-tls", "http2"] } +openssl = { version = "0.10", features = ["vendored"] } pyo3 = { version = "0.27", optional = true } pyo3-async-runtimes = { version = "0.27", features = ["tokio-runtime"], optional = true } radixtarget = "4.2"