From d5129cdf656802a1633c74213594f5d530ec1bef Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 9 Jan 2023 21:42:57 +0300 Subject: [PATCH 1/2] fix(ci): fix winget package submission I removed the step to calculate the version, as somehow the $version was not populated with the version. Also, GitHub actions suggest removing `:set-output:` as it is deprecated. This commit should probably fix the winget package submission using `wingetcreate` cli. --- .github/workflows/packages.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml index 1d34e6da50bf1..352163bcdb8ff 100644 --- a/.github/workflows/packages.yaml +++ b/.github/workflows/packages.yaml @@ -15,13 +15,6 @@ jobs: run: | Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - # The package version is the same as the tag minus the leading "v". - - name: Calculate package version - id: version - run: | - $version = $env:CODER_VERSION -replace "^v", "" - echo "::set-output name=version::$version" - - name: Submit updated manifest to winget-pkgs run: | $release_assets = gh release view --repo coder/coder "$env:CODER_VERSION" --json assets | ` @@ -33,6 +26,11 @@ jobs: echo "Installer URL: $installer_url" + # The package version is the same as the tag minus the leading "v". + $version = $env:CODER_VERSION -replace "^v", "" + + echo "Package vesion: $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, @@ -44,7 +42,7 @@ jobs: # submission. .\wingetcreate.exe update Coder.Coder ` --submit ` - --version "${{ steps.version.outputs.version }}" ` + --version "${version}" ` --urls "${installer_url}|X64" ` --token "${{ secrets.CDRCI_GITHUB_TOKEN }}" From 6b1d0a260ba399394cdd02db96f1c53f803b8d4a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 9 Jan 2023 22:31:52 +0300 Subject: [PATCH 2/2] fixed a typo --- .github/workflows/packages.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml index 352163bcdb8ff..1f4cc8a88ed7f 100644 --- a/.github/workflows/packages.yaml +++ b/.github/workflows/packages.yaml @@ -19,7 +19,7 @@ jobs: run: | $release_assets = gh release view --repo coder/coder "$env:CODER_VERSION" --json assets | ` ConvertFrom-Json - + # Get the installer URL from the release assets. $installer_url = $release_assets.assets | ` Where-Object name -Match ".*_windows_amd64_installer.exe$" | ` Select -ExpandProperty url @@ -28,8 +28,8 @@ jobs: # The package version is the same as the tag minus the leading "v". $version = $env:CODER_VERSION -replace "^v", "" - - echo "Package vesion: $version" + + 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