4444
4545 $PROJECT_NAME = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?name\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
4646 $CURRENT_VERSION = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?version\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
47- $NIGHTLY_NAME = "$PROJECT_NAME-nightly"
48-
4947
5048 # Get PR number and run number with proper padding
5149 $PR_NUM = [int]"${{ github.event.pull_request.number }}"
6361 # Update version in pyproject.toml
6462 (Get-Content pyproject.toml) -replace "version = `"$CURRENT_VERSION`"", "version = `"$DEV_VERSION`"" | Set-Content pyproject.toml
6563
66- # Update project name in pyproject.toml
67- (Get-Content pyproject.toml) -replace "name = `"$PROJECT_NAME`"", "name = `"$NIGHTLY_NAME`"" | Set-Content pyproject.toml
68-
69-
7064 Write-Output "Package version set to $DEV_VERSION"
7165
7266 $dependencyMessage = @"
@@ -78,11 +72,20 @@ jobs:
7872 [project]
7973 dependencies = [
8074 # Exact version:
81- "$NIGHTLY_NAME ==$DEV_VERSION",
75+ "$PROJECT_NAME ==$DEV_VERSION",
8276
8377 # Any version from PR
84- "$NIGHTLY_NAME >=$MIN_VERSION,<$MAX_VERSION"
78+ "$PROJECT_NAME >=$MIN_VERSION,<$MAX_VERSION"
8579 ]
80+
81+ [[tool.uv.index]]
82+ name = "testpypi"
83+ url = "https://test.pypi.org/simple/"
84+ publish-url = "https://test.pypi.org/legacy/"
85+ explicit = true
86+
87+ [tool.uv.sources]
88+ $PROJECT_NAME = { index = "testpypi" }
8689 ``````
8790 "@
8891
@@ -123,7 +126,6 @@ jobs:
123126 run : uv build
124127
125128 - name : Publish
126- run : |
127- uv publish
129+ run : uv publish --index testpypi
128130 env :
129- UV_PUBLISH_TOKEN : ${{ secrets.PYPI_TOKEN_NIGHTLY }}
131+ UV_PUBLISH_TOKEN : ${{ secrets.TEST_PYPI_TOKEN }}
0 commit comments