|
18 | 18 | needs: full-ci |
19 | 19 | runs-on: ubuntu-latest |
20 | 20 | # Only publish for proper pre-release versions (PEP 440) |
21 | | - if: contains(github.ref, 'rc') || contains(github.ref, 'a') || contains(github.ref, 'b') |
| 21 | + if: contains(github.ref_name, 'rc') || contains(github.ref_name, 'a') || contains(github.ref_name, 'b') |
22 | 22 |
|
23 | 23 | permissions: |
24 | 24 | id-token: write # Required for trusted publishing |
|
62 | 62 | needs: publish-testpypi |
63 | 63 | runs-on: ubuntu-latest |
64 | 64 | # Only validate for pre-release versions that were published to TestPyPI |
65 | | - if: contains(github.ref, 'rc') || contains(github.ref, 'a') || contains(github.ref, 'b') |
| 65 | + if: contains(github.ref_name, 'rc') || contains(github.ref_name, 'a') || contains(github.ref_name, 'b') |
66 | 66 |
|
67 | 67 | steps: |
68 | 68 | - uses: actions/checkout@v4 |
@@ -249,16 +249,26 @@ jobs: |
249 | 249 | body_path: release-notes.md |
250 | 250 | draft: false |
251 | 251 |
|
| 252 | + debug-condition: |
| 253 | + name: Debug Release Condition |
| 254 | + runs-on: ubuntu-latest |
| 255 | + steps: |
| 256 | + - name: Debug info |
| 257 | + run: | |
| 258 | + echo "github.ref = ${{ github.ref }}" |
| 259 | + echo "github.ref_name = ${{ github.ref_name }}" |
| 260 | + echo "ref contains 'a': ${{ contains(github.ref, 'a') }}" |
| 261 | + echo "ref_name contains 'a': ${{ contains(github.ref_name, 'a') }}" |
| 262 | + echo "ref_name contains '-': ${{ contains(github.ref_name, '-') }}" |
| 263 | + echo "Should publish to PyPI (new logic): ${{ !contains(github.ref_name, '-') }}" |
| 264 | +
|
252 | 265 | publish-pypi: |
253 | 266 | name: Publish to PyPI |
254 | 267 | needs: full-ci |
255 | 268 | runs-on: ubuntu-latest |
256 | 269 | # Only publish stable versions (no pre-release suffix) |
257 | | - # Pre-releases go to TestPyPI for now |
258 | | - if: | |
259 | | - !contains(github.ref, 'rc') && |
260 | | - !contains(github.ref, 'a') && |
261 | | - !contains(github.ref, 'b') |
| 270 | + # Match only versions like v0.0.1, v1.2.3, etc (no suffix) |
| 271 | + if: "!contains(github.ref_name, '-')" |
262 | 272 |
|
263 | 273 | permissions: |
264 | 274 | id-token: write # Required for trusted publishing |
|
0 commit comments