From 9628f0be4ac13d87571b275640b1da9bc0a29938 Mon Sep 17 00:00:00 2001 From: Ion Mincu Date: Fri, 20 Feb 2026 11:28:31 +0200 Subject: [PATCH] feat(ci): update dev build --- .github/workflows/publish-dev.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml index d4cf9fa..00b55d2 100644 --- a/.github/workflows/publish-dev.yml +++ b/.github/workflows/publish-dev.yml @@ -41,6 +41,7 @@ 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 + # Get PR number and run number with proper padding $PR_NUM = [int]"${{ github.event.pull_request.number }}" $PADDED_PR = "{0:D5}" -f [int]"${{ github.event.pull_request.number }}" @@ -59,9 +60,14 @@ jobs: Write-Output "Package version set to $DEV_VERSION" + $startMarker = "" + $endMarker = "" + $dependencyMessage = @" + $startMarker ## Development Package + - Use ``uipath pack --nolock`` to get the latest dev build from this PR (requires version range). - Add this package as a dependency in your pyproject.toml: ``````toml @@ -82,7 +88,13 @@ jobs: [tool.uv.sources] $PROJECT_NAME = { index = "testpypi" } + + [tool.uv] + override-dependencies = [ + "$PROJECT_NAME>=$MIN_VERSION,<$MAX_VERSION", + ] `````` + $endMarker "@ # Get the owner and repo from the GitHub repository @@ -100,10 +112,11 @@ jobs: $pr = Invoke-RestMethod -Uri $prUri -Method Get -Headers $headers $currentBody = $pr.body - # Check if there's already a development package section - if ($currentBody -match '## Development Package') { - # Replace the existing section with the new dependency message - $newBody = $currentBody -replace '## Development Package(\r?\n|.)*?(?=##|$)', $dependencyMessage + # Check if markers already exist in the PR description + $markerPattern = "(?s)$([regex]::Escape($startMarker)).*?$([regex]::Escape($endMarker))" + if ($currentBody -match $markerPattern) { + # Replace everything between markers (including markers) + $newBody = $currentBody -replace $markerPattern, $dependencyMessage } else { # Append the dependency message to the end of the description $newBody = if ($currentBody) { "$currentBody`n`n$dependencyMessage" } else { $dependencyMessage }