diff --git a/eng/ci/library-release.yml b/eng/ci/library-release.yml index 28d0214..4da21f4 100644 --- a/eng/ci/library-release.yml +++ b/eng/ci/library-release.yml @@ -24,6 +24,13 @@ resources: type: git name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release + - repository: eng + type: git + name: engineering + ref: refs/tags/release + +variables: + - group: azure-functions-python-release extends: template: v1/1ES.Official.PipelineTemplate.yml@1es @@ -87,7 +94,6 @@ extends: releaseBranchPrefix: 'release' pythonVersionRequirement: '>=3.10,<3.13' tagPrefix: '' - blobPath: 'azure-functions/python/azure-functions' artifactName: 'azure-functions' - stage: ReleaseV2_BumpVersion @@ -138,5 +144,4 @@ extends: releaseBranchPrefix: 'release' pythonVersionRequirement: '>=3.13' tagPrefix: '' - blobPath: 'azure-functions/python/azure-functions' artifactName: 'azure-functions' \ 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 178ca04..aae04ec 100644 --- a/eng/templates/official/release/publish-release.yml +++ b/eng/templates/official/release/publish-release.yml @@ -16,10 +16,6 @@ parameters: type: string default: '' displayName: 'Optional prefix for git tags' - - name: blobPath - type: string - default: 'azure-functions/python/azure-functions' - displayName: 'Blob path under drops container' - name: githubOrg type: string default: 'Azure' @@ -32,10 +28,15 @@ parameters: type: string default: 'azure-functions' 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" @@ -272,97 +273,16 @@ jobs: 2. Merge the PR into the worker dev branch when ready. 3. If automatic PR creation failed, review the TestWithWorker logs and create or update the PR manually, or explicitly approve continuing the release with worker testing deferred. - - job: PublishRelease - dependsOn: ['WaitForPythonWorkerPR'] - 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/" - - Get-ChildItem -Path $distFolder -Recurse | ForEach-Object { - Write-Host " - $($_.Name)" - } - - 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)" \ No newline at end of file + - template: /ci/release-pypi-package.yml@eng + parameters: + artifact: + name: ${{ parameters.artifactName }} + packagePath: '' + packageName: azure-functions + packageVersion: ${{ parameters.libraryVersion }} + owners: ${{ parameters.esrpOwners }} + approvers: ${{ parameters.esrpApprovers }} + manualApprovers: ${{ parameters.esrpManualApprovers }} + publishToPyPI: true + dependsOn: + - WaitForPythonWorkerPR \ No newline at end of file