File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : " release-winget"
2+ on :
3+ release :
4+ types : [released]
5+
6+ workflow_dispatch :
7+ inputs :
8+ release :
9+ description : ' Release Id'
10+ required : true
11+ default : ' latest'
12+
13+ jobs :
14+ release :
15+ runs-on : windows-latest
16+ steps :
17+ - name : Publish manifest with winget-create
18+ run : |
19+ # Get correct release asset
20+ $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
21+ $asset = $github.release.assets | Where-Object -Property name -match '64-bit.exe$'
22+
23+ # Remove 'v' and 'vfs' from the version
24+ $github.release.tag_name -match '\d.*'
25+ $version = $Matches[0] -replace ".vfs",""
26+
27+ # Download wingetcreate and create manifests
28+ Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
29+ .\wingetcreate.exe update Microsoft.Git -u $asset.browser_download_url -v $version -o manifests
30+
31+ # Manually substitute the name of the default branch in the License
32+ # and Copyright URLs since the tooling cannot do that for us.
33+ $shortenedVersion = $version -replace ".{4}$"
34+ $manifestPath = dir -Path ./manifests -Filter Microsoft.Git.locale.en-US.yaml -Recurse | %{$_.FullName}
35+ sed -i "s/vfs-[.0-9]*/vfs-$shortenedVersion/g" "$manifestPath"
36+
37+ # Submit manifests
38+ $manifestDirectory = Split-Path "$manifestPath"
39+ .\wingetcreate.exe submit -t "${{ secrets.WINGET_TOKEN }}" $manifestDirectory
40+ shell : powershell
You can’t perform that action at this time.
0 commit comments