Skip to content

Commit 88089e4

Browse files
authored
build: switch to abi3 build to make build faster and reduce size (#945)
* build: switch to abi3 build to make build faster and reduce size * build: `release` need to happen after `test-abi3` * fix: allow test install download from pypi * fix: `release-doc` only triggered for tags * docs: update comments
1 parent d0f53da commit 88089e4

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# This file is autogenerated by maturin v1.8.1
2-
# To update, run
3-
#
4-
# maturin generate-ci github
1+
# This workflow can be triggered on tags push (automatic release) or manually on any branch.
52
#
3+
# - When triggered on tags push, it will build and publishes a new version including docs.
4+
# - When triggered manually, it's a dry-run: only build, without publishing anything.
65
name: release
76

87
on:
@@ -43,7 +42,7 @@ jobs:
4342
name: Cargo.toml
4443
- uses: actions/setup-python@v5
4544
with:
46-
python-version: 3.x
45+
python-version: 3.13
4746
- name: Build wheels
4847
uses: PyO3/maturin-action@v1
4948
with:
@@ -58,6 +57,24 @@ jobs:
5857
name: wheels-${{ matrix.platform.os }}-${{ matrix.platform.target }}
5958
path: dist
6059

60+
test-abi3:
61+
runs-on: ubuntu-24.04
62+
needs: build
63+
strategy:
64+
matrix:
65+
py: ["3.11", "3.12", "3.13"]
66+
steps:
67+
- uses: actions/download-artifact@v4
68+
with:
69+
name: wheels-linux-x86_64
70+
- uses: actions/setup-python@v5
71+
with:
72+
python-version: ${{ matrix.py }}
73+
- run: python -V
74+
- run: pip install --find-links=./ cocoindex
75+
- run: python -c "import cocoindex, sys; print('import ok on', sys.version)"
76+
77+
6178
sdist:
6279
runs-on: ubuntu-latest
6380
needs: [create-versioned-toml]
@@ -80,7 +97,7 @@ jobs:
8097
release:
8198
name: Release
8299
runs-on: ubuntu-latest
83-
needs: [create-versioned-toml, build, sdist]
100+
needs: [create-versioned-toml, build, test-abi3, sdist]
84101
permissions:
85102
# Use to sign the release artifacts
86103
id-token: write
@@ -111,5 +128,6 @@ jobs:
111128
release-docs:
112129
name: Release Docs
113130
needs: [release]
131+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
114132
uses: ./.github/workflows/_doc_release.yml
115133
secrets: inherit

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ name = "cocoindex_engine"
1515
crate-type = ["cdylib"]
1616

1717
[dependencies]
18-
pyo3 = { version = "0.25.1", features = ["chrono", "auto-initialize", "uuid"] }
18+
pyo3 = { version = "0.25.1", features = [
19+
"abi3-py311",
20+
"auto-initialize",
21+
"chrono",
22+
"uuid",
23+
] }
1924
pythonize = "0.25.0"
2025
pyo3-async-runtimes = { version = "0.25.0", features = ["tokio-runtime"] }
2126

0 commit comments

Comments
 (0)