From f0b4badf74ef4c83e4df401445b41c71e75f19f9 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 5 Dec 2023 17:06:39 +0300 Subject: [PATCH] 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](https://github.com/microsoft/winget-pkgs/pull/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: https://github.com/microsoft/winget-create/pull/445 2. This has been available since version https://github.com/microsoft/winget-create/releases/tag/v1.5.3.0 * fixup! * Update release.yaml --- .github/workflows/release.yaml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e740516ad4..f4b4c37ede 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -434,27 +434,26 @@ jobs: $release_assets = gh release view --repo coder/coder "v${version}" --json assets | ` ConvertFrom-Json - # Get the installer URL from the release assets. - $installer_url = $release_assets.assets | ` + # Get the installer URLs from the release assets. + $amd64_installer_url = $release_assets.assets | ` Where-Object name -Match ".*_windows_amd64_installer.exe$" | ` Select -ExpandProperty url + $amd64_zip_url = $release_assets.assets | ` + Where-Object name -Match ".*_windows_amd64.zip$" | ` + Select -ExpandProperty url + $arm64_zip_url = $release_assets.assets | ` + Where-Object name -Match ".*_windows_arm64.zip$" | ` + Select -ExpandProperty url - echo "Installer URL: ${installer_url}" + echo "amd64 Installer URL: ${amd64_installer_url}" + echo "amd64 zip URL: ${amd64_zip_url}" + echo "arm64 zip URL: ${arm64_zip_url}" echo "Package version: ${version}" - # The URL "|X64" suffix forces the architecture as it cannot be - # sniffed properly from the URL. wingetcreate checks both the URL and - # binary magic bytes for the architecture and they need to both match, - # but they only check for `x64`, `win64` and `_64` in the URL. Our URL - # contains `amd64` which doesn't match sadly. - # - # wingetcreate will still do the binary magic bytes check, so if we - # accidentally change the architecture of the installer, it will fail - # submission. .\wingetcreate.exe update Coder.Coder ` --submit ` --version "${version}" ` - --urls "${installer_url}|X64" ` + --urls "${amd64_installer_url}" "${amd64_zip_url}" "${arm64_zip_url}" ` --token "$env:WINGET_GH_TOKEN" env: