Skip to content

Commit ee167a3

Browse files
committed
[build] Fix environment name mispatch in PyPI publishing job
1 parent a902308 commit ee167a3

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
required: true
1212
type: choice
1313
options:
14-
- test
15-
- release
16-
default: 'test'
14+
- testpypi
15+
- pypi
16+
default: 'testpypi'
1717

1818
jobs:
1919
verify:
@@ -74,8 +74,8 @@ jobs:
7474
needs: verify
7575

7676
environment:
77-
name: ${{ github.event.inputs.environment == 'test' && 'testpypi' || 'pypi' }}
78-
url: ${{ github.event.inputs.environment == 'test' && 'https://test.pypi.org/p/scenedetect' || 'https://pypi.org/p/scenedetect' }}
77+
name: ${{ github.event.inputs.environment }}
78+
url: ${{ github.event.inputs.environment == 'testpypi' && 'https://test.pypi.org/p/scenedetect' || 'https://pypi.org/p/scenedetect' }}
7979

8080
permissions:
8181
id-token: write # IMPORTANT: mandatory for trusted publishing
@@ -117,6 +117,8 @@ jobs:
117117
- name: Publish Package
118118
uses: pypa/gh-action-pypi-publish@release/v1
119119
with:
120-
repository-url: ${{ github.event.inputs.environment == 'test' && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
120+
repository-url: ${{ github.event.inputs.environment == 'testpypi' && 'https://test.pypi.org/legacy/' || 'https://upload.pypi.org/legacy/' }}
121121
packages-dir: pkg/
122122
print-hash: true
123+
# Tolerate retries: skip existing packages if for example only one variant was uploaded.
124+
skip-existing: true

0 commit comments

Comments
 (0)