/winget-releaser

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

Primary LanguagePowerShellGNU Affero General Public License v3.0AGPL-3.0

WinGet Releaser (GitHub Action)

GitHub contributors (via allcontributors.org) GitHub issues GitHub release (latest by date) GitHub Repo stars GitHub Playground-dry-run

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 🚀

  1. You will need to create a Personal Access Token (PAT) with public_repo scope.

  1. Fork the winget-pkgs repository under the same account/organization as your repository on which you want to use this action. Ensure that the fork is up-to-date with the upstream repository. You can do this using one of the following methods:
  • Give workflow permission to the token you created in Step 1. This will allow the action to automatically update your fork with the upstream repository.
  • You can use Pull App which keeps your fork up-to-date with the upstream repository via automated pull requests.
Workflow with the minimal configuration Workflow with a filter to only publish .exe files
name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    # Action can only be run on windows
    runs-on: windows-latest
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v1
        with:
          identifier: Package.Identifier
          token: ${{ secrets.WINGET_TOKEN }}
name: Publish to WinGet
on:
  release:
    types: [released]
jobs:
  publish:
    runs-on: windows-latest
    steps:
      - uses: vedantmgoyal2009/winget-releaser@v1
        with:
          identifier: Package.Identifier
          installers-regex: '\.exe$' # Only .exe files
          token: ${{ secrets.WINGET_TOKEN }}
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:
      - name: Publish X to WinGet
        uses: vedantmgoyal2009/winget-releaser@v1
        with:
          identifier: Package.Identifier<X>
          installers-regex: '\.exe$' # Only .exe files
          token: ${{ secrets.WINGET_TOKEN }}
      - name: Publish Y to WinGet
        uses: vedantmgoyal2009/winget-releaser@v1
        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 '^.*/ '
          echo "::set-output name=version::$VERSION"
        shell: pwsh
      - uses: vedantmgoyal2009/winget-releaser@v1
        with:
          identifier: Package.Identifier
          version: ${{ steps.get-version.outputs.version }}
          token: ${{ secrets.WINGET_TOKEN }}

Configuration Options

Package Identifier (identifier)

  • Required: ✅

The package identifier of the package to be updated in the Windows Package Manager Community Repository.

identifier: Publisher.Package # Microsoft.Excel

Version (version)

  • Required: ❌ (defaults to tag, excluding v prefix: v1.0.0 -> 1.0.0)

The PackageVersion of the package you want to release.

version: ${{ github.event.release.tag_name }} # For tags without the 'v' prefix

Installers Regex (installers-regex)

  • Required: ❌ (Default value: .(exe|msi|msix|appx)(bundle){0,1}$)

A regular expression to match the installers from the release artifacts which are to be published to Windows Package Manager (WinGet).

installers-regex: '\.exe$'
# Some common regular expressions include:
## '\.msi$'      -> All MSI's
## '\.exe$'      -> All EXE's
## '\.(exe|msi)' -> All EXE's and MSI's
## '\.zip$'      -> All ZIP's

Delete Previous Version (delete-previous-version)

  • Required: ❌ (Default value: 'false')

Set this to true if you want to overwrite the previous version of the package with the latest version.

delete-previous-version: 'true' # don't forget to quotes

Release tag (release-tag)

  • Required: ❌ (Default value: ${{ github.event.release.tag_name || github.ref }})

The GitHub release tag of the release you want to publish to Windows Package Manager (WinGet).

release-tag: ${{ github.event.inputs.version }} # workflow_dispatch input `version`

Token (token)

  • Required: ✅

The GitHub token with which the action will authenticate with GitHub API and create a pull request on the microsoft/winget-pkgs repository.

token: ${{ secrets.WINGET_TOKEN }} # Repository secret called 'WINGET_TOKEN'

The token should have the public_repo scope.

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

Use fork under which user (fork-user)

  • Required: ❌ (Default value: ${{ github.repository_owner }} # repository owner)

This is the GitHub username of the user where the fork of microsoft/winget-pkgs is present. This fork will be used to create the pull request.

fork-user: dotnet-winget-bot # for example purposes only

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Baptiste Augrain
Baptiste Augrain

💻 🤔
Kei Touge
Kei Touge

🐛
Maxim
Maxim

🐛
Russell Banks
Russell Banks

🤔 📖
Tim Brinkley
Tim Brinkley

🐛 💵
Vedant
Vedant

💻
sitiom
sitiom

📖 🐛 💻

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