diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8e85bff1..955812fde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -162,8 +162,6 @@ jobs: - linux - macos - windows - outputs: - version: ${{ steps.info.outputs.version }} steps: - name: Check out code uses: actions/checkout@v2 @@ -285,19 +283,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./nushell-windows.msi asset_name: ${{ steps.info.outputs.windowsdir }}.msi - asset_content_type: applictaion/x-msi - - winget: - name: Publish winget package - runs-on: windows-latest - needs: release - steps: - - name: Submit package to Windows Package Manager Community Repository - run: | - iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - $nushellVersion="${{ needs.release.outputs.version }}" - $nushellInstallerName="nu_$($nushellVersion -replace '\.','_')_windows.msi" - $installerUrl = "https://github.com/nushell/nushell/releases/download/$nushellVersion/$nushellInstallerName" - .\wingetcreate.exe update Nushell.Nushell -s -v $nushellVersion -u $installerUrl -t ${{ secrets.NUSHELL_PAT }} - - + asset_content_type: applictaion/x-msi \ No newline at end of file diff --git a/.github/workflows/winget-submission.yml b/.github/workflows/winget-submission.yml new file mode 100644 index 000000000..2b64b1b6e --- /dev/null +++ b/.github/workflows/winget-submission.yml @@ -0,0 +1,18 @@ +name: Submit Nushell package to Windows Package Manager Community Repository + +on: + release: + types: [published] + +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 'windows.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 }}