forked from extern/nushell
Add worflow to publish package in winget (#3819)
Remove the job in release workflow to publish to winget. Trigger winget workflow on published release. Co-authored-by: Alexandre Nedelec <Alexandre.Nedelec@azeo.com>
This commit is contained in:
parent
9b5db297a6
commit
1f4ef3b606
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
@ -162,8 +162,6 @@ jobs:
|
|||||||
- linux
|
- linux
|
||||||
- macos
|
- macos
|
||||||
- windows
|
- windows
|
||||||
outputs:
|
|
||||||
version: ${{ steps.info.outputs.version }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -285,19 +283,4 @@ jobs:
|
|||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ./nushell-windows.msi
|
asset_path: ./nushell-windows.msi
|
||||||
asset_name: ${{ steps.info.outputs.windowsdir }}.msi
|
asset_name: ${{ steps.info.outputs.windowsdir }}.msi
|
||||||
asset_content_type: applictaion/x-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 }}
|
|
||||||
|
|
||||||
|
|
18
.github/workflows/winget-submission.yml
vendored
Normal file
18
.github/workflows/winget-submission.yml
vendored
Normal file
@ -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 }}
|
Loading…
Reference in New Issue
Block a user