Skip to content

winget-release: fix workflow version parsing #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged
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
11 changes: 3 additions & 8 deletions .github/workflows/release-winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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$'
Expand Down Expand Up @@ -71,12 +72,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)"
Expand Down
Loading