Skip to content

Commit 77b7267

Browse files
tbitcsoz-agent
andcommitted
fix: dev-release workflow — read version from pyproject.toml, fetch full history
Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent dcfd7e1 commit 77b7267

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/dev-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
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

0 commit comments

Comments
 (0)