Skip to content
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

Automate winget release #1

Open
cderv opened this issue Sep 12, 2022 · 15 comments
Open

Automate winget release #1

cderv opened this issue Sep 12, 2022 · 15 comments

Comments

@cderv
Copy link
Collaborator

cderv commented Sep 12, 2022

Process needs to be manual because wingetcreate can't be use due to limitation as we are using two scope in our manifest with one url. See microsoft/winget-create#166 and microsoft/winget-create#291 (cc @dpprdan)

Also, it can't be used interactively either due to this.

For now, I am doing manual update using YAMLCreate.ps1 in winget-pks repo.

We could try modifying the manifests manually to automate, but probably more work than doing update manually, until they solve the issue.

@dpprdan
Copy link

dpprdan commented Sep 12, 2022

Also, it can't be used interactively either due to this.

FWIW, wingetcreate update RStudio.quarto --version 1.1.189 --interactive works fine for me. I just have to provide the URL to the installer twice after that and can post to the repo directly afterwards.

We could try modifying the manifests manually to automate, but probably more work than doing update manually, until they solve the issue.

Third option/workaround: only provide user scope in the manifest (until this is solved) and automate.

@cderv
Copy link
Collaborator Author

cderv commented Sep 12, 2022

I just have to provide the URL to the installer twice after that and can post to the repo directly afterwards.

For some reason, I couldn't because the second time I passed the URL it tolds me that the file is locked.

Third option/workaround: only provide user scope in the manifest (until this is solved) and automate.

I thought about that, but it seems that it was added for a reason, was it ?

@dpprdan
Copy link

dpprdan commented Sep 12, 2022

I thought about that, but it seems that it was added for a reason, was it ?

Yes, I thought it would be better to make the scope more explicit, see quarto-dev/quarto-cli#1977. When it is not defined, the scope seems to be "it depends". If that is not a problem (AFAICT it isn't) just revert to non-scoped installer.

I am not sure if it is possible to submit manifests with user-scope only (in case this would be preferable from your/quarto's POV). But might be worth a shot.

For some reason, I couldn't because the second time I passed the URL it tolds me that the file is locked.

Haven't had that kind of problem and have been using this for a year now. Is the repo on a network drive or OneDrive? Or maybe a virus scanner is hitting the installer file in the winget cache at the same time (in temp dir, I assume).

@cderv
Copy link
Collaborator Author

cderv commented Sep 13, 2022

Or maybe a virus scanner is hitting the installer file in the winget cache at the same time (in temp dir, I assume).

I'll look into that. Thanks !

@dpprdan
Copy link

dpprdan commented Sep 13, 2022

it would be better to make the scope more explicit

Meaning: Make it possible to choose the scope on installation with winget.

@cderv
Copy link
Collaborator Author

cderv commented Nov 17, 2022

We should have a closer look at latest version of https://github.com/vedantmgoyal2009/winget-releaser

see quarto-dev/quarto-cli#3334 (comment) suggestion by @russellbanks

We need to check if it handles the two scopes with same url correctly

@russellbanks
Copy link

russellbanks commented Nov 17, 2022

From quarto-dev/quarto-cli#3334 (comment):

This is covered by #1 but had limitation at the time because of the Quarto manifest using two scope with same url

WinGet Releaser can handle this; it will just use the same URL twice.

Note also that we currently not publishing every release on Winget, mostly our last officially released stable version and not the pre-release. Otherwise there would be too much versions to publish.

WinGet Releaser would run on release (ignoring any draft or pre-release releases) (other events can be used if needed though):

on:
  release:
    types: [released]

@russellbanks
Copy link

russellbanks commented Nov 17, 2022

We need to check if it handles the two scopes with same url correctly

See microsoft/winget-pkgs#88822 as an example of WinGet Releaser handling two scopes with the same url correctly.

@cderv
Copy link
Collaborator Author

cderv commented Nov 17, 2022

Awesome thank you @russellbanks !

@russellbanks
Copy link

russellbanks commented Nov 17, 2022

Would be good to note VSCodium (with their insider channel) has done a similar thing here, where they have their releases kept in a separate repository to where their workflow is. See vedantmgoyal9/winget-releaser#21

This is possible with the release-repository option in WinGet Releaser.

This is their workflow, for reference.

@cderv
Copy link
Collaborator Author

cderv commented Nov 17, 2022

This is possible with the release-repository option in WinGet Releaser

Yes this was my plan once we decide to automate the release on winget from release from CLI. Currently, it is a choice to have it manually trigger release on Winget and Chocolatey.

@cderv
Copy link
Collaborator Author

cderv commented Feb 27, 2023

Interesting new project to look at: https://github.com/russellbanks/Komac found in microsoft/winget-pkgs#500

@cderv
Copy link
Collaborator Author

cderv commented May 26, 2023

With WinGet-Create 1.2.6.0 there should not be any issue more as these are solved

@cderv
Copy link
Collaborator Author

cderv commented Jan 30, 2024

So I wanted to wait for this release, and see if there was new stuff. And it seems they do update automatically now 🎉

Or maybe it was manual but it says

This pull request is automatically generated by 🥟 Dumplings

So it seems this is handled by the community - maybe at some point we can do the work to automate like chocolatey, but it seems this is available quickly with current process. That is cool !

@eitsupi
Copy link

eitsupi commented Feb 1, 2024

vedantmgoyal2009/winget-releaser uses Komac internally, and it is also used in very popular projects like bat.

https://github.com/sharkdp/bat/blob/196a4cb18f3be9b5a04e47a07bc3d3299158b0fb/.github/workflows/CICD.yml#L456-L466
microsoft/winget-pkgs#122417

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

No branches or pull requests

4 participants