Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(build): move nightly to testpypi #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ jobs:

$PROJECT_NAME = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?name\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
$CURRENT_VERSION = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?version\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
$NIGHTLY_NAME = "$PROJECT_NAME-nightly"


# Get PR number and run number with proper padding
$PR_NUM = [int]"${{ github.event.pull_request.number }}"
Expand All @@ -63,10 +61,6 @@ jobs:
# Update version in pyproject.toml
(Get-Content pyproject.toml) -replace "version = `"$CURRENT_VERSION`"", "version = `"$DEV_VERSION`"" | Set-Content pyproject.toml

# Update project name in pyproject.toml
(Get-Content pyproject.toml) -replace "name = `"$PROJECT_NAME`"", "name = `"$NIGHTLY_NAME`"" | Set-Content pyproject.toml


Write-Output "Package version set to $DEV_VERSION"

$dependencyMessage = @"
Expand All @@ -78,11 +72,20 @@ jobs:
[project]
dependencies = [
# Exact version:
"$NIGHTLY_NAME==$DEV_VERSION",
"$PROJECT_NAME==$DEV_VERSION",

# Any version from PR
"$NIGHTLY_NAME>=$MIN_VERSION,<$MAX_VERSION"
"$PROJECT_NAME>=$MIN_VERSION,<$MAX_VERSION"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
$PROJECT_NAME = { index = "testpypi" }
``````
"@

Expand Down Expand Up @@ -123,7 +126,6 @@ jobs:
run: uv build

- name: Publish
run: |
uv publish
run: uv publish --index testpypi
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN_NIGHTLY }}
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ testpaths = ["tests"]
python_files = "test_*.py"
addopts = "-ra -q"


[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true