diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index 7404e69..a74c17f 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -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 }}" @@ -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 = @" @@ -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" } `````` "@ @@ -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 }} \ No newline at end of file + UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index dc31d9c..42c2bb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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