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