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

Include WinGet example #1277

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Include WinGet example #1277

wants to merge 2 commits into from

Conversation

Gijsreyn
Copy link

Small PR to include WinGet as option to install.

@eed3si9n
Copy link
Member

Thanks for the contribution.

  1. This PR should probably target 1.x branch.
  2. Also in general, WinGet sbt package (https://winget.run/pkg/sbt/sbt) doesn't seem to be maintained well. It says it's produced by Lightbend and the latest version is 1.8.2. Neither of the information is currently true. Scoop (https://scoop.sh/#/apps?q=sbt) and Chocolatey (https://scoop.sh/#/apps?q=sbt) both point to 1.10.7.

@Gijsreyn
Copy link
Author

Gijsreyn commented Jan 21, 2025

Thanks for the reply @eed3si9n

I was not aware of this website. I don't know if this is the official Microsoft site, but it's better to look at the official repo: https://github.com/microsoft/winget-pkgs/tree/master/manifests/s/sbt/sbt. The version is at 1.10.2, and I've submitted a PR on their side as well.

If you think this small contribution is still feasible, I can raise it in the target branch you've mentioned.

@eed3si9n
Copy link
Member

ok. If the actual package is kept somewhat up to date, I'd be happy to land it on 1.x.

@Gijsreyn
Copy link
Author

Gijsreyn commented Jan 21, 2025

That's a bit up to the community, I guess that will apply both to scoop and Chocolatey also. I can add a workflow into the PR also, that does something like this:

name: Submit sbt.sbt package to Windows Package Manager Community Repository

on:
  workflow_dispatch:
  release:
    types: [published]

jobs:
  winget:
    name: Publish winget package
    runs-on: windows-latest
    steps:
      - name: Submit package to Windows Package Manager Community Repository
        run: |

          $packageId = "sbt.sbt"
          $gitToken = "${{ secrets.WINGET_PAT }}"

          # Fetching latest release from GitHub
          $github = Invoke-RestMethod -uri "https://api.github.com/repos/sbt/sbt/releases"
          $targetRelease = $github | Where-Object -Property name -match 'sbt'| Select-Object -First 1
          $installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Select-Object -ExpandProperty browser_download_url
          $packageVersion = $targetRelease.tag_name.Trim("v")

          # Update package using wingetcreate
          Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
          .\wingetcreate.exe update $packageId --version $packageVersion --urls "$installerUrl" --submit --token $gitToken

Note

This was off the cuff. I'm not that expert in GitHub actions.

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.

2 participants