|
35 | 35 | permissions: |
36 | 36 | contents: write # push the git tag on main builds |
37 | 37 | outputs: |
38 | | - version: ${{ steps.v.outputs.version }} |
| 38 | + version: ${{ steps.v.outputs.version }} # image tag (may carry -branch) |
| 39 | + pyver: ${{ steps.v.outputs.pyver }} # PEP 440 form for the wheel |
39 | 40 | steps: |
40 | 41 | - uses: actions/checkout@v6 |
41 | 42 | with: |
@@ -90,12 +91,22 @@ jobs: |
90 | 91 | SLUG=${SLUG:0:30}; SLUG=${SLUG%-} |
91 | 92 | VERSION="$BASE.$PATCH-$SLUG" |
92 | 93 | fi |
| 94 | + # The image tag may carry a -branch suffix (fine for Docker tags), but |
| 95 | + # the wheel/_version.py must be PEP 440 — so branch builds use .devN. |
| 96 | + if [ "$REF_NAME" = "main" ] && [ "$EVENT" = "push" ]; then |
| 97 | + PYVER="$BASE.$PATCH" |
| 98 | + else |
| 99 | + PYVER="$BASE.$PATCH.dev0" |
| 100 | + fi |
93 | 101 | echo "version=$VERSION" | tee -a "$GITHUB_OUTPUT" |
| 102 | + echo "pyver=$PYVER" | tee -a "$GITHUB_OUTPUT" |
94 | 103 |
|
95 | 104 | python-checks: |
96 | 105 | runs-on: ubuntu-latest |
97 | 106 | steps: |
98 | 107 | - uses: actions/checkout@v6 |
| 108 | + - name: Generate _version.py (required before any uv build) |
| 109 | + run: make version |
99 | 110 | - uses: astral-sh/setup-uv@v6 |
100 | 111 | with: |
101 | 112 | version: 'latest' |
@@ -126,6 +137,8 @@ jobs: |
126 | 137 | packages: write |
127 | 138 | steps: |
128 | 139 | - uses: actions/checkout@v6 |
| 140 | + - name: Generate _version.py (baked into the image via COPY src) |
| 141 | + run: VERSION="${{ needs.version.outputs.pyver }}" make version |
129 | 142 | - uses: docker/setup-qemu-action@v3 |
130 | 143 | - uses: docker/setup-buildx-action@v3 |
131 | 144 | - name: Login to GHCR |
|
0 commit comments