Intelligent Terminal v0.1.1841 #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to WinGet | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| REGEX: 'Microsoft\.IntelligentTerminal_([\d.]+)_8wekyb3d8bbwe\.msixbundle$' | |
| # 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 | |
| WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_TOKEN }} | |
| jobs: | |
| publish: | |
| runs-on: windows-latest # Action can only run on Windows | |
| if: ${{ !github.event.release.prerelease }} # Only publish stable releases to WinGet | |
| steps: | |
| - name: Publish Intelligent Terminal | |
| run: | | |
| $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json | |
| $regex = [Regex]::New($env:REGEX) | |
| $wingetRelevantAsset = $assets | Where-Object { $regex.IsMatch($_.name) } | Select-Object -First 1 | |
| if (-not $wingetRelevantAsset) { | |
| Write-Error "No release asset matched '$env:REGEX'; nothing to publish to WinGet." | |
| exit 1 | |
| } | |
| $version = $regex.Match($wingetRelevantAsset.name).Groups[1].Value | |
| $wingetPackage = "Microsoft.IntelligentTerminal" | |
| & curl.exe -JLO https://aka.ms/wingetcreate/latest | |
| & .\wingetcreate.exe update $wingetPackage -s -v $version -u $wingetRelevantAsset.browser_download_url |