Skip to content

Commit f0b4bad

Browse files
authored
ci: add arm64 and amd64 portable binaries to winget (#11030)
* ci: add arm64 and amd64 portable binaries to winget This PR updates `release.yaml` workflow to automate updates for `arm64` and `x64` zip installers to winget. This has recently been merged into [winget](microsoft/winget-pkgs#129175). Thanks to @mdanish-kh for the upstream PR. * fixup! * remove extra `--urls` flags * remove architecture override. `wingetcreate` does not need architecture override as it now supports parsing the URL for `amd64` and correctly marking it as x64 architecture. Reference: 1. https://github.com/microsoft/winget-create/blob/08baf0e61e62dabcb2487397984fc69fad6a7499/src/WingetCreateCore/Common/PackageParser.cs#L594C56-L594C61 2. PR: microsoft/winget-create#445 2. This has been available since version https://github.com/microsoft/winget-create/releases/tag/v1.5.3.0 * fixup! * Update release.yaml
1 parent 5fad611 commit f0b4bad

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -434,27 +434,26 @@ jobs:
434434
435435
$release_assets = gh release view --repo coder/coder "v${version}" --json assets | `
436436
ConvertFrom-Json
437-
# Get the installer URL from the release assets.
438-
$installer_url = $release_assets.assets | `
437+
# Get the installer URLs from the release assets.
438+
$amd64_installer_url = $release_assets.assets | `
439439
Where-Object name -Match ".*_windows_amd64_installer.exe$" | `
440440
Select -ExpandProperty url
441+
$amd64_zip_url = $release_assets.assets | `
442+
Where-Object name -Match ".*_windows_amd64.zip$" | `
443+
Select -ExpandProperty url
444+
$arm64_zip_url = $release_assets.assets | `
445+
Where-Object name -Match ".*_windows_arm64.zip$" | `
446+
Select -ExpandProperty url
441447
442-
echo "Installer URL: ${installer_url}"
448+
echo "amd64 Installer URL: ${amd64_installer_url}"
449+
echo "amd64 zip URL: ${amd64_zip_url}"
450+
echo "arm64 zip URL: ${arm64_zip_url}"
443451
echo "Package version: ${version}"
444452
445-
# The URL "|X64" suffix forces the architecture as it cannot be
446-
# sniffed properly from the URL. wingetcreate checks both the URL and
447-
# binary magic bytes for the architecture and they need to both match,
448-
# but they only check for `x64`, `win64` and `_64` in the URL. Our URL
449-
# contains `amd64` which doesn't match sadly.
450-
#
451-
# wingetcreate will still do the binary magic bytes check, so if we
452-
# accidentally change the architecture of the installer, it will fail
453-
# submission.
454453
.\wingetcreate.exe update Coder.Coder `
455454
--submit `
456455
--version "${version}" `
457-
--urls "${installer_url}|X64" `
456+
--urls "${amd64_installer_url}" "${amd64_zip_url}" "${arm64_zip_url}" `
458457
--token "$env:WINGET_GH_TOKEN"
459458
460459
env:

0 commit comments

Comments
 (0)