|
1 | 1 | name: Publish to PyPi |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
6 | | - |
7 | 4 | workflow_dispatch: |
8 | 5 |
|
9 | 6 | concurrency: |
@@ -166,6 +163,20 @@ jobs: |
166 | 163 | name: Check out |
167 | 164 | with: |
168 | 165 | submodules: recursive |
| 166 | + fetch-depth: 0 |
| 167 | + fetch-tags: true |
| 168 | + - name: Fetch git tags |
| 169 | + run: git fetch --force --tags |
| 170 | + - name: Verify version detection |
| 171 | + run: | |
| 172 | + python -m pip install setuptools-scm |
| 173 | + if [[ "$GITHUB_REF_NAME" == v* ]]; then |
| 174 | + echo "Release build on tag $GITHUB_REF_NAME" |
| 175 | + else |
| 176 | + python ci-utils/sync_version.py |
| 177 | + fi |
| 178 | + python -m setuptools_scm |
| 179 | + shell: bash |
169 | 180 | - name: Download prereqs |
170 | 181 | uses: actions/download-artifact@v4 |
171 | 182 | with: |
@@ -220,6 +231,20 @@ jobs: |
220 | 231 | name: Check out |
221 | 232 | with: |
222 | 233 | submodules: recursive |
| 234 | + fetch-depth: 0 |
| 235 | + fetch-tags: true |
| 236 | + - name: Fetch git tags |
| 237 | + run: git fetch --force --tags |
| 238 | + - name: Verify version detection |
| 239 | + run: | |
| 240 | + python -m pip install setuptools-scm |
| 241 | + if [[ "$GITHUB_REF_NAME" == v* ]]; then |
| 242 | + echo "Release build on tag $GITHUB_REF_NAME" |
| 243 | + else |
| 244 | + python ci-utils/sync_version.py |
| 245 | + fi |
| 246 | + python -m setuptools_scm |
| 247 | + shell: bash |
223 | 248 | - name: Download prereqs |
224 | 249 | uses: actions/download-artifact@v4 |
225 | 250 | with: |
@@ -276,6 +301,16 @@ jobs: |
276 | 301 | name: Check out |
277 | 302 | with: |
278 | 303 | submodules: recursive |
| 304 | + fetch-depth: 0 |
| 305 | + fetch-tags: true |
| 306 | + - name: Fetch git tags |
| 307 | + run: git fetch --force --tags |
| 308 | + shell: bash |
| 309 | + - name: Verify version detection |
| 310 | + run: | |
| 311 | + python -m pip install setuptools-scm |
| 312 | + python -m setuptools_scm |
| 313 | + shell: bash |
279 | 314 | - name: Download prereqs |
280 | 315 | uses: actions/download-artifact@v4 |
281 | 316 | with: |
@@ -331,6 +366,20 @@ jobs: |
331 | 366 | name: Check out |
332 | 367 | with: |
333 | 368 | submodules: recursive |
| 369 | + fetch-depth: 0 |
| 370 | + fetch-tags: true |
| 371 | + - name: Fetch git tags |
| 372 | + run: git fetch --force --tags |
| 373 | + - name: Verify version detection |
| 374 | + run: | |
| 375 | + python -m pip install setuptools-scm |
| 376 | + if [[ "$GITHUB_REF_NAME" == v* ]]; then |
| 377 | + echo "Release build on tag $GITHUB_REF_NAME" |
| 378 | + else |
| 379 | + python ci-utils/sync_version.py |
| 380 | + fi |
| 381 | + python -m setuptools_scm |
| 382 | + shell: bash |
334 | 383 | - name: Download prereqs |
335 | 384 | uses: actions/download-artifact@v4 |
336 | 385 | with: |
@@ -403,6 +452,21 @@ jobs: |
403 | 452 | steps: |
404 | 453 | - uses: actions/checkout@v3 |
405 | 454 | name: Check out |
| 455 | + with: |
| 456 | + fetch-depth: 0 |
| 457 | + fetch-tags: true |
| 458 | + - name: Fetch git tags |
| 459 | + run: git fetch --force --tags |
| 460 | + - name: Verify version detection |
| 461 | + run: | |
| 462 | + python -m pip install setuptools-scm |
| 463 | + if [[ "$GITHUB_REF_NAME" == v* ]]; then |
| 464 | + echo "Release build on tag $GITHUB_REF_NAME" |
| 465 | + else |
| 466 | + python ci-utils/sync_version.py |
| 467 | + fi |
| 468 | + python -m setuptools_scm |
| 469 | + shell: bash |
406 | 470 | - name: Download prereqs |
407 | 471 | uses: actions/download-artifact@v4 |
408 | 472 | with: |
|
0 commit comments