Skip to content

Commit 5d4e63f

Browse files
committed
chore: support testing publish workflow to test.pypi.org
1 parent c029509 commit 5d4e63f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.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:
@@ -18,4 +25,5 @@ jobs:
1825
- run: uv build
1926
- run: uv publish
2027
env:
21-
UV_PUBLISH_TOKEN: ${{secrets.POETRY_PYPI_TOKEN_PYPI}}
28+
UV_PUBLISH_TOKEN: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test_release && secrets.TEST_PYPI_API_TOKEN || secrets.POETRY_PYPI_TOKEN_PYPI }}
29+
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)