Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions windows-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ Azure DevOps no longer has a per-pipeline option for retention,
and so the only way to permanently retain a build is to manually select the "Retain" option.
Without this, the build records will be lost after 30 days.

## Retrying a partial NuGet publish

If a publish fails after uploading some packages, use the existing artifacts to
publish the remainder:

1. Select **Run new** from the original build.
2. Enable **Publish release** and **Produce Nuget packages**. Disable
**Produce PyManager package** and **Produce EXE/MSI installer**.
3. Set **Republish a build (select in Resources)** to `build_to_publish`, and
leave **Repackage and publish a build (select in Resources)** set to `current`.
4. Set **NuGet packages to skip on retry** to filenames or patterns matching only
packages confirmed to have been uploaded. Separate multiple entries with
semicolons, for example
`python-freethreaded.3.16.0-a1.nupkg;pythonx86-freethreaded.3.16.0-a1.nupkg`.
Leave `(none)` for an initial publish.
5. Under **Next: Resources**, select the original run under
**Windows-Release [build_to_publish]**, then select **Run**.

## Finding/updating certificates

For code signing, we use [Azure Trusted Signing](https://learn.microsoft.com/en-us/azure/trusted-signing/overview).
Expand Down
5 changes: 5 additions & 0 deletions windows-release/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ parameters:
displayName: "Produce Nuget packages"
type: boolean
default: true
- name: SkipNugetPackages
displayName: "NuGet packages to skip on retry (semicolon-separated)"
type: string
default: '(none)'
- name: DoEmbed
displayName: "Produce embeddable package (w/ PyManager or MSI options)"
type: boolean
Expand Down Expand Up @@ -364,3 +368,4 @@ stages:
- template: stage-publish-nugetorg.yml
parameters:
BuildToPublish: ${{ parameters.BuildToPublish }}
SkipNugetPackages: ${{ parameters.SkipNugetPackages }}
20 changes: 20 additions & 0 deletions windows-release/stage-publish-nugetorg.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
BuildToPublish: current
SkipNugetPackages: '(none)'

jobs:
- job: Publish_Nuget
Expand Down Expand Up @@ -31,6 +32,24 @@ jobs:
workingDirectory: '$(Build.BinariesDirectory)\nuget'
condition: and(succeeded(), ne(variables['PublishARM64'], 'true'))

- ${{ if ne(parameters.SkipNugetPackages, '(none)') }}:
- powershell: |
$patterns = ($env:SKIP_NUGET_PACKAGES -split ';').Trim() |
Where-Object { $_ }
if (-not $patterns) {
throw 'No NuGet package patterns were provided'
}
Get-ChildItem -Path $patterns -File -ErrorAction Stop |
Sort-Object -Property FullName -Unique |
ForEach-Object {
Write-Host "Not publishing: $($_.Name)"
Remove-Item -LiteralPath $_.FullName
}
displayName: 'Skip already published NuGet packages'
workingDirectory: '$(Build.BinariesDirectory)\nuget'
env:
SKIP_NUGET_PACKAGES: ${{ parameters.SkipNugetPackages }}

- task: NuGetCommand@2
displayName: Push packages
condition: and(succeeded(), eq(variables['IsRealSigned'], 'true'))
Expand All @@ -39,3 +58,4 @@ jobs:
packagesToPush: '$(Build.BinariesDirectory)\nuget\*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'Python on Nuget'
requestTimeout: 600
Loading