Skip to content

Add CI action for publishing package to WinGet#189

Merged
DHowett merged 2 commits intomicrosoft:mainfrom
mdanish-kh:winget-publish
May 28, 2025
Merged

Add CI action for publishing package to WinGet#189
DHowett merged 2 commits intomicrosoft:mainfrom
mdanish-kh:winget-publish

Conversation

@mdanish-kh
Copy link
Contributor

@mdanish-kh mdanish-kh commented May 21, 2025

Change

Add a GitHub action similar to the Terminal one for publishing package to winget-pkgs repository on release. microsoft/winget-create is the tool used for creating and submitting the manifest

Steps needed from maintainers

If the maintainers approve of this change then:

  • Add the a repository secret named WINGET_TOKEN that's a public access token (classic) with public_repo scope from the user account where the winget-pkgs fork exists (or re-use the terminal's secret to have submissions made from the same bot account @consvc)

Validation

One can use a dummy version and run a wingetcreate command (without passing the --submit flag that opens a PR) to verify if the command would work correctly

wingetcreate update Microsoft.Edit `
  --version 9.0.0 `
  --urls https://github.com/microsoft/edit/releases/download/v1.0.0/edit-1.0.0-aarch64-windows.zip https://github.com/microsoft/edit/releases/download/v1.0.0/edit-1.0.0-x86_64-windows.zip

@DHowett
Copy link
Member

DHowett commented May 21, 2025

Does this somehow automatically find the path inside the ZIP file to the EXE, even though it changes every release?

Also, Invoke-WebRequest is evil :) try curl.exe -JLO https://aka.ms/wingetcreate/latest.

@mdanish-kh
Copy link
Contributor Author

Does this somehow automatically find the path inside the ZIP file to the EXE, even though it changes every release?

Also, Invoke-WebRequest is evil :) try curl.exe -JLO https://aka.ms/wingetcreate/latest.

Yes it does. winget-create tries to obtain a "matching" relative path similar to the one used in previous manifest. Since the binary is always going to be called edit.exe (I'm assuming it will be), it shouldn't be a problem.

@rimrul
Copy link

rimrul commented May 21, 2025

Does this somehow automatically find the path inside the ZIP file to the EXE, even though it changes every release?

Honest question: Why does that change every release? Is that a good idea?

@DHowett
Copy link
Member

DHowett commented May 21, 2025

Honest question: Why does that change every release? Is that a good idea?

It is best practice for release archives to contain a top-level folder named with the version of the project. This can be observed in any number of open-source projects in all sorts of languages across the ecosystem: libarchive, curl, the apache web server, mediawiki, zfs, ...

Yes. It is a good idea.

@DHowett DHowett merged commit a82483d into microsoft:main May 28, 2025
1 check passed
@mdanish-kh mdanish-kh deleted the winget-publish branch May 28, 2025 15:29
Lou32Verbose pushed a commit to Lou32Verbose/edit that referenced this pull request Jan 11, 2026
This is similar to the one in microsoft/terminal,
and uses wingetcreate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants