Skip to content

Commit 42193ed

Browse files
committed
fix pypi url
1 parent ef704aa commit 42193ed

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.github/workflows/test_windows_wheel.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ on:
44
push:
55
branches: [ "main", "feat/win-compilation-test" ]
66
workflow_dispatch:
7+
inputs:
8+
publish_target:
9+
description: 'Publish destination'
10+
required: true
11+
default: 'testpypi'
12+
type: choice
13+
options:
14+
- testpypi
15+
- pypi
716

817
concurrency:
918
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}
@@ -78,8 +87,8 @@ jobs:
7887
if: success()
7988
env:
8089
TWINE_USERNAME: __token__
81-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
82-
TWINE_REPOSITORY_URL: ${{ inputs.pypi_repository_url }}
90+
TWINE_PASSWORD: ${{ inputs.publish_target == 'pypi' && secrets.PYPI_API_TOKEN || secrets.TEST_PYPI_API_TOKEN }}
91+
TWINE_REPOSITORY_URL: ${{ inputs.publish_target == 'pypi' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
8392
run: |
8493
pip install twine
8594
twine upload --skip-existing --verbose wheelhouse/*.whl
@@ -88,13 +97,13 @@ jobs:
8897
if: success()
8998
shell: powershell
9099
env:
91-
PYPI_REPOSITORY_URL: ${{ inputs.pypi_repository_url }}
100+
PUBLISH_TARGET: ${{ inputs.publish_target || 'testpypi' }}
92101
run: |
93102
$wheel = Get-ChildItem wheelhouse/zvec-*.whl | Select-Object -First 1
94103
$filename = $wheel.Name
95104
$version = [regex]::Match($filename, '^zvec-([^-]+)-').Groups[1].Value
96105
97-
if ($env:PYPI_REPOSITORY_URL) {
106+
if ($env:PUBLISH_TARGET -eq 'testpypi') {
98107
$indexArgs = @("--index-url", "https://test.pypi.org/simple/", "--extra-index-url", "https://pypi.org/simple/")
99108
Write-Host "Waiting for zvec==$version to become available on TestPyPI..."
100109
} else {

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ markers = [
162162
######################################################################################################
163163
[tool.cibuildwheel]
164164
build = [
165-
"cp310-*",
166-
# "cp311-*",
165+
# "cp310-*",
166+
"cp311-*",
167167
# "cp312-*",
168168
# "cp313-*",
169169
# "cp314-*",

0 commit comments

Comments
 (0)