Skip to content

Commit 8a09240

Browse files
committed
Merge branch 'main' into feat/jar-9629-client-side-tools-cas-urt-v2
2 parents f1e297f + 8ca2807 commit 8a09240

58 files changed

Lines changed: 3834 additions & 460 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint-custom-version.yml

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,18 @@ jobs:
2020

2121
- name: Extract version from PR
2222
id: extract-version
23-
shell: bash
23+
shell: pwsh
24+
env:
25+
PR_TITLE: ${{ github.event.pull_request.title }}
2426
run: |
25-
# Extract version from PR title only
26-
PR_TITLE="${{ github.event.pull_request.title }}"
27-
28-
# Search for version pattern in title (any x.y.z.dev version)
29-
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | head -1)
30-
31-
if [ -z "$VERSION" ]; then
32-
echo "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
27+
$match = [regex]::Match($env:PR_TITLE, '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+')
28+
if (-not $match.Success) {
29+
Write-Output "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
3330
exit 1
34-
fi
35-
36-
echo "Extracted version: $VERSION"
37-
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
}
32+
$version = $match.Value
33+
Write-Output "Extracted version: $version"
34+
"version=$version" | Add-Content -Path $env:GITHUB_OUTPUT
3835
3936
- name: Setup uv
4037
uses: astral-sh/setup-uv@v5
@@ -47,31 +44,26 @@ jobs:
4744
python-version-file: ".python-version"
4845

