-
Notifications
You must be signed in to change notification settings - Fork 48
Winget manifest uploader #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
2979a2c
90a5c5a
51ba698
1e51cc0
0447293
69c7684
1ca6e8d
a9a03ba
e5f3d29
2803a35
4b7c7f7
ad3b597
2134168
979c718
41af3bd
484d6e8
4490a8d
68c7061
f82c7b2
916336f
974289b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,27 @@ | ||||||||||
name: Publish to Winget | ||||||||||
|
||||||||||
on: | ||||||||||
release: | ||||||||||
types: [published] | ||||||||||
|
||||||||||
|
||||||||||
env: | ||||||||||
REGEX: 'DSC-(\d+\.\d+\.\d+(?:-preview\.\d+)?)-(?:x86_64|aarch64)-pc-windows-msvc\.zip' | ||||||||||
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
removing REGEX env variable as not needed (assuming you agree with my suggestions above). Adding the |
||||||||||
|
||||||||||
jobs: | ||||||||||
publish: | ||||||||||
runs-on: windows-latest # Action can only run on Windows | ||||||||||
steps: | ||||||||||
- name: Publish Microsoft.DSC ${{ github.event.release.prerelease && 'Preview' || 'Stable' }} | ||||||||||
run: | | ||||||||||
$assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json | ||||||||||
$wingetRelevantAsset = $assets | Where-Object { $_.name -like '*.zip' -and $_.name -like '*.msixbundle' } | Select-Object -First 1 | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code looks like it's either only gonna get the zip URL OR the MSIX URL, and we don't know which will it be? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
As I mentioned in a comment previously, the current code looks like it's either only gonna get the zip URL OR the MSIX URL, and we don't know which will it be. We should get URLs something like this instead |
||||||||||
$regex = [Regex]::New($env:REGEX) | ||||||||||
$version = $regex.Match($wingetRelevantAsset.name).Groups[1].Value | ||||||||||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We don't need to perform regex matching. The version info is already available in the GitHub release event |
||||||||||
|
||||||||||
$wingetPackage = "Microsoft.DSC${{ github.event.release.prerelease && '.Preview' || '' }}" | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Personally I would suggest not handling Preview releases for now to get this merged & handle preview in a future PR. The issue is that WinGet pipelines enforce that the PackageVersion should exactly match the MSIX version. For reference, the GitHub version for the latest preview is |
||||||||||
|
||||||||||
& curl.exe -JLO https://aka.ms/wingetcreate/latest | ||||||||||
& .\wingetcreate.exe update $wingetPackage -s -v $version -u $wingetRelevantAsset.browser_download_url -t "${{ secrets.WINGET_TOKEN }}" | ||||||||||
|
||||||||||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Suggested changes to the command based on feedback above. Use of |
||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add
workflow_dispatch
so that the job can be re-run manually from the Actions tab