File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 runs-on : ubuntu-latest
1414 steps :
1515 - uses : actions/checkout@v6
16+ with :
17+ fetch-depth : 0
1618
1719 - uses : actions/setup-python@v6
1820 with :
@@ -24,15 +26,16 @@ jobs:
2426
2527 - name : Set dev version
2628 run : |
27- # Append .devN suffix based on commit count since last tag
28- BASE_VERSION=$(python -c "from specsmith import __version__; print(__version__)" )
29- COMMIT_COUNT=$(git rev-list --count HEAD ^$(git describe --tags --abbrev=0 2>/dev/null || echo HEAD~100))
29+ # Read base version from pyproject.toml (no module import needed)
30+ BASE_VERSION=$(grep 'version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/' )
31+ COMMIT_COUNT=$(git rev-list --count HEAD ^$(git describe --tags --abbrev=0 2>/dev/null || echo HEAD~100) 2>/dev/null || echo 0 )
3032 DEV_VERSION="${BASE_VERSION}.dev${COMMIT_COUNT}"
3133 echo "DEV_VERSION=${DEV_VERSION}" >> $GITHUB_ENV
3234
3335 # Patch pyproject.toml with dev version
3436 sed -i "s/version = \"${BASE_VERSION}\"/version = \"${DEV_VERSION}\"/" pyproject.toml
3537 echo "Building version: ${DEV_VERSION}"
38+ cat pyproject.toml | head -10
3639
3740 - run : python -m build
3841
You can’t perform that action at this time.
0 commit comments