From 483e9132dca68cd14197d9aaad639fa1cb577fff Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Wed, 26 Mar 2025 11:06:51 +0000 Subject: [PATCH 1/2] release-winget.yml: drop redundant replacement logic We now use the licence URLs pointing at HEAD rather than a specific branch version. This change was made during the 2.47.0.vfs.0.3 release by this PR: https://github.com/microsoft/winget-pkgs/pull/185867 The manual text replacements here are no longer needed. Signed-off-by: Matthew John Cheetham --- .github/workflows/release-winget.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml index a7dc62fe23b2b1..098281145d9c7c 100644 --- a/.github/workflows/release-winget.yml +++ b/.github/workflows/release-winget.yml @@ -71,12 +71,6 @@ jobs: "$($asset_arm64_url)|arm64|machine" ` "$($asset_arm64_url)|arm64|user" - # Manually substitute the name of the default branch in the License - # and Copyright URLs since the tooling cannot do that for us. - $shortenedVersion = $version -replace ".{4}$" - $manifestPath = dir -Path ./manifests -Filter Microsoft.Git.locale.en-US.yaml -Recurse | %{$_.FullName} - sed -i "s/vfs-[.0-9]*/vfs-$shortenedVersion/g" "$manifestPath" - # Download the token from Azure Key Vault and mask it in the logs az keyvault secret download --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --file token.txt Write-Host -NoNewLine "::add-mask::$(Get-Content token.txt)" From 340443dbf64cfcfcecdc7e3e9033a6e478325617 Mon Sep 17 00:00:00 2001 From: Matthew John Cheetham Date: Wed, 26 Mar 2025 11:18:38 +0000 Subject: [PATCH 2/2] release-winget.yml: fix tag name on releases When running this workflow from the `release` event the parsing of the tag name from the event object must happen _after_ the object has been loaded, not before! This error eventually results in a bogus value for the `$version` argument that gets passed to `wingetcreate`. Ensure we only access the `$github` variable _after_ we've defined it. Signed-off-by: Matthew John Cheetham --- .github/workflows/release-winget.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-winget.yml b/.github/workflows/release-winget.yml index 098281145d9c7c..5996e1c873ffbe 100644 --- a/.github/workflows/release-winget.yml +++ b/.github/workflows/release-winget.yml @@ -35,11 +35,12 @@ jobs: $PSNativeCommandErrorActionPreference = "Stop" if ($env:TAG_NAME -eq "") { - $env:TAG_NAME = $github.release.tag_name - # Get latest release $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json + # Set the tag name environment variable + $env:TAG_NAME = $github.release.tag_name + # Get download URLs $asset_x64 = $github.release.assets | Where-Object -Property name -match '64-bit.exe$' $asset_arm64 = $github.release.assets | Where-Object -Property name -match 'arm64.exe$'