cli icon indicating copy to clipboard operation
cli copied to clipboard

automate step-cli PR in winget registry

Open bapho-bush opened this issue 2 years ago • 12 comments

Hello!

  • Vote on this issue by adding a đź‘Ť reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

I would like to see step-cli in winget registry.

Why is this needed?

Winget is standard windows package manager. I think installation/uninstallation through winget would make step-cli usage easier. I know about ps1 script, but this script, as i see, don't have any uninstallation option and makes step-cli disconnected from the rest of the package management system.

bapho-bush avatar Jan 23 '23 09:01 bapho-bush

Thank you for opening this issue, we'll take a look in the coming days and see what we can do.

tashian avatar Jan 25 '23 18:01 tashian

Winget support would be great to add, as Winget is Microsoft's official CLI tool for installing packages.

So, in Windows Package Manager 1.4 (released just a few days ago), Microsoft has added full support for portable packages to Winget. This is ideal for distributing step.exe and step-ca.exe.

Prior to 1.4, Winget packages had to be full-blown MSI installers.

Portable packages, which are described more fully here, can be as simple as a manifest file and a ZIPped binary fetched from a URL. Here's the manifest schema, and here's documentation on how to create and validate a manifest file using Microsoft's tools—which we probably won't need to use for this.

To submit a package to the Winget registry, you open a pull request on microsoft/winget-pkgs. The full package submission process is documented here.

👉 Here's an example of a Winget portable package manifest for fly.io's flyctl.exe.

I think we have three options here:

  1. Wait for GoReleaser to add goreleaser/goreleaser#2290
  2. Add support to GoReleaser ourselves and submit a PR.
  3. Roll our own yaml for this as a separate part of the release process.

tashian avatar Jan 27 '23 01:01 tashian

The actual issue is goreleaser/goreleaser#1295 but it has been stale for a while, so @tashian if you want to go for it I would go for 3 (or 2)

maraino avatar Jan 27 '23 19:01 maraino

Quick update. I've hand-crafted and tested a step package, and opened this PR. This can serve as a template for us, and now we just need the release process piece.

tashian avatar Jan 30 '23 19:01 tashian

I've also tested and pushed a step-ca package, in this PR on Microsoft's repo.

tashian avatar Jan 30 '23 21:01 tashian

@bapho-bush you can now install step with winget install Smallstep.step.

My plan from here is to watch https://github.com/goreleaser/goreleaser/issues/2290 (which has some recent activity) for updates over the next month or so, and I will make manual PRs for step-cli releases in the meantime.

tashian avatar Jan 31 '23 19:01 tashian

Also (cc @dopey) this GH Action looks promising, and it uses a Windows VM.

tashian avatar Jan 31 '23 19:01 tashian

Also (cc @dopey) this GH Action looks promising, and it uses a Windows VM.

Is a windows VM really necessary, looking at the winget PR, it looks like we could templatize the files and use a GH action to do a pull request in a remote repository. We might be able to even use the same strategy for Homebrew.

maraino avatar Jan 31 '23 20:01 maraino

Also (cc @dopey) this GH Action looks promising, and it uses a Windows VM.

Is a windows VM really necessary, looking at the winget PR, it looks like we could templatize the files and use a GH action to do a pull request in a remote repository. We might be able to even use the same strategy for Homebrew.

A windows VM is definitely not necessary, and I'd prefer not to use one. Just dropped that here as a ref.

winget is indeed similar to how we do Homebrew deploys, and if I don't see any movement on GoReleaser in the next month or two, my plan is to adapt what we do there already.

tashian avatar Jan 31 '23 20:01 tashian

We'll leave this open until the process is automated.

dopey avatar Feb 01 '23 18:02 dopey

@bapho-bush you can now install step with winget install Smallstep.step.

My plan from here is to watch goreleaser/goreleaser#2290 (which has some recent activity) for updates over the next month or so, and I will make manual PRs for step-cli releases in the meantime.

Glad to hear. Thank you for your job.

bapho-bush avatar Feb 01 '23 21:02 bapho-bush

https://github.com/smallstep/cli/pull/984 contains the automation piece.

tashian avatar Aug 28 '23 22:08 tashian