Skip to content

Commit b43ea06

Browse files
authored
Merge pull request #178 from UiPath/feat/ci_update_dev_publish
feat(ci): update dev build
2 parents c2e8d7a + 9628f0b commit b43ea06

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/publish-dev.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
$PROJECT_NAME = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?name\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
4242
$CURRENT_VERSION = ($pyprojcontent | Select-String -Pattern '(?m)^\[(project|tool\.poetry)\][^\[]*?version\s*=\s*"([^"]*)"' -AllMatches).Matches[0].Groups[2].Value
4343
44+
4445
# Get PR number and run number with proper padding
4546
$PR_NUM = [int]"${{ github.event.pull_request.number }}"
4647
$PADDED_PR = "{0:D5}" -f [int]"${{ github.event.pull_request.number }}"
@@ -59,9 +60,14 @@ jobs:
5960
6061
Write-Output "Package version set to $DEV_VERSION"
6162
63+
$startMarker = "<!-- DEV_PACKAGE_START -->"
64+
$endMarker = "<!-- DEV_PACKAGE_END -->"
65+
6266
$dependencyMessage = @"
67+
$startMarker
6368
## Development Package
6469
70+
- Use ``uipath pack --nolock`` to get the latest dev build from this PR (requires version range).
6571
- Add this package as a dependency in your pyproject.toml:
6672
6773
``````toml
@@ -82,7 +88,13 @@ jobs:
8288
8389
[tool.uv.sources]
8490
$PROJECT_NAME = { index = "testpypi" }
91+
92+
[tool.uv]
93+
override-dependencies = [
94+
"$PROJECT_NAME>=$MIN_VERSION,<$MAX_VERSION",
95+
]
8596
``````
97+
$endMarker
8698
"@
8799
88100
# Get the owner and repo from the GitHub repository
@@ -100,10 +112,11 @@ jobs:
100112
$pr = Invoke-RestMethod -Uri $prUri -Method Get -Headers $headers
101113
$currentBody = $pr.body
102114
103-
# Check if there's already a development package section
104-
if ($currentBody -match '## Development Package') {
105-
# Replace the existing section with the new dependency message
106-
$newBody = $currentBody -replace '## Development Package(\r?\n|.)*?(?=##|$)', $dependencyMessage
115+
# Check if markers already exist in the PR description
116+
$markerPattern = "(?s)$([regex]::Escape($startMarker)).*?$([regex]::Escape($endMarker))"
117+
if ($currentBody -match $markerPattern) {
118+
# Replace everything between markers (including markers)
119+
$newBody = $currentBody -replace $markerPattern, $dependencyMessage
107120
} else {
108121
# Append the dependency message to the end of the description
109122
$newBody = if ($currentBody) { "$currentBody`n`n$dependencyMessage" } else { $dependencyMessage }

0 commit comments

Comments
 (0)