Giter Site home page Giter Site logo

vedantmgoyal2009 / winget-releaser Goto Github PK

View Code? Open in Web Editor NEW
160.0 5.0 21.0 858 KB

Publish new releases of your application to the Windows Package Manager easily.

Home Page: https://docs.bittu.eu.org/docs/winget-releaser-playground

License: GNU Affero General Public License v3.0

github-actions winget windows hacktoberfest actions

winget-releaser's Introduction

Logo WinGet Releaser (GitHub Action)

GitHub contributors (via allcontributors.org) GitHub issues GitHub release (latest by date) GitHub Repo stars GitHub Badge

Publish new releases of your application to the Windows Package Manager easily.

pr-example-screenshot

Creating manifests and pull requests for every release of your application can be time-consuming and error-prone.

WinGet Releaser allows you to automate this process, with pull requests that are trusted amongst the community, often expediting the amount of time it takes for a submission to be reviewed.

Getting Started πŸš€

Important

At least one version of your package should already be present in the Windows Package Manager Community Repository. The action will use that version as a base to create manifests for new versions of the package.

  1. You will need to create a classic Personal Access Token (PAT) with public_repo scope. New fine-grained PATs aren't supported by the action. Review #172 for information.

  2. Fork microsoft/winget-pkgs under the same account/organization as the project's repository. If you are forking winget-pkgs on a different account (e.g. bot/personal account), you can use the fork-user input to specify the username of the account where the fork is present.

    • Ensure that the fork is up-to-date with the upstream. You can use Pull App which keeps your fork up-to-date via automated pull requests.
  3. Add the action to your workflow file (e.g. .github/workflows/<name>.yml).

Important

The action will only work when the release is published (not a draft), because the release assets (binaries) aren't available publicly until the release is published.

Note

In case you're pinning the action to a commit hash, you'll need to update the hash frequently to get the latest features & bug fixes. Therefore, it is highly recommended to setup dependabot auto-updates for your repository. Check out keeping your actions up to date with Dependabot for guidance on how to do this. (Yes, it also supports updating actions pinned to a commit hash!)

Examples πŸ“

Workflow with the minimal configuration Workflow with a filter to only publish .exe files Workflow to publish multiple packages Workflow with implementation of custom package version
name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest
    steps:
      - uses: vedantmgoyal9/winget-releaser@main
        with:
          identifier: Package.Identifier
          max-versions-to-keep: 5 # keep only latest 5 versions
          token: ${{ secrets.WINGET_TOKEN }}
name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest
    steps:
      - uses: vedantmgoyal9/winget-releaser@main
        with:
          identifier: Package.Identifier
          installers-regex: '\.exe$' # Only .exe files
          token: ${{ secrets.WINGET_TOKEN }}
name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest
    steps:
      - name: Publish X to WinGet
        uses: vedantmgoyal9/winget-releaser@main
        with:
          identifier: Package.Identifier<X>
          installers-regex: '\.exe$' # Only .exe files
          token: ${{ secrets.WINGET_TOKEN }}
      - name: Publish Y to WinGet
        uses: vedantmgoyal9/winget-releaser@main
        with:
          identifier: Package.Identifier<Y>
          installers-regex: '\.msi$' # Only .msi files
          token: ${{ secrets.WINGET_TOKEN }}
name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest
    steps:
      - name: Get version
        id: get-version
        run: |
          # Finding the version from release name
          $VERSION="${{ github.event.release.name }}" -replace '^.*/ '
          "version=$VERSION" >> $env:GITHUB_OUTPUT
        shell: pwsh
      - uses: vedantmgoyal9/winget-releaser@main
        with:
          identifier: Package.Identifier
          version: ${{ steps.get-version.outputs.version }}
          token: ${{ secrets.WINGET_TOKEN }}