4946
- name: Modify pyproject.toml for custom UiPath version
50-
shell: bash
47+
shell: pwsh
48+
env:
49+
UIPATH_VERSION: ${{ steps.extract-version.outputs.version }}
5150
run: |
52-
# Backup original pyproject.toml
53-
cp pyproject.toml pyproject.toml.backup
51+
Copy-Item pyproject.toml pyproject.toml.backup
5452
55-
# Update the uipath dependency to the custom version
56-
sed -i 's|"uipath>=.*"|"uipath==${{ steps.extract-version.outputs.version }}"|' pyproject.toml
53+
$content = Get-Content pyproject.toml -Raw
54+
$content = $content -replace '"uipath>=[^"]*"', "`"uipath==$env:UIPATH_VERSION`""
5755
56+
if ($content -notmatch '\[tool\.uv\.sources\]') {
57+
$content = $content.TrimEnd() + "`n`n[tool.uv.sources]`nuipath = { index = `"testpypi`" }`n"
58+
} elseif ($content -notmatch 'uipath\s*=\s*\{\s*index\s*=\s*"testpypi"\s*\}') {
59+
$content = $content -replace '(\[tool\.uv\.sources\])', "`$1`nuipath = { index = `"testpypi`" }"
60+
}
5861
62+
Set-Content -Path pyproject.toml -Value $content -NoNewline
5963
60-
# Add or update [tool.uv.sources] section if it doesn't exist
61-
if ! grep -q "\[tool\.uv\.sources\]" pyproject.toml; then
62-
echo "" >> pyproject.toml
63-
echo "[tool.uv.sources]" >> pyproject.toml
64-
echo 'uipath = { index = "testpypi" }' >> pyproject.toml
65-
else
66-
# Update existing sources if needed
67-
if ! grep -q 'uipath = { index = "testpypi" }' pyproject.toml; then
68-
sed -i '/\[tool\.uv\.sources\]/a uipath = { index = "testpypi" }' pyproject.toml
69-
fi
70-
fi
71-
72-
echo "Modified pyproject.toml to use UiPath version ${{ steps.extract-version.outputs.version }} from testpypi"
73-
echo "=== Modified pyproject.toml content ==="
74-
grep -A5 -B5 "uipath\|testpypi" pyproject.toml || true
64+
Write-Output "Modified pyproject.toml to use UiPath version $env:UIPATH_VERSION from testpypi"
65+
Write-Output "=== Modified pyproject.toml content ==="
66+
Get-Content pyproject.toml
7567
7668
- name: Install dependencies
7769
run: uv sync --all-extras
@@ -87,6 +79,5 @@ jobs:
8779

8880
- name: Restore original pyproject.toml
8981
if: always()
90-
shell: bash
91-
run: |
92-
mv pyproject.toml.backup pyproject.toml
82+
shell: pwsh
83+
run: Move-Item -Force pyproject.toml.backup pyproject.toml

.github/workflows/test-custom-version.yml

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,18 @@ jobs:
3232

3333
- name: Extract version from PR
3434
id: extract-version
35-
shell: bash
35+
shell: pwsh
36+
env:
37+
PR_TITLE: ${{ github.event.pull_request.title }}
3638
run: |
37-
# Extract version from PR title only
38-
PR_TITLE="${{ github.event.pull_request.title }}"
39-
40-
# Search for version pattern in title (any x.y.z.dev version)
41-
VERSION=$(echo "$PR_TITLE" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+' | head -1)
42-
43-
if [ -z "$VERSION" ]; then
44-
echo "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
39+
$match = [regex]::Match($env:PR_TITLE, '[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+')
40+
if (-not $match.Success) {
41+
Write-Output "No version found in PR title. Please include version in title like: 2.0.65.dev1004030443"
4542
exit 1
46-
fi
47-
48-
echo "Extracted version: $VERSION"
49-
echo "version=$VERSION" >> $GITHUB_OUTPUT
43+
}
44+
$version = $match.Value
45+
Write-Output "Extracted version: $version"
46+
"version=$version" | Add-Content -Path $env:GITHUB_OUTPUT
5047
5148
- name: Setup uv
5249
uses: astral-sh/setup-uv@v5
@@ -59,31 +56,26 @@ jobs:
5956
python-version: ${{ matrix.python-version }}
6057

6158
- name: Modify pyproject.toml for custom UiPath version
62-
shell: bash
59+
shell: pwsh
60+
env:
61+
UIPATH_VERSION: ${{ steps.extract-version.outputs.version }}
6362
run: |
64-
# Backup original pyproject.toml
65-
cp pyproject.toml pyproject.toml.backup
66-
67-
# Update the uipath dependency to the custom version
68-
sed -i 's|"uipath>=.*"|"uipath==${{ steps.extract-version.outputs.version }}"|' pyproject.toml
63+
Copy-Item pyproject.toml pyproject.toml.backup
6964
65+
$content = Get-Content pyproject.toml -Raw
66+
$content = $content -replace '"uipath>=[^"]*"', "`"uipath==$env:UIPATH_VERSION`""
7067
68+
if ($content -notmatch '\[tool\.uv\.sources\]') {
69+
$content = $content.TrimEnd() + "`n`n[tool.uv.sources]`nuipath = { index = `"testpypi`" }`n"
70+
} elseif ($content -notmatch 'uipath\s*=\s*\{\s*index\s*=\s*"testpypi"\s*\}') {
71+
$content = $content -replace '(\[tool\.uv\.sources\])', "`$1`nuipath = { index = `"testpypi`" }"
72+
}
7173
72-
# Add or update [tool.uv.sources] section if it doesn't exist
73-
if ! grep -q "\[tool\.uv\.sources\]" pyproject.toml; then
74-
echo "" >> pyproject.toml
75-
echo "[tool.uv.sources]" >> pyproject.toml
76-
echo 'uipath = { index = "testpypi" }' >> pyproject.toml
77-
else
78-
# Update existing sources if needed
79-
if ! grep -q 'uipath = { index = "testpypi" }' pyproject.toml; then
80-
sed -i '/\[tool\.uv\.sources\]/a uipath = { index = "testpypi" }' pyproject.toml
81-
fi
82-
fi
74+
Set-Content -Path pyproject.toml -Value $content -NoNewline
8375
84-
echo "Modified pyproject.toml to use UiPath version ${{ steps.extract-version.outputs.version }} from testpypi"
85-
echo "=== Modified pyproject.toml content ==="
86-
grep -A5 -B5 "uipath\|testpypi" pyproject.toml || true
76+
Write-Output "Modified pyproject.toml to use UiPath version $env:UIPATH_VERSION from testpypi"
77+
Write-Output "=== Modified pyproject.toml content ==="
78+
Get-Content pyproject.toml
8779
8880
- name: Install dependencies with specific UiPath version
8981
run: uv sync --all-extras
@@ -97,6 +89,5 @@ jobs:
9789

9890
- name: Restore original pyproject.toml
9991
if: always()
100-
shell: bash
101-
run: |
102-
mv pyproject.toml.backup pyproject.toml
92+
shell: pwsh
93+
run: Move-Item -Force pyproject.toml.backup pyproject.toml

0 commit comments

Comments
 (0)