Skip to content

Commit 046f3a5

Browse files
committed
fix worker PR step
1 parent c503bc7 commit 046f3a5

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

eng/templates/official/jobs/publish-release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ jobs:
153153
$githubUser = "$(GithubUser)"
154154
$githubToken = "$(GithubPat)"
155155
$newLibraryVersion = "${{ parameters.libraryVersion }}"
156+
$pythonVersionRequirement = "${{ parameters.pythonVersionRequirement }}"
156157
$newBranch = "sdk/$newLibraryVersion"
157158
158159
if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
@@ -169,9 +170,18 @@ jobs:
169170
Set-Location "azure-functions-python-worker"
170171
git checkout -b $newBranch "origin/dev"
171172
172-
# Modify SDK Version in pyproject.toml
173-
Write-Host "Replacing SDK version in worker's pyproject.toml"
174-
((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.10''"','"azure-functions==${{ parameters.libraryVersion }}; python_version >= ''3.10''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml
173+
# Modify SDK Version in pyproject.toml based on Python version requirement
174+
Write-Host "Replacing SDK version in worker's pyproject.toml for Python requirement: $pythonVersionRequirement"
175+
176+
if ($pythonVersionRequirement -match '>=3\.13') {
177+
# Update version for Python 3.13+
178+
Write-Host "Updating azure-functions version for Python 3.13+"
179+
((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.13''"','"azure-functions==$newLibraryVersion; python_version >= ''3.13''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml
180+
} else {
181+
# Update version for Python 3.10-3.12
182+
Write-Host "Updating azure-functions version for Python 3.10-3.12"
183+
((Get-Content workers/pyproject.toml) -replace '"azure-functions==[\d\.a-z]+; python_version >= ''3\.10'' and python_version < ''3\.13''"','"azure-functions==$newLibraryVersion; python_version >= ''3.10'' and python_version < ''3.13''"' -join "`n") + "`n" | Set-Content -NoNewline workers/pyproject.toml
184+
}
175185
176186
# Commit Python Version
177187
Write-Host "Pushing $newBranch to azure-functions-python-worker repo"

0 commit comments

Comments
 (0)