temurin-build icon indicating copy to clipboard operation
temurin-build copied to clipboard

Publish to Windows Package Managar (WinGet)

Open vedantmgoyal9 opened this issue 3 years ago • 10 comments

With every new release of Temurin JDKs/JREs, use a GitHub workflow to update manifests at https://github.com/microsoft/winget-pkgs repository.

The workflow will be added to every release repository:

  • Temurin8: https://github.com/adoptium/temurin8-binaries
  • Temurin11: https://github.com/adoptium/temurin11-binaries
  • Temurin16: https://github.com/adoptium/temurin16-binaries
  • Temurin17: https://github.com/adoptium/temurin17-binaries
  • Temurin18: https://github.com/adoptium/temurin18-binaries
  • Temurin19 (beta): https://github.com/adoptium/temurin19-binaries
  • Temurin20 (beta): https://github.com/adoptium/temurin20-binaries

Prerequisites:

  1. https://github.com/microsoft/winget-pkgs will be required to be cloned under the organization or a personal account of a maintainer/bot like @eclipse-temurin-bot.
  2. A GitHub Personal Access Token (PAT) will be needed to create pull requests to update manifests at https://github.com/microsoft/winget-pkgs. The token needs to be added as a repository secret to every repo. I know it's a bit hectic but it needs to be done only one time ;) Permissions required: public_repo and workflow.

Existing projects which use the action: https://github.com/search?q=vedantmgoyal2009%2Fwinget-releaser+path%3A.github%2Fworkflows%2F+language%3AYAML&type=Code&s=indexed&o=desc

P.S. I can create PRs for every repository.

Edit: Replaced extraneous reference of temurin18 with temurin19 (beta).

vedantmgoyal9 avatar Aug 17 '22 16:08 vedantmgoyal9

I made a draft on jdk11, if this is what you want? @vedantmgoyal2009 I am thinking only for the official releases and skip nightly builds, which only enable jdk8/11/17/19(tobe)

zdtsw avatar Aug 22 '22 09:08 zdtsw

I've updated to add JRE too.

vedantmgoyal9 avatar Aug 23 '22 10:08 vedantmgoyal9

ping @gdams and @karianna for this issue

zdtsw avatar Aug 23 '22 13:08 zdtsw

Any thoughts @gdams @karianna - are MSFT willing to support this?

sxa avatar Sep 07 '22 17:09 sxa

This seems like the logical thing to do here. The manifests are currently being manually updated although it's not something that I've been doing myself.

I would say let's role this out for the 8-18 repos and see how stable it is

gdams avatar Sep 08 '22 08:09 gdams

@gdams The internal CI which publishes GitHub releases can trigger the WinGet workflow programmatically after all 4 binaries have been published (JDK/JRE x64/x86) and pass the GitHub release tag with it (see https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event to how to do it).

References: 2. Docs about workflow_dispatch event: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ 3. Updates to workflow_dispatch: https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/

vedantmgoyal9 avatar Sep 08 '22 19:09 vedantmgoyal9

@gdams @karianna From some discussion in https://github.com/adoptium/temurin11-binaries/pull/11, I came to know that not all binaries are published along with the release. So, we might want to trigger the WinGet workflow from the internal CI which uploads Windows MSI binaries to GitHub.

Use GitHub CLI to create workflow_dispatch event: https://cli.github.com/manual/gh_workflow_run (we need to pass release tag to workflow, which we can do via JSON standard input, as mentioned in the docs)

Main Documentation: https://docs.github.com/en/rest/actions/workflows#create-a-workflow-dispatch-event

References:

  1. Docs about workflow_dispatch event: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
  2. Updates to workflow_dispatch: https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/

vedantmgoyal9 avatar Sep 09 '22 10:09 vedantmgoyal9

Any progress on this? Using winget the latest versions are currently not available and therefore contain open CVEs (CVSS 7,5 iirc).

friesoft avatar Jan 28 '24 20:01 friesoft

@gdams Let's discuss when we next meet up - not sure where this is these days.

karianna avatar Jan 29 '24 00:01 karianna