ci(release-winget): publish nightly winget prerelease #20209

This commit is contained in:
Vedant 2022-09-17 04:03:06 +05:30 committed by GitHub
parent 6cc03b9c90
commit c126c1f73a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,14 +229,31 @@ jobs:
fi
publish-winget:
needs: publish # run after publish job is finished
# publish to winget only on stable releases
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
runs-on: windows-latest # action can only be run on windows
steps:
- uses: vedantmgoyal2009/winget-releaser@latest
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
name: Publish stable
uses: vedantmgoyal2009/winget-releaser@latest
with:
identifier: Neovim.Neovim
# the latter one is a fallback value, reference:
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
release-tag: ${{ github.event.inputs.tag_name || github.ref }}
token: ${{ secrets.WINGET_TOKEN }}
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Get nightly version
id: get-version
run: |
Invoke-WebRequest https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.msi -OutFile setup.msi
Install-Module -Name 'Carbon' -AllowClobber -Force
Import-Module Carbon
$VERSION = (Get-CMsi .\setup.msi).ProductVersion
echo "::set-output name=version::$VERSION"
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
name: Publish nightly
uses: vedantmgoyal2009/winget-releaser@latest
with:
identifier: Neovim.Neovim.Nightly
version: ${{ steps.get-version.outputs.version }}
release-tag: nightly
token: ${{ secrets.WINGET_TOKEN }}