From 2d82b7375733082c41530a728cbd5f6fde2ae04e Mon Sep 17 00:00:00 2001 From: Sathvik Kumar Date: Wed, 29 Apr 2026 10:57:01 +1000 Subject: [PATCH 1/2] Use package version for Winget publish The winget step previously derived the published version from Octopus.Release.Number. This breaks if the Octopus release name diverges from the package version (e.g. a 2.21.0-hotfix1 release containing octopus-cli@2.21.0). Source the version from the cli package metadata instead, so the published winget version always matches what's in the package being deployed. Adds a non-extracting cli package reference to the winget step to make PackageVersion available without unzipping the 66 MB package. --- .octopus/deployment_process.ocl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.octopus/deployment_process.ocl b/.octopus/deployment_process.ocl index f65fd4d3..d6f4555c 100644 --- a/.octopus/deployment_process.ocl +++ b/.octopus/deployment_process.ocl @@ -242,7 +242,7 @@ step "publish-winget-update-pr" { # Install winget-create Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - $version = $OctopusParameters["Octopus.Release.Number"] + $version = $OctopusParameters["Octopus.Action.Package[cli].PackageVersion"] $packageUrls = "https://github.com/OctopusDeploy/cli/releases/download/v$version/octopus_$($version)_windows_amd64.msi|x64" @@ -268,5 +268,15 @@ step "publish-winget-update-pr" { feed = "docker-hub" image = "octopusdeploy/worker-tools:6.4-windows.ltsc2022" } + + packages "cli" { + acquisition_location = "Server" + feed = "octopus-server-built-in" + package_id = "octopus-cli" + properties = { + Extract = "False" + SelectionMode = "immediate" + } + } } -} \ No newline at end of file +} From b477c6ccb1b4529a101411a83eb30ab554d3c256 Mon Sep 17 00:00:00 2001 From: Sathvik Kumar Date: Wed, 29 Apr 2026 11:00:11 +1000 Subject: [PATCH 2/2] Fix package reference --- .octopus/deployment_process.ocl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.octopus/deployment_process.ocl b/.octopus/deployment_process.ocl index d6f4555c..7c39ccbe 100644 --- a/.octopus/deployment_process.ocl +++ b/.octopus/deployment_process.ocl @@ -270,7 +270,7 @@ step "publish-winget-update-pr" { } packages "cli" { - acquisition_location = "Server" + acquisition_location = "NotAcquired" feed = "octopus-server-built-in" package_id = "octopus-cli" properties = { @@ -279,4 +279,4 @@ step "publish-winget-update-pr" { } } } -} +} \ No newline at end of file