diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index cdccfa2..3d717f9 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -2,6 +2,8 @@ name: PyPI on: push: + branches: + - main tags: - "v*" workflow_dispatch: @@ -19,22 +21,22 @@ jobs: strategy: matrix: platform: - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86_64 manylinux: auto - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86 manylinux: auto - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: aarch64 manylinux: "2_28" - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: armv7 manylinux: auto - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: s390x manylinux: auto - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: ppc64le manylinux: auto steps: @@ -47,7 +49,7 @@ jobs: with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter -F duckdb/bundled - sccache: "true" + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: ${{ matrix.platform.manylinux }} - name: Upload wheels uses: actions/upload-artifact@v4 @@ -60,13 +62,13 @@ jobs: strategy: matrix: platform: - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86_64 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: x86 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: aarch64 - - runner: ubuntu-latest + - runner: ubuntu-22.04 target: armv7 steps: - uses: actions/checkout@v4 @@ -78,7 +80,7 @@ jobs: with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter -F duckdb/bundled - sccache: "true" + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} manylinux: musllinux_1_2 - name: Upload wheels uses: actions/upload-artifact@v4 @@ -86,7 +88,6 @@ jobs: name: wheels-musllinux-${{ matrix.platform.target }} path: dist - # https://github.com/gadomski/stacrs/issues/1 # windows: # runs-on: ${{ matrix.platform.runner }} # strategy: @@ -106,8 +107,8 @@ jobs: # uses: PyO3/maturin-action@v1 # with: # target: ${{ matrix.platform.target }} - # args: --release --out dist --find-interpreter - # sccache: "true" + # args: --release --out dist --find-interpreter -F duckdb/bundled + # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # - name: Upload wheels # uses: actions/upload-artifact@v4 # with: @@ -133,7 +134,7 @@ jobs: with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter -F duckdb/bundled - sccache: "true" + sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} - name: Upload wheels uses: actions/upload-artifact@v4 with: @@ -159,10 +160,12 @@ jobs: name: Release runs-on: ubuntu-latest if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} - needs: [linux, musllinux, macos, sdist] - environment: - name: pypi - url: https://pypi.org/p/stacrs + needs: + - linux + - musllinux + # - windows + - macos + - sdist permissions: id-token: write contents: write @@ -173,7 +176,9 @@ jobs: uses: actions/attest-build-provenance@v1 with: subject-path: "wheels-*/*" - - uses: PyO3/maturin-action@v1 + - name: Publish to PyPI + if: ${{ startsWith(github.ref, 'refs/tags/') }} + uses: PyO3/maturin-action@v1 with: command: upload args: --non-interactive --skip-existing wheels-*/* diff --git a/Cargo.toml b/Cargo.toml index 5639afe..3d0ef17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] [dependencies] duckdb = { version = "1.1.1" } geojson = "0.24.1" -pyo3 = "0.23.4" +pyo3 = { version = "0.23.4", features = ["extension-module"] } pyo3-async-runtimes = { version = "0.23.0", features = [ "tokio", "tokio-runtime",