Skip to content

Commit 396bd93

Browse files
committed
test
1 parent 54b27a9 commit 396bd93

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ on:
77
release:
88
types:
99
- "published"
10+
env:
11+
TARGET_INDEX: ${{ !contains(github.ref_name, 'test') && startsWith(github.ref_name, 'v') && 'pypi' || 'testpypi' }}
1012

1113
jobs:
1214
pypi:
1315
name: Publish to PyPI
1416
runs-on: ubuntu-latest
1517
environment:
16-
name: ${{ !contains(github.ref_name, 'test') && startsWith(github.ref_name, 'v') && 'pypi' || 'testpypi' }}
18+
name: ${{ env.TARGET_INDEX }}
1719
permissions:
1820
id-token: write
1921
steps:
@@ -24,4 +26,4 @@ jobs:
2426
run: uv run --isolated --no-project -p 3.13 --with dist/*.whl --with pytest pytest tests/test_base.py
2527
- name: Smoke test (source distribution)
2628
run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz --with pytest pytest tests/test_base.py
27-
- run: uv publish --trusted-publishing always ${{ !contains(github.ref_name, 'test') && startsWith(github.ref_name, 'v') && '' || '--index testpypi' }}
29+
- run: uv publish --trusted-publishing always ${{ env.TARGET_INDEX == 'testpypi') && '--index testpypi' }}

0 commit comments

Comments
 (0)