Skip to content

Commit da70b23

Browse files
committed
First version of workflow publish-winget
1 parent 60adfb2 commit da70b23

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
name: Publish latest release on Windows community repository
3+
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
9+
jobs:
10+
winget:
11+
name: Publish winget package
12+
runs-on: windows-latest
13+
steps:
14+
- name: Submit package to Windows Package Manager Community Repository
15+
run: |
16+
# Download WingetCreate
17+
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
18+
# Retrieve the descriptor of Audiveris latest release
19+
$latest = Invoke-RestMethod 'https://api.github.com/repos/Audiveris/audiveris/releases/latest'
20+
$tag_name = $latest.tag_name
21+
echo "=== tag_name is $tag_name"
22+
# Retrieve all Windows installers among the release assets
23+
$installers = $latest.assets | Where-Object -Property name -match '.msi'
24+
echo "=== installers:"
25+
$installers
26+
# Retrieve the download URL of the (first) Windows installer
27+
$installerUrl = $installers | Select -ExpandProperty browser_download_url -First 1
28+
echo "=== installerUrl is $installerUrl"
29+
# Create a folder
30+
New-Item -Path "." -Name "myDocs" -ItemType Directory
31+
# Create the manifest
32+
.\wingetcreate.exe new $installerUrl --output myDocs
33+
dir -Recurse myDocs
34+

0 commit comments

Comments
 (0)