diff --git a/eng/ci/worker-release.yml b/eng/ci/worker-release.yml index 5ebcb0ea..74468d81 100644 --- a/eng/ci/worker-release.yml +++ b/eng/ci/worker-release.yml @@ -31,6 +31,8 @@ resources: variables: - template: /eng/templates/utils/byoc-variables.yml@self + - ${{ if or(eq(parameters.V1LibraryRelease, true), eq(parameters.V2LibraryRelease, true)) }}: + - group: azure-functions-python-release - name: codeql.excludePathPatterns value: deps/,build/ # Maps the single ReleaseVersion parameter to the worker release, which @@ -88,7 +90,6 @@ extends: projectDisplayName: 'Azure Functions Runtime V2' releaseBranchPrefix: 'release-v2' tagPrefix: 'runtimes/v2-' - blobPath: 'azure-functions/python/azure-functions-runtime' artifactName: 'azure-functions-runtime' - stage: ReleasePythonV1Library_BumpVersion dependsOn: [] @@ -126,5 +127,4 @@ extends: projectDisplayName: 'Azure Functions Runtime V1' releaseBranchPrefix: 'release-v1' tagPrefix: 'runtimes/v1-' - blobPath: 'azure-functions/python/azure-functions-runtime-v1' artifactName: 'azure-functions-runtime-v1' \ No newline at end of file diff --git a/eng/templates/official/release/publish-release.yml b/eng/templates/official/release/publish-release.yml index 6e1bce22..56419983 100644 --- a/eng/templates/official/release/publish-release.yml +++ b/eng/templates/official/release/publish-release.yml @@ -13,10 +13,6 @@ parameters: type: string default: '' displayName: 'Optional prefix for git tags (e.g., runtimes/v2-)' - - name: blobPath - type: string - default: 'azure-functions/python/azure-functions-runtime' - displayName: 'Blob path under drops container' - name: githubOrg type: string default: 'Azure' @@ -29,10 +25,15 @@ parameters: type: string default: 'azure-functions-runtime' displayName: 'Pipeline artifact name produced by the Build stage' - - name: partnerReleasePipelineUrl + - name: esrpOwners + type: string + default: '$(EsrpOwners)' + - name: esrpApprovers + type: string + default: '$(EsrpApprovers)' + - name: esrpManualApprovers type: string - default: 'https://dev.azure.com/azure-sdk/internal/_build?definitionId=6991' - displayName: 'Azure SDK partner-release pipeline URL (used in manual PyPI publish instructions)' + default: '$(EsrpManualApprovers)' jobs: - job: "CreateReleaseTag" @@ -180,99 +181,16 @@ jobs: notifyUsers: '' instructions: 'Please head to https://github.com/${{ parameters.githubOrg }}/${{ parameters.githubRepo }}/releases to finish the release note' - - job: PublishRelease - dependsOn: ['CheckGitHubRelease'] - displayName: 'Upload artifacts to partner blob for release' - - pool: - name: 1es-pool-azfunc - image: 1es-ubuntu-22.04 - os: linux - - steps: - - checkout: none - - - download: current - artifact: ${{ parameters.artifactName }} - displayName: 'Download build artifacts' - - - task: AzurePowerShell@5 - displayName: 'Upload files to partner drop folder' - inputs: - azureSubscription: 'azure-sdk-partner-drops' - ScriptType: 'InlineScript' - azurePowerShellVersion: LatestVersion - pwsh: true - Inline: | - $version = '${{ parameters.libraryVersion }}' - $blobPath = '${{ parameters.blobPath }}' - $distFolder = '$(Pipeline.Workspace)/${{ parameters.artifactName }}/dist' - - Write-Host "Uploading Python artifacts for version: $version" - Write-Host "Source folder: $distFolder" - Write-Host "Destination: https://azuresdkpartnerdrops.blob.core.windows.net/drops/$blobPath/$version/" - - # List files to be uploaded - Get-ChildItem -Path $distFolder -Recurse | ForEach-Object { - Write-Host " - $($_.Name)" - } - - # Upload all distribution files (whl and tar.gz) to partner blob - azcopy copy "$distFolder/*" "https://azuresdkpartnerdrops.blob.core.windows.net/drops/$blobPath/$version/" - - $blobPathFull = "$blobPath/$version" - $partnerReleaseUrl = '${{ parameters.partnerReleasePipelineUrl }}' - - Write-Host "" - Write-Host "##[section]Upload complete. The partner-release pipeline will be triggered automatically in the next job." - Write-Host " BlobPath: $blobPathFull" - Write-Host " Partner pipeline: $partnerReleaseUrl" - env: - AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED' - - - job: "TriggerPartnerRelease" - dependsOn: ['PublishRelease'] - displayName: 'Trigger partner-release pipeline' - - pool: - name: 1es-pool-azfunc - image: 1es-ubuntu-22.04 - os: linux - - steps: - - checkout: none - - - pwsh: | - Write-Host "Target folder: ${{ parameters.blobPath }}/${{ parameters.libraryVersion }}" - Write-Host "Storage container: https://ms.portal.azure.com/#blade/Microsoft_Azure_Storage/ContainerMenuBlade/overview/storageAccountId/%2Fsubscriptions%2Fa18897a6-7e44-457d-9260-f2854c0aca42%2FresourceGroups%2Fazuresdkpartnerdrops%2Fproviders%2FMicrosoft.Storage%2FstorageAccounts%2Fazuresdkpartnerdrops/path/drops" - Write-Host "Partner pipeline: ${{ parameters.partnerReleasePipelineUrl }}" - displayName: 'Log partner pipeline information' - - - task: AzureCLI@2 - displayName: 'Run partner pipeline for PyPI publish' - inputs: - azureSubscription: 'azure-sdk-partner-drops' - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - $ErrorActionPreference = "Stop" - $blobPath = "${{ parameters.blobPath }}/${{ parameters.libraryVersion }}" - Write-Host "Running partner pipeline for blob path: $blobPath" - - $result = az pipelines run ` - --project internal ` - --organization https://dev.azure.com/azure-sdk ` - --id 6991 ` - --branch refs/heads/main ` - --parameters "BlobPath=$blobPath" - - if (!$result) { - Write-Host "##vso[task.LogIssue type=error;]Failed to start partner pipeline." - exit 1 - } - - $result = $result | ConvertFrom-Json - Write-Host "##[section]Partner pipeline started successfully." - Write-Host "Build ID: $($result.id)" - Write-Host "Partner pipeline may require manual approval to proceed." - Write-Host "Please check the pipeline at: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=$($result.id)" + - template: /ci/release-pypi-package.yml@eng + parameters: + artifact: + name: ${{ parameters.artifactName }} + packagePath: '' + packageName: ${{ parameters.artifactName }} + packageVersion: ${{ parameters.libraryVersion }} + owners: ${{ parameters.esrpOwners }} + approvers: ${{ parameters.esrpApprovers }} + manualApprovers: ${{ parameters.esrpManualApprovers }} + publishToPyPI: true + dependsOn: + - CheckGitHubRelease