Skip to content

Commit ce4d2e6

Browse files
committed
chore: support testing publish workflow to test.pypi.org
1 parent 0de3a0c commit ce4d2e6

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name: PyPI Publish
33
on:
44
release:
55
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
test_release:
9+
description: If true, publish to test.pypi.org
10+
required: true
11+
default: true
12+
type: boolean
613

714
jobs:
815
publish:
@@ -17,4 +24,5 @@ jobs:
1724
- run: uv build
1825
- run: uv publish
1926
env:
20-
UV_PUBLISH_TOKEN: ${{secrets.POETRY_PYPI_TOKEN_PYPI}}
27+
UV_PUBLISH_TOKEN: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test_release && secrets.TEST_PYPI_API_TOKEN || secrets.POETRY_PYPI_TOKEN_PYPI }}
28+
UV_PUBLISH_URL: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test_release && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}

0 commit comments

Comments
 (0)