Skip to content

Commit 65f5e26

Browse files
authored
Merge pull request #84 from onekey-sec/publish-workflow-fixes
Fix publish workflow
2 parents 26a3a60 + b7b966f commit 65f5e26

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: PyPI Publish
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
66
workflow_dispatch:
77
inputs:
88
test_release:
@@ -22,7 +22,16 @@ jobs:
2222
enable-cache: true
2323
cache-dependency-glob: "uv.lock"
2424
- run: uv build
25-
- run: uv publish
25+
26+
- name: Publish to TestPyPI
27+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.test_release == true }}
28+
run: uv publish
29+
env:
30+
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
31+
UV_PUBLISH_URL: https://test.pypi.org/legacy/
32+
33+
- name: Publish to PyPI
34+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.test_release == false }}
35+
run: uv publish
2636
env:
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/' }}
37+
UV_PUBLISH_TOKEN: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}

0 commit comments

Comments
 (0)