Configuration Options βš’οΈ

  • identifier: The package identifier of the package to be updated in the WinGet Community Repository.

    • Required: βœ…
    • Example: identifier: Publisher.Package # Microsoft.Excel
  • version: The PackageVersion of the package you want to release.

    • Required: ❌ (defaults to tag, excluding v prefix: v1.0.0 -> 1.0.0)
    • Example: version: ${{ github.event.release.tag_name }} # For tags without the 'v' prefix
  • installers-regex: A regular expression to match the installers from the release artifacts which are to be published to Windows Package Manager (WinGet).

    • Required: ❌ (Default value: .(exe|msi|msix|appx)(bundle){0,1}$)
    • Example: installers-regex: '\.exe$' # All EXE's
  • max-versions-to-keep: The maximum number of versions of the package to keep in the WinGet Community Repository. If after the current release, the number of versions exceeds this limit, the oldest version will be deleted.

    • Required: ❌ (Default value: 0 - unlimited)
    • Example: max-versions-to-keep: 5 # keep only the latest 5 versions
  • release-tag: The GitHub release tag of the release you want to publish to Windows Package Manager (WinGet).

    • Required: ❌ (Default value: ${{ github.event.release.tag_name || github.ref_name }})
    • Example: release-tag: ${{ inputs.version }} # workflow_dispatch input 'version'
  • token: The GitHub token with which the action will authenticate with GitHub API and create a pull request on the WinGet Community Repository. The token should have a public_repo scope.

    • Required: βœ…
    • Example: token: ${{ secrets.WINGET_TOKEN }} # Repository secret called 'WINGET_TOKEN'

Warning

Do not directly put the token in the action. Instead, create a repository secret containing the token and use that in the workflow. Refer to using encrypted secrets in a workflow for more information.

  • fork-user: The GitHub username of the user where a fork of winget-pkgs is present. This fork will be used to create the pull request.
    • Required: ❌ (Default value: ${{ github.repository_owner }} # repository owner)
    • Example: fork-user: dotnet-winget-bot # for example purposes only

πŸš€ Integrating with Komac logo - Supercharging WinGet Releaser

The action uses Komac under the hood to create manifests and publish them to the Windows Package Manager Community Repository because of its unique capability to update installer URLs with respect to architecture, installer type, scope, etc.

I'm grateful to Russell Banks, the creator of Komac, for creating such an amazing & wonderful winget manifest creator, which is the core of this action. Again, it is because of Komac that the action can now be used on any platform (Windows, Linux, macOS) and not just Windows (as it was before).

🌟 Stargazers over time πŸ‘€

Stargazers over time

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Baptiste Augrain
Baptiste Augrain

πŸ’» πŸ€” πŸ›
Chaoqun
Chaoqun

πŸ›
Christian Brabandt
Christian Brabandt

πŸ›
CodeDoctor
CodeDoctor

πŸ›
Doug P
Doug P

πŸ›
Eric Trenkel
Eric Trenkel

πŸ’΅ πŸ›
Fndroid
Fndroid

πŸ’΅
Frans van Dorsselaer
Frans van Dorsselaer

πŸ€” πŸ›
Gerardo Grignoli
Gerardo Grignoli

πŸ“– πŸ›
James Alickolli
James Alickolli

πŸ€”
Justin M. Keyes
Justin M. Keyes

πŸ€”
Kei Touge
Kei Touge

πŸ›
LP
LP

πŸ›
Linda_pp
Linda_pp

πŸ›
Marc Auberer
Marc Auberer

πŸ›
Maxim
Maxim

πŸ›
Michael Lohr
Michael Lohr

πŸ“–
Miles Yucht
Miles Yucht

πŸ›
Piotr Chabelski
Piotr Chabelski

πŸ›
Russell Banks
Russell Banks

πŸ€” πŸ“–
ST-DDT
ST-DDT

πŸ“– πŸ€”
Tim Brinkley
Tim Brinkley

πŸ› πŸ’΅
Tom Payne
Tom Payne

πŸ›
Vedant
Vedant

πŸ’»
igoogolx
igoogolx

πŸ› πŸ’»
ilike2burnthing
ilike2burnthing

πŸ›
isaak654
isaak654

πŸ›
repolevedavaj
repolevedavaj

πŸ›
sitiom
sitiom

πŸ“– πŸ› πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

winget-releaser's People

Contributors

allcontributors[bot] avatar daiyam avatar dependabot[bot] avatar gerardog avatar github-actions[bot] avatar igoogolx avatar imgbot[bot] avatar michidk avatar russellbanks avatar sitiom avatar vedantmgoyal9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

winget-releaser's Issues

[Bug]: Actions failed with "RequestError [HttpError]: Not Found".

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Here's the log:

Run vedantmgoyal2009/winget-releaser@latest
D:\a\_actions\vedantmgoyal200[9](https://github.com/sprout2000/leafview/actions/runs/3124246506/jobs/5067517923#step:2:10)\winget-releaser\latest\dist\index.js:4235
      const error = new requestError.RequestError(toErrorMessage(data), status, {
                    ^

RequestError [HttpError]: Not Found
    at D:\a\_actions\vedantmgoyal2009\winget-releaser\latest\dist\index.js:4235:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async D:\a\_actions\vedantmgoyal2009\winget-releaser\latest\dist\index.js:9700:7 {
  status: 404,
  response: {
    url: 'https://api.github.com/repos/sprout2000/leafview/releases/tags/refs%2Ftags%2Fv2.0.4',
    status: 404,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      connection: 'close',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Mon, 26 Sep 2022 00:34:56 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-accepted-oauth-scopes': 'repo',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '0401:2C4E:21E5CA7:4357355:6330F3B0',
      'x-oauth-scopes': 'public_repo',
      'x-ratelimit-limit': '5000',
      'x-ratelimit-remaining': '4999',
      'x-ratelimit-reset': '1664156096',
      'x-ratelimit-resource': 'core',
      'x-ratelimit-used': '1',
      'x-xss-protection': '0'
    },
    data: {
      message: 'Not Found',
      documentation_url: 'https://docs.github.com/rest/reference/repos#get-a-release-by-tag-name'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/repos/sprout2000/leafview/releases/tags/refs%2Ftags%2Fv2.0.4',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-core.js/3.6.0 Node.js/16.13.0 (win32; x64)',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: Agent {
        _events: [Object: null prototype] {
          free: [Function (anonymous)],
          newListener: [Function: maybeEnableKeylog]
        },
        _eventsCount: 2,
        _maxListeners: undefined,
        defaultPort: 443,
        protocol: 'https:',
        options: [Object: null prototype] { path: null },
        requests: [Object: null prototype] {},
        sockets: [Object: null prototype] {},
        freeSockets: [Object: null prototype] {},
        keepAliveMsecs: [10](https://github.com/sprout2000/leafview/actions/runs/3124246506/jobs/5067517923#step:2:11)00,
        keepAlive: false,
        maxSockets: Infinity,
        maxFreeSockets: [25](https://github.com/sprout2000/leafview/actions/runs/3124246506/jobs/5067517923#step:2:26)6,
        scheduling: 'lifo',
        maxTotalSockets: Infinity,
        totalSocketCount: 0,
        maxCachedSessions: 100,
        _sessionCache: {
          map: {
            'api.github.com:4[43](https://github.com/sprout2000/leafview/actions/runs/3124246506/jobs/5067517923#step:2:44):::::::::::::::::::::': [Buffer [Uint8Array]]
          },
          list: [ 'api.github.com:[44](https://github.com/sprout2000/leafview/actions/runs/3124246506/jobs/5067517923#step:2:45)3:::::::::::::::::::::' ]
        },
        [Symbol(kCapture)]: false
      },
      hook: [Function: bound bound register]
    }
  }
}

[Feature/Idea]: Create workflow tests to run on commit

What would you like to see changed/added?

It would be good to have tests that run on commit and pull requests and (if possible) dry run a test package, to make sure that it is outputting the correct values and not failing. As WinGet Releaser is used by a lot of big projects, this would help maintain its robustness in production and ensure that the action will not fail when used in workflows.

[Feature/Idea]: Ability to update `RelativeFilePath`

What would you like to see changed/added?

Related to #82 (comment), russellbanks/Komac#90

Support for 1.4 manifests. Also, updating the RelativeFilePath should be supported in cases where the executable is inside a versioned directory. For example:

- RelativeFilePath: bat-v0.22.1-x86_64-pc-windows-msvc\bat.exe

I don't see an input that does this, so I'm assuming this hasn't been added yet.

Add docs about tagging a commit hash & dependabot updates

@vedantmgoyal2009 FWIW, I strongly recommend moving over to by-hash with dependabot/pull without the workflow permissions as your default recommendation:

If your account ever gets compromised, the potential damage to the winget ecosystem (and beyond winget for every repository that grants a workflow scope) is massive: it allows exfilitrating all github action secrets for all repos that have granted workflow scope - e.g. other access tokens (both github and for external services), code signing private keys, etc.

While GitHub won't pass them to your workflow unless requested, the permission gives the ability to add new workflows that do request them.

Originally posted by @fredemmott in OpenKneeboard/OpenKneeboard#264 (comment)

[Question]: Actions failed with "Number of InstallerUrls are not equal".

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

my .github/workflows/winget.yml failed as follows:

Update manifests and create pull request
  Found Existing Version: 1.10.1
  Exception: D:\a\leafview\leafview\winget-pkgs\Tools\YamlCreate.ps1:[9](https://github.com/sprout2000/leafview/actions/runs/3011186300/jobs/4838048413#step:2:10)15
  Line |
   915 |      Throw 'Number of InstallerUrls are not equal'
       |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       | Number of InstallerUrls are not equal
  
  node:child_process:826
      err = new Error(msg);
            ^
  
  Error: Command failed: .\YamlCreate.ps1 '{"PackageIdentifier":"sprout2000.LeafView","PackageVersion":"1.10.5","InstallerUrls":[],"ReleaseNotesUrl":"https://github.com/sprout2000/leafview/releases/tag/v1.10.5","ReleaseDate":"2022-09-07","DeletePreviousVersion":false}'
      at checkExecSyncError (node:child_process:826:11)
      at execSync (node:child_process:900:15)
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\latest\dist\index.js:9774:3
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 6136,
    stdout: null,
    stderr: null
  }

It used to pass without any problems, but now it fails.
Could you tell me what to do about it?

Here's my winget.yml:

name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest # action can only be run on windows
    steps:
      - uses: vedantmgoyal2009/winget-releaser@latest
        with:
          identifier: sprout2000.LeafView
          token: ${{ secrets.WINGET_TOKEN }}

[Feature/Idea]: Add release repo

What would you like to see changed/added?

Hi,

For VScodium Insiders, we are using the auxiliary repository https://github.com/VSCodium/vscodium-insiders/releases.
We are doing so to avoid to mixup the stable and insiders versions.

So it would be good if you can add an option like: release-repository: vscodium-insiders

[Bug]: "Update manifests and publish" step fails

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Somewhere during the "Update manifests and publish" step an error pops up:

Exception: D:\a\_temp\3a4ce3ca-aa78-4d4e-99aa-af5b9ba4f653.ps1:33
Line |
  33 |              throw $_.Exception.Message
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Conversion from JSON failed with error: Unexpected character encountered while parsing value: S. Path
     | '', line 0, position 0.

Error: Process completed with exit code 1.

Full logs of the job: logs_13.zip

[Bug]: Failed to create a new package.

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When I try to register a new package, I get the following error:

Update manifests and create pull request
  Exception: D:\a\elephicon\elephicon\winget-pkgs\Tools\YamlCreate.ps1:755
  Line |
   755 |      throw 'This option requires manifest of previous version of the p …
       |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       | This option requires manifest of previous version of the package. If you want to create a new package,
       | please select Option 1.
  
  node:child_process:826
      err = new Error(msg);
            ^
  
  Error: Command failed: .\YamlCreate.ps1 '{"PackageIdentifier":"sprout2000.Elephicon","PackageVersion":"1.10.5","InstallerUrls":["https://github.com/sprout2000/elephicon/releases/download/v1.10.5/Elephicon-1.10.5-win32-x64-installer.exe"],"ReleaseNotesUrl":"https://github.com/sprout2000/elephicon/releases/tag/v1.10.5","ReleaseDate":"2022-09-14","DeletePreviousVersion":false}'
      at checkExecSyncError (node:child_process:826:11)
      at execSync (node:child_process:900:15)
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\latest\dist\index.js:9774:3
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 5584,
    stdout: null,
    stderr: null
  }

Might we need a conditional branch to deal with please select Option 1?

[Bug]: Manifest could not be downloaded

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Hey,
for a fews days, I see the following error in the https://github.com/vim/vim-win32-installer/actions/runs/4039423513/jobs/6944142155:


Update manifests and create pull request
  OperationStopped: D:\a\vim-win32-installer\vim-win32-installer\winget-pkgs\Tools\YamlCreate.ps1:38
  Line |
    38 |      throw [System.Net.WebException]::new('Manifest schemas could not  …
       |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       | Manifest schemas could not be downloaded. Try running the script again
  
  node:internal/errors:841
    const err = new Error(message);
                ^

any idea please?

[Feature/Idea]: Support Manifest version 1.2.0

What would you like to see changed/added?

As title, it would be good to get manifest version 1.2.0 integrated soon :)

YamlCreate and WingetCreate have both been updated for 1.2.0 manifests.

[Bug]: Action failing with GHFileNotFoundException

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

This is the first time I am using this plugin, so maybe I am doing something wrong.

The action crashes because of the following error:

Exception in thread "main" org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/Project-Env/winget-pkgs/branches/refs/heads/ProjectEnv.ProjectEnvCli-3.15.0-4A5D6DD8E7851174D4A4025F5DAC4992 {"message":"Branch not found","documentation_url":"https://docs.github.com/rest/branches/branches#get-a-branch"}

This is the workflow file I have implemented: https://github.com/Project-Env/project-env-cli/actions/runs/4611714836/workflow

Example run: https://github.com/Project-Env/project-env-cli/actions/runs/4611714836/jobs/8151859946

Feedback/Impressions while implementing for gsudo.

What would you like to see changed/added?

Follow up to gerardog/gsudo#189, trying to use WinGet-Releaser

  • The bot retrieves ProductCode successfully for gsudo. How do I achieve the same with winget-releaser?
  • Is there a test-mode? a way to run the releaser, make it commit on my fork, but not create the pull request to microsoft yet?
  • How do I customize the output json? for example, Architecture: "neutral"

[Feature/Idea]: Use more native TypeScript/JavaScript calls

What would you like to see changed/added?

A lot of the code in main.ts is executing PowerShell code from TypeScript. It would be better if the code used calls written in JS/TS rather than bridging PowerShell.

As an example, rather than:

  execSync(
    `git clone https://x-access-token:${token}@github.com/microsoft/winget-pkgs.git`,
    { stdio: 'inherit' },
  );

We could use (taken from Simple-Git as an example):

simpleGit().clone("https://x-access-token:${token}@github.com/microsoft/winget-pkgs.git");

This is also less error-prone, as it would fail at compile-time if the command was incorrect, instead of failing at runtime.

[Feature/Idea]: Fine-grained tokens seem to support the GraphQL API now

What would you like to see changed/added?

Hi! I was recently going through setting this up on one of my own applications as it looks great. However, as I was setting it up, I noted that the README currently mentions:

New fine-grained PATs can't access GitHub's GraphQL API, so they aren't supported by this action. Refer to cli/cli#6680 for more information.

However, going to the linked issue, as of a few weeks ago, it seems like fine-grained PATs can now call the GraphQL API.

If winget-releaser doesn't currently work with these, then it would be nice if they did (would be happy to try and help if that would be desired), along with instructions on how to use them. And whether it does or does not already support fine-grained PATs, I think it would be good to update the README to be more accurate.

[Bug]: Unable to find version `latest`

Is there an existing issue for this?

What happened?

Hi,
I noticed the winget releases started failing around 2 days ago with the following error message:

Unable to resolve action `vedantmgoyal2009/winget-releaser@latest`, unable to find version `latest`

[Feature/Idea]: Support for 1.4 manifests

What would you like to see changed/added?

Support for 1.4 manifests. Also, updating the RelativeFilePath should be supported in cases where the executable is inside a versioned directory. For example:

- RelativeFilePath: bat-v0.22.1-x86_64-pc-windows-msvc\bat.exe

[Feature/Idea]: Add maximum package versions functionality

What would you like to see changed/added?

This feature would be like delete-previous-version, except it would delete the oldest version once the amount of versions within a package have reached a maximum number.

For example, you have package-x, with maximum versions set to 5:

1.0.0
1.1.0
1.2.0
1.3.0
1.4.0

When the next version, say 1.5.0, is released, winget-releaser would then delete 1.0.0 in that same pull request.

This would be most useful in packages that push a lot of updates but want to keep their version history clean, as it is uncommon for users to need versions that old.

This links to microsoft/winget-pkgs#66854 (reply in thread):

Quick answer; Feel free to add old versions (major and/or up to the 10 latest versions)

[Bug]: lateinit property credential has not been initialized

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Hi,

From the latest run (https://github.com/VSCodium/vscodium/actions/runs/4498341084/jobs/7918745356), I get the following error:

Executing command: java -jar komac.jar update --id 'VSCodium.VSCodium.Insiders' --version 1.77.0.23082 --urls 'https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumSetup-arm64-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumSetup-ia32-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumSetup-x64-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumUserSetup-arm64-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumUserSetup-ia32-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumUserSetup-x64-1.77.0.23082-insider.exe' --submit
  Exception in thread "main" kotlin.UninitializedPropertyAccessException: lateinit property credential has not been initialized
  	at token.windows.CredAdvapi32$PCREDENTIAL.getCredential(CredAdvapi32.kt:158)
  	at token.windows.CredManagerBackedSecureStore.get-AcNMXiM(CredManagerBackedSecureStore.kt:75)
  	at token.TokenStore.<init>(TokenStore.kt:13)
  	at commands.NewManifest.<init>(NewManifest.kt:58)
  	at MainKt.main(Main.kt:14)
  node:internal/errors:841
    const err = new Error(message);
                ^
  
  Error: Command failed: & $env:JAVA_HOME_17_X64\bin\java.exe -jar komac.jar update --id 'VSCodium.VSCodium.Insiders' --version 1.77.0.[23](https://github.com/VSCodium/vscodium/actions/runs/4498341084/jobs/7918745356#step:4:24)082 --urls 'https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumSetup-arm64-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumSetup-ia32-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumSetup-x64-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumUserSetup-arm64-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumUserSetup-ia32-1.77.0.23082-insider.exe,https://github.com/VSCodium/vscodium-insiders/releases/download/1.77.0.23082-insider/VSCodiumUserSetup-x64-1.77.0.23082-insider.exe' --submit
      at checkExecSyncError (node:child_process:8[28](https://github.com/VSCodium/vscodium/actions/runs/4498341084/jobs/7918745356#step:4:29):11)
      at execSync (node:child_process:899:15)
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\v2\dist\index.js:77:39
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 5664,
    stdout: null,
    stderr: null
  }

@russellbanks Can it be an issue of Komac?

[Bug]: PR pipeline fails with Manifest Error: Optional field missing. [PackageFamilyName]

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

After winget-releaser opened a PR to the winget-pkgs repo the Azure Pipeline fails with the following:

Manifest Error: Optional field missing. [PackageFamilyName]

Apparently, in a previous version of a manifest I created (manually), there was the PackageFamilyName in the installer manifest but winget-releaser does not add it.

Here is a link to the closed PR with the full Pipeline output.

[Bug]: Manifest schemas could not be downloaded

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

 OperationStopped: D:\a\Butterfly\Butterfly\winget-pkgs\Tools\YamlCreate.ps1:38
  Line |
    38 |      throw [System.Net.WebException]::new('Manifest schemas could not  …
       |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       | Manifest schemas could not be downloaded. Try running the script again
  
  node:internal/errors:841
    const err = new Error(message);
                ^
  
  Error: Command failed: .\YamlCreate.ps1 '{"PackageIdentifier":"LinwoodCloud.Butterfly","PackageVersion":"1.6.1","InstallerUrls":["https://github.com/LinwoodCloud/Butterfly/releases/download/v1.6.1/linwood-butterfly-windows-setup.exe"],"ReleaseNotesUrl":"https://github.com/LinwoodCloud/Butterfly/releases/tag/v1.6.1","ReleaseDate":"2023-01-27","DeletePreviousVersion":false}'
      at checkExecSyncError (node:child_process:828:11)
      at execSync (node:child_process:899:15)
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\v1\dist\index.js:9766:34
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 5960,
    stdout: null,
    stderr: null
  }

https://github.com/LinwoodCloud/Butterfly/actions/runs/4026609536/jobs/6921731732

[Bug]: non-0 exit codes don't fail the workflow

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Komac has a non-zero exit code if it didn't complete successfully, usually an exit code of 1. If this happens, the action should fail too.

[Bug]: ReferenceError: currentVersion is not defined

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

https://github.com/rcmaehl/MSEdgeRedirect/actions/runs/3155596178/jobs/5134429579

  Current action version: v1
  Latest version found: v1
  D:\a\_actions\vedantmgoyal2009\winget-releaser\v1\dist\index.js:9796
      if (latestVersion > currentVersion) {
                          ^
  
  ReferenceError: currentVersion is not defined
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\v1\dist\index.js:9796:25
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

[Bug]: Locale files (except default) get ignored

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I don't know if this is an issue with the action or with Komac, but whenever a new version gets released, the locale files just get ignored. It used to be that the action would copy the locale files from the previous release, but now it only commits version, installer, and defaultLocale manifests.

https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/maximmax42/CustomRP/1.17.4 - this version had locale files right away (March 21st)
https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/maximmax42/CustomRP/1.17.5 - this version didn't have locale files, had to add them manually (April 9th)
microsoft/winget-pkgs@746d3ba - commit for the new version has no locale files again (today)

[Feature/Idea]: Allow WinGet Releaser GitHub Action to run on any event

What would you like to see changed/added?

The Winget releaser action can currently only run if the workflow is a release event and a released event type, meaning the workflow has to look like this:

on:
  release:
    types: [released]

In my project, I have a workflow that runs whenever there's a new release, builds the app, and then uploads the artifacts to the release. The Windows run takes the longest usually, up to 5 minutes. This isn't ideal as the WinGet Releaser action has a wait time of 2.5 minutes before it should fail because it is unable to find the correct artifact, so I can pretty much guarantee that I am going to have to re-run it every time.

Therefore, to work around this, I could use the on: workflow_run to ensure that it will run after the Windows artifacts have been built and uploaded:

on:
  workflow_run:
    workflows: [Release]
    types:
      - completed

Therefore, allowing the WinGet Releaser GitHub Action to run on the workflow_run event, I won't have to re-run the action every time I make a release.

[Feature/Idea]: Add documentation/support for fine-grained personal access tokens

What would you like to see changed/added?

GitHub has a new type of personal access token that are fine-grained and repository-scoped.

Fine-grained personal access tokens give developers granular control over the permissions and repository access they grant to a PAT.

The existing personal access tokens continue to be fully supported, and are now called personal access tokens (classic).

Personal access tokens (classic) are given permissions from a broad set of read and write scopes. They have access to all of the repositories and organizations that the user could access, and are allowed to live forever. As an example, the repo scope provides broad access to all data in private repositories the user has access to, in perpetuity.

Fine-grained personal access tokens, by contrast, are given permissions from a set of over 50 granular permissions that control access to GitHub’s organization, user, and repository APIs. Each permission can be granted on a β€˜no access’, β€˜read’ or β€˜read and write’ basis. As an example, you can now create a PAT that can only read issues and do nothing else – not even read the contents of a repository.

In turn, setting one up for WinGet Releaser is more confusing, so documentation is needed to support this.

[Feature/Idea]: Make action run cross-platform

What would you like to see changed/added?

Komac is already cross-platform. The only thing that needs to be added in non-Windows platforms is proper MSI detection, as stated in russellbanks/Komac#110.

Other than that, it works well. This would enable Winget Releaser to immediately run in a current deploy job (most likely ubuntu-latest) instead of having to separate it. I also think that ubuntu-latest runners have a shorter startup time than windows-latest; it would help for a shorter workflow run time.

[Bug][Sandboxie.Plus]: Winget failed with "Number of InstallerUrls are not equal"

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

There is a new ARM64 installer that needs to be supported by Winget.

Winget script:
https://github.com/sandboxie-plus/Sandboxie/blob/master/.github/workflows/winget.yml
Action failure:
https://github.com/sandboxie-plus/Sandboxie/actions/runs/3280182102/jobs/5400651111

Run vedantmgoyal2009/winget-releaser@v1
Install powershell-yaml, clone winget-pkgs and configure remotes, update YamlCreate, download wingetdev...
Update manifests and create pull request
Found Existing Version: 1.4.2
Exception: D:\a\Sandboxie\Sandboxie\winget-pkgs\Tools\YamlCreate.ps1:915
Line |
915 | Throw 'Number of InstallerUrls are not equal'
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Number of InstallerUrls are not equal

node:child_process:826
err = new Error(msg);
^

docs: mention that action does not works for draft releases

    I see @vedantmgoyal2009... Please add a dry-run, that wont create the pull request to msft.

Other issues I faced:

  remote: Permission to gerardog/winget-pkgs.git denied to gerardog.
  fatal: unable to access 'https://github.com/gerardog/winget-pkgs.git/': The requested URL returned error: 403
  HTTP 401: Personal access tokens with fine grained access do not support the GraphQL API (https://api.github.com/graphql)
  Try authenticating with:  gh auth login

Problem with permissions, I will fix them. but action completed as Success, not fail.

Originally posted by @gerardog in #47 (comment)

[Bug]: /trunk/tools/wingetdev does not exist

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

I didn't see anything other issues, but maybe I'm late to the party.

I published a new release of https://github.com/dnGrep/dnGrep and the winget-releaser failed with this error:

  svn: E170000: URL 'https://github.com/vedantmgoyal2009/vedantmgoyal2009/trunk/tools/wingetdev' doesn't exist
  node:internal/errors:841
    const err = new Error(message);
                ^
  
  Error: Command failed: svn checkout https://github.com/vedantmgoyal2009/vedantmgoyal2009/trunk/tools/wingetdev
      at checkExecSyncError (node:child_process:828:11)
      at execSync (node:child_process:899:15)
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\v1\dist\index.js:9747:34
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    status: 1,
    signal: null,
    output: [ null, null, null ],
    pid: 4948,
    stdout: null,
    stderr: null
  }

If the winget-releaser code needs the client code to change, can we get a PR or other notification?

[Bug]: Exception thrown but PR is successfully created anyway

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Already happened for the second time in https://github.com/dandavison/delta:
https://github.com/dandavison/delta/actions/runs/5164060266/jobs/9302793361
https://github.com/dandavison/delta/actions/runs/5160535447/jobs/9296756572

node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: socket hang up
    at connResetException (node:internal/errors:692:14)
    at TLSSocket.socketOnEnd (node:_http_client:4[78](https://github.com/dandavison/delta/actions/runs/5164060266/jobs/9302793361#step:2:80):23)
    at TLSSocket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:[83](https://github.com/dandavison/delta/actions/runs/5164060266/jobs/9302793361#step:2:85):21)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketOnEnd (node:_http_client:478:9)
    at TLSSocket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'ECONNRESET'
}

PR is successfully created anyway:
microsoft/winget-pkgs#108812
microsoft/winget-pkgs#108829

[Bug]: Neovim workflow failing on release-winget

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Neovim is failing to publish to winget with the error:

  D:\a\_actions\vedantmgoyal2009\winget-releaser\latest\dist\index.js:9723
      `git -C winget-pkgs config --local user.name ${context.payload.sender.login}`,
                                                                            ^
  
  TypeError: Cannot read properties of undefined (reading 'login')
      at D:\a\_actions\vedantmgoyal2009\winget-releaser\latest\dist\index.js:9723:75
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

Here is a link to the relevant output: https://github.com/neovim/neovim/actions/runs/3110590152/jobs/5042020741#step:4:138

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.