From 0b60c28cb54d378a7ee3923024a20c9667f52e4c Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Mon, 29 Aug 2022 17:51:21 +0300 Subject: [PATCH 1/3] Create winget-submission.yml packageFileName: coder_${VERSION}_windows_amd64.zip # Need to get VERSION from latest release to use here packageId: MyPackageIdInWinget # Need to ge an official Winget Package ID ecrets.Project_PAT # generate a PAT with the scope public_repo and add it to the secrets of your project with the name Project_PAT --- .github/workflows/winget-submission.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/winget-submission.yml diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml new file mode 100644 index 0000000000000..829dfcb392750 --- /dev/null +++ b/.github/workflows/winget-submission.yml @@ -0,0 +1,22 @@ +name: Submit package to Windows Package Manager Community Repository + +on: + release: + types: [published] + +env: + packageFileName: coder_${VERSION}_windows_amd64.zip # Need to get VERSION from latest release to use here + packageId: MyPackageIdInWinget # Need to ge an official Winget Package ID + +jobs: + + winget: + name: Publish winget package + runs-on: windows-latest + steps: + - name: Submit package to Windows Package Manager Community Repository + run: | + iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json + $installerUrl = $github.release.assets | Where-Object -Property name -match ${env:packageFileName} | Select -ExpandProperty browser_download_url -First 1 + .\wingetcreate.exe update ${env:packageId} -s -v $github.release.tag_name -u $installerUrl -t ${{ secrets.Project_PAT }} From 2f31ba45927135a371208e3290320d02cf74d28c Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 7 Sep 2022 17:36:35 +0300 Subject: [PATCH 2/3] added version from laest tag --- .github/workflows/winget-submission.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml index 829dfcb392750..1f0a90f88207a 100644 --- a/.github/workflows/winget-submission.yml +++ b/.github/workflows/winget-submission.yml @@ -5,7 +5,8 @@ on: types: [published] env: - packageFileName: coder_${VERSION}_windows_amd64.zip # Need to get VERSION from latest release to use here + version: "$(git describe --tags --abbrev=0)" + packageFileName: coder_${version}_windows_amd64.zip packageId: MyPackageIdInWinget # Need to ge an official Winget Package ID jobs: From 68e9437cfb9f5eb3b1c6ed60af7379e5fc598bc8 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 20 Sep 2022 11:56:01 +0300 Subject: [PATCH 3/3] Added winget package id --- .github/workflows/winget-submission.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml index 1f0a90f88207a..9ac048c9d0642 100644 --- a/.github/workflows/winget-submission.yml +++ b/.github/workflows/winget-submission.yml @@ -7,7 +7,7 @@ on: env: version: "$(git describe --tags --abbrev=0)" packageFileName: coder_${version}_windows_amd64.zip - packageId: MyPackageIdInWinget # Need to ge an official Winget Package ID + packageId: Coder.Coder # Most probably the id of coder package jobs: