Skip to content
Projects

About

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

Developer Tools

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+2
in 15 days
0
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

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 WinGet manifests and submitting them at WinGet Community Repository for every release of your application can be tedious 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 and published to WinGet.

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 the public_repo and workflow scopes. The workflow scope is required when synchronizing changes to workflow files from the upstream microsoft/winget-pkgs repository. Without it, the action may fail intermittently when synchronizing changes. The workflow permission can be omitted, but you will need to manually sync the fork when this happens. New fine-grained PATs aren't supported by the action.

    Error:
       0: <username> does not have the correct permissions to execute `UpdateRef`
       1: failed to sync upstream changes
    

    If you encounter this error, add the workflow scope to the classic PAT used by the token input or manually sync the winget-pkgs fork via the web UI, then rerun the workflow.

  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.

  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: ubuntu-slim
    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: ubuntu-slim
    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: ubuntu-slim
    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: ubuntu-slim
    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 ⚒️

Option Description Notes
identifier (Mandatory) The PackageIdentifier of the app in WinGet. Example: Microsoft.PowerToys
version (Optional) The PackageVersion of the application. Default: Release tag, excluding v prefix
(e.g. v1.0.0 -> 1.0.0)
Example: ${{ github.event.release.tag_name }} # For tags without the 'v' prefix
installers-regex (Optional) A Regular Expression to match Windows installers/binaries from GitHub release artifacts. Default: .(exe|msi|msix|appx)(bundle){0,1}$
Example: \.exe$ (All files ending with .exe)
max-versions-to-keep (Optional) The maximum number of versions of the package to keep in WinGet. If after the current release, the number of versions exceeds this limit, the oldest version will be deleted. Default: 0 (unlimited)
Example: 3 (latest 3 versions only)
release-tag (Optional) The tag of the GitHub release you want to publish to Windows Package Manager (WinGet). Default: ${{ github.event.release.tag_name || github.ref_name }}
Example: release-tag: ${{ inputs.version }} # workflow_dispatch input 'version'
release-repository (Optional) The repository containing the GitHub release, in owner/name format. Default: ${{ github.repository }}
Example: release-repository: other-owner/example-repo
fork-user (Optional) The GitHub user where winget-pkgs fork is present. This fork will be used to create PR at WinGet Community Repository. Default: ${{ github.repository_owner }} # repository owner
Example: dotnet-winget-bot
token (Mandatory) GitHub token to create PR at winget-pkgs. The token should have a public_repo scope. Example: token: ${{ secrets.WINGET_TOKEN }} # Repository secret called 'WINGET_TOKEN'
release-notes-url (Optional) URL to package version's release notes. Default: GitHub release page
Example: release-notes-url: https://example.com/release-notes/${{ github.event.release.tag_name }}

Outputs

Variable Description Notes
pr-url The URL of the created pull request Example: ${{ steps.<id>.outputs.pr-url }} # https://github.com/microsoft/winget-pkgs/pull/332710

[!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.

🚀 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 👀

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Baptiste Augrain
Baptiste Augrain

💻 🤔 🐛
Chaoqun
Chaoqun

🐛
Christian Brabandt
Christian Brabandt

🐛
CodeDoctor
CodeDoctor

🐛
Dave Lane
Dave Lane

🤔
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

🐛
UnownPlain
UnownPlain

💻 🤔
Vedant
Vedant

💻
igoogolx
igoogolx

🐛 💻
ilike2burnthing
ilike2burnthing

🐛
isaak654
isaak654

🐛
maforget
maforget

🐛
repolevedavaj
repolevedavaj

🐛
sitiom
sitiom

📖 🐛 💻

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

Explore related projects

Loading…