fix(ci): fix winget installer workflow (#5569)

* fix(ci): add GH_TOKEN env

* chore: fix windows installer build filename

Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
Muhammad Atif Ali
2023-01-05 04:56:00 +00:00
committed by GitHub
co-authored by Dean Sheather
parent 04d45f3c1c
commit 0124289f1a
+16 -5
View File
@@ -15,13 +15,11 @@ jobs:
run: |
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
# the package version is the same as the release tag without the leading
# "v", and with a trailing ".0" (e.g. "v1.2.3" -> "1.2.3.0")
# 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", ""
$version += ".0"
echo "::set-output name=version::$version"
- name: Submit updated manifest to winget-pkgs
@@ -35,12 +33,25 @@ jobs:
echo "Installer URL: $installer_url"
# 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 "${{ steps.version.outputs.version }}" `
--urls "$installer_url" `
--urls "${installer_url}|X64" `
--token "${{ secrets.CDRCI_GITHUB_TOKEN }}"
env:
# For gh CLI:
GH_TOKEN: ${{ github.token }}
- name: Comment on PR
run: |
# find the PR that wingetcreate just made
@@ -48,4 +59,4 @@ jobs:
ConvertFrom-Json`
$pr_number = $pr_list[0].number
gh pr comment --repo microsoft/winget-pkgs "$pr_number" --body "🤖 cc: @deansheather"
gh pr comment --repo microsoft/winget-pkgs "$pr_number" --body "🤖 cc: @deansheather @matifali"