From 66e52b7cfca28ecbb3499f3966772cf042455429 Mon Sep 17 00:00:00 2001 From: sitiom Date: Wed, 22 Feb 2023 20:54:15 +0800 Subject: [PATCH] use winget releaser action for manifest submission (#8070) # Description Other than simplifying the CI, [Winget Releaser](https://github.com/vedantmgoyal2009/winget-releaser) includes more metadata in the manifest as it uses [Komac](https://github.com/russellbanks/Komac). I recommend installing [Pull](https://github.com/apps/pull) on https://github.com/fdncred/winget-pkgs to automatically keep it up to date. If you want to see an example of a PR created using this action, see [microsoft/winget-pkgs/pulls (Pull request has been created with WinGet Releaser)](https://github.com/microsoft/winget-pkgs/pulls?q=is%3Apr+sort%3Aupdated-desc+Pull+request+has+been+created+with+WinGet+Releaser). > Migrate from [winget-pkgs-automation manifest](https://github.com/vedantmgoyal2009/vedantmgoyal2009/blob/main/winget-pkgs-automation/packages/n/nushell.nushell.json) --- .github/workflows/winget-submission.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml index 7fabe7070c..7cd854b6f9 100644 --- a/.github/workflows/winget-submission.yml +++ b/.github/workflows/winget-submission.yml @@ -1,9 +1,14 @@ name: Submit Nushell package to Windows Package Manager Community Repository on: - workflow_dispatch: release: - types: [published] + types: [released] + workflow_dispatch: + inputs: + tag_name: + description: 'Specific tag name' + required: true + type: string jobs: @@ -12,8 +17,10 @@ jobs: runs-on: windows-latest steps: - name: Submit package to Windows Package Manager Community Repository - run: | - iwr https://github.com/microsoft/winget-create/releases/download/v1.0.4.0/wingetcreate.exe -OutFile wingetcreate.exe - $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json - $installerUrl = $github.release.assets | Where-Object -Property name -match 'windows-msvc.msi' | Select -ExpandProperty browser_download_url -First 1 - .\wingetcreate.exe update Nushell.Nushell -s -v $github.release.tag_name -u $installerUrl -t ${{ secrets.NUSHELL_PAT }} + uses: vedantmgoyal2009/winget-releaser@v2 + with: + identifier: Nushell.Nushell + version: ${{ inputs.tag_name || github.event.release.tag_name }} + release-tag: ${{ inputs.tag_name || github.event.release.tag_name }} + token: ${{ secrets.NUSHELL_PAT }} + fork-user: fdncred