mirror of
https://github.com/microsoft/edit.git
synced 2026-02-06 06:13:36 -06:00
With the latest winget-create release, the preferred method for providing the GitHub token in CI/CD environment is via the environment variable `WINGET_CREATE_GITHUB_TOKEN`. Removed use of `--token` and switched to environment variable. See https://aka.ms/winget-create-token for details.
36 lines
1.4 KiB
YAML
36 lines
1.4 KiB
YAML
name: Submit release to the WinGet community repository
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
publish-winget:
|
|
name: Submit to WinGet repository
|
|
|
|
# winget-create is only supported on Windows
|
|
runs-on: windows-latest
|
|
|
|
# winget-create will read the following environment variable to access the GitHub token needed for submitting a PR
|
|
# See https://aka.ms/winget-create-token
|
|
env:
|
|
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }}
|
|
|
|
# Only submit stable releases
|
|
if: ${{ !github.event.release.prerelease }}
|
|
steps:
|
|
- name: Submit package using wingetcreate
|
|
run: |
|
|
# Get installer info from release event
|
|
$assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json
|
|
$x64InstallerUrl = $assets | Where-Object -Property name -like '*x86_64-windows.zip' | Select-Object -ExpandProperty browser_download_url
|
|
$arm64InstallerUrl = $assets | Where-Object -Property name -like '*aarch64-windows.zip' | Select-Object -ExpandProperty browser_download_url
|
|
$packageVersion = (${{ toJSON(github.event.release.tag_name) }}).Trim('v')
|
|
|
|
# Update package using wingetcreate
|
|
curl.exe -JLO https://aka.ms/wingetcreate/latest
|
|
.\wingetcreate.exe update Microsoft.Edit `
|
|
--version $packageVersion `
|
|
--urls $x64InstallerUrl $arm64InstallerUrl `
|
|
--submit
|