Skip to content

Commit 2545874

Browse files
authored
Merge pull request #99 from UiPath/feature/testpypi_nightly
feat(build): move nightly to testpypi
2 parents 90f021a + 4adaf90 commit 2545874

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/publish-dev.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ jobs:
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 }}"
@@ -63,10 +61,6 @@ jobs:
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 }}

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,8 @@ testpaths = ["tests"]
100100
python_files = "test_*.py"
101101
addopts = "-ra -q"
102102

103-
103+
[[tool.uv.index]]
104+
name = "testpypi"
105+
url = "https://test.pypi.org/simple/"
106+
publish-url = "https://test.pypi.org/legacy/"
107+
explicit = true

0 commit comments

Comments
 (0)