@@ -58,21 +58,23 @@ jobs:
5858 with :
5959 ref : ${{ inputs.tag || github.ref }}
6060
61- # Version override: patch [project].version in pyproject.toml before the
62- # sdist is built so every wheel (built from the sdist) inherits it. No
63- # override → keep the version already declared in the file.
61+ # Version resolution mirrors npm-publish.yml: explicit `version` input,
62+ # else the release `tag`, else the workspace version from the root
63+ # Cargo.toml (NOT pyproject.toml — the version committed there is a
64+ # local-build fallback that release.sh never bumps). The resolved version
65+ # is always patched into [project].version before the sdist is built so
66+ # every wheel (built from the sdist) inherits it.
6467 - name : Resolve version
6568 shell : bash
6669 working-directory : crates/docling-py
6770 run : |
6871 v="${{ inputs.version }}"
6972 if [ -z "$v" ] && [ -n "${{ inputs.tag }}" ]; then v="${{ inputs.tag }}"; v="${v#v}"; fi
70- if [ -n "$v" ]; then
71- sed -i.bak -E "0,/^version = \".*\"/s//version = \"$v\"/" pyproject.toml && rm -f pyproject.toml.bak
72- echo "Building docling-rs $v"
73- else
74- echo "Building docling-rs $(grep -m1 '^version = ' pyproject.toml | sed -E 's/.*"([^"]+)".*/\1/') (from pyproject.toml)"
73+ if [ -z "$v" ]; then
74+ v="$(grep -m1 '^version = ' ../../Cargo.toml | sed -E 's/.*"([^"]+)".*/\1/')"
7575 fi
76+ sed -i.bak -E "0,/^version = \".*\"/s//version = \"$v\"/" pyproject.toml && rm -f pyproject.toml.bak
77+ echo "Building docling-rs $v"
7678
7779 - uses : actions/setup-python@v5
7880 with :
0 commit comments