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

Use wingetcreate for package submissions #1231

Closed
mdanish-kh opened this issue Feb 19, 2024 · 2 comments
Closed

Use wingetcreate for package submissions #1231

mdanish-kh opened this issue Feb 19, 2024 · 2 comments
Labels

Comments

@mdanish-kh
Copy link

Problem

Currently, a lot of Netron package PRs are getting labeled with Manifest-Version-Deprecated over at winget-pkgs: https://github.com/microsoft/winget-pkgs/pulls?q=is%3Apr+author%3Alutzroeder+is%3Aclosed+label%3AManifest-Version-Deprecated. This is because the action uses a hardcoded 1.2.0 schema version.

Proposal

Use wingetcreate in the CI pipeline to handle package updates to winget. It'll always use the latest schema version and make improvements to the manifest for better readability.

Workflow

Reference workflow file that can be used for this repo

    name: Publish winget
    runs-on: windows-latest
    steps:
    - name: Sync winget-pkgs fork
      run : gh repo sync lutzroeder/winget-pkgs -b master
      env:
        GH_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
    - name: Submit package to Windows Package Manager Community Repository
      run: |
        $packageId = "LutzRoeder.Netron"
        $gitToken = "${{ secrets.PUBLISH_GITHUB_TOKEN }}"

        # Fetching latest release from GitHub
        $github = Invoke-RestMethod -uri "https://api.github.com/repos/lutzroeder/netron/releases"
        $targetRelease = $github | Select-Object -First 1
        $installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match 'Netron-Setup-\d+(\.\d+)*\.exe' | 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|x86" "$installerUrl|arm64" --submit --token $gitToken
@lutzroeder
Copy link
Owner

lutzroeder commented Feb 19, 2024

@mdanish-kh can you recommend a fix that would not require taking a dependency on wingetcreate.exe which runs only on Windows machines and adds additional complexity and dependencies to the build.

@mdanish-kh
Copy link
Author

Well, the manual fix would be to use the latest schema version when it rolls out for winget. The ManifestVersion currently used is 1.2.0, you can bump that to 1.6.0 in all yaml files to fix Manifest-Version-Deprecated

@lutzroeder lutzroeder changed the title ci: Use wingetcreate for package submissions Use wingetcreate for package submissions Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants