Winget

Winget is a comprehensive package manager solution that consists of a command line tool and set of services for installing applications on Windows 10 and Windows 11.

JReleaser can generate and publish Winget manifests into a repository that you have access to. This packager generates a set fo files and publishes them to a repository of your choice, however it’s your responsibility to update the official Windows Package Manager Community Repository with a PR of your own.

The following artifact extensions are supported by this packager:

  • .msi

  • .exe

  • .zip

Distribution Support

Distribution Supported

Binary

Flat Binary

Java Binary

Jlink

Native Image

Native Package

Single JAR

Publication of snapshots is not allowed.

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
packagers:
  # 
  winget:
    # Enables or disables Winget.
    # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `NEVER`.
    #  
    active: ALWAYS

    # Let the release continue if the packager fails.
    # Defaults to `false`.
    # 
    continueOnError: true

    # Custom download URL.
    #  
    downloadUrl: https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}

    # Additional properties used when evaluating templates.
    #  
    extraProperties:
      # Key will be capitalized and prefixed with `winget`, i.e, `wingetFoo`.
      foo: bar

    # Directory with file templates used to prepare the Winget distribution.
    # Defaults to `src/jreleaser/distributions/#{distribution.name}/winget`.
    # If specified, path must exist.
    # 
    templateDirectory: path/to/winget/templates

    # List of template files to be skipped.
    # Value may be an exact match or a regex.
    # 
    skipTemplates:
      - README.md.tpl

    # Git author used to commit to the repository.
    # 
    commitAuthor:
      # Name used when authoring commits.
      # Defaults to `jreleaserbot`.
      # 
      name: jreleaserbot

      # E-mail used when authoring commits.
      # Defaults to `jreleaser@kordamp.org`.
      # 
      email: jreleaser@kordamp.org

    # Git repository to push the manifest to.
    # Defaults are shown.
    # 
    repository:
      # Enables or disables the repository.
      # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      # Defaults to `RELEASE`.
      # 
      active: ALWAYS


      # The owner of the repository.
      # Defaults to the same owner as the release repository.
      # 
      owner: duke

      # The name of the repository.
      # Defaults to `winget-app`.
      # 
      name: winget-app

      # The tag associated with the manifest.
      # If left unspecified, will use `{{tagName}}`.
      #  
      tagName: '{{distributionName}}-{{tagName}}'

      # The target branch to pull from.
      # Defaults to the branch pointed by HEAD.
      #  
      branch: HEAD

      # The target branch to push to.
      # Defaults to the branch pointed by `#{branch}`.
      #   
      branchPush: '{{projectName}}-{{tagName}}'

      # Username used for authoring commits.
      # Must have write access to the repository.
      # Defaults to the same username as the release repository.
      #  
      username: duke

      # Password or OAuth token with write access to the repository.
      #  
      token: __USE_ENVIRONMENT_VARIABLE__

      # Message when committing to the repository.
      # If left unspecified, `{{distributionName}} {{tagName}}` will be used.
      #  
      commitMessage: '{{distributionName}} {{tagName}}'

    # The default package meta-data locale.
    # Defaults to `en-US`.
    #  
    defaultLocale: 'en-US'

    # The package author.
    # Defaults to `#{project.author}`.
    # 
    author: 'Duke'

    # The most common package term.
    # Defaults to `{{distributionExecutable}}`.
    #  
    moniker: app

    # The installer minimum operating system version.
    # Defaults to `10.0.0.0`.
    # 
    minimumOsVersion: '10.0.0.0'

    # ProductCode could be used for correlation of packages across sources.
    # Defaults to `{{distributionName}} {{productVersion}}`.
    # See https://learn.microsoft.com/en-us/windows/win32/msi/productcode
    #  
    productCode: '{12345678-1234-1234-1234-123456789012}'

    # List of additional package search terms.
    # 
    tags:
      - cli
      - awesome

    # 
    package:

      # The package unique identifier.
      # Defaults to `{{projectVendor}}.{{distributionName}}`.
      #  
      identifier: 'Acme.app'

      # The package version.
      # Defaults to `{{distributionName}}`.
      #  
      name: 'app'

      # The package version.
      # Defaults to `{{projectVersion}}`.
      #  
      version: '1.2.3'

      # The package home page.
      # Defaults to `{{projectLinkHomepage}}`.
      #  
      url: 'https://acme.com/app'

    # 
    publisher:

      # The publisher name.
      # Defaults to `{{projectVendor}}`.
      #  
      name: 'Acme'

      # The publisher home page.
      # Defaults to `{{projectLinkHomepage}}`.
      #  
      url: https://acme.com/app

      # The publisher support page.
      # Defaults to `{{projectLinkBugTracker}}`.
      #  
      supportUrl: https://acme.com/app/support

    # 
    installer:

      # Supported installer types.
      # Valid values are [`MSIX`, `MSI`, `APPX`, `EXE`, `ZIP`, `INNO`, `NULLSOFT`, `WIX`, `BURN`, `PWA`].
      # Defaults to `WIX`.
      # 
      type: WIX

      # Scope indicates if the installer is per user or per machine.
      # Valid values are [`USER`, `MACHINE`].
      # Defaults to `MACHINE`.
      # 
      scope: MACHINE

      # List of supported installer modes.
      # Valid values are [`SILENT`, `SILENT_WITH_PROGRESS`, `INTERACTIVE`].
      # Defaults to [`SILENT`, `SILENT_WITH_PROGRESS`].
      # 
      modes:
        - SILENT

      # The upgrade method.
      # Valid values are [`INSTALL`, `UNINSTALL_PREVIOUS`].
      # Defaults to `INSTALL`.
      # 
      upgradeBehavior: INSTALL

      # Command or alias to run the package.
      # Defaults to `{{distributionExecutable}}`.
      #  
      command: app

      # 
      dependencies:
        # List of Windows feature dependencies.
        # 
        windowsFeatures:
          - some_feature

        # List of Windows library dependencies.
        # 
        windowsLibraries:
          - some_library

        # List of external package dependencies
        # 
        externalDependencies:
          - some_dependency

        # List of package dependencies from current source.
        # 
        packageDependencies:
          - packageIdentifier: Microsoft.OpenJDK.11
            minimumVersion: 11
# 
[packagers.winget]
  # Enables or disables Winget.
  # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  #  
  active = "ALWAYS"

  # Let the release continue if the packager fails.
  # Defaults to `false`.
  # 
  continueOnError = true

  # Custom download URL.
  #  
  downloadUrl = "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}"

  # Additional properties used when evaluating templates.
  #  
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `winget`, i.e, `wingetFoo`.

  # Directory with file templates used to prepare the Winget distribution.
  # Defaults to `src/jreleaser/distributions/#{distribution.name}/winget`.
  # If specified, path must exist.
  # 
  templateDirectory = "path/to/winget/templates"

  # List of template files to be skipped.
  # Value may be an exact match or a regex.
  # 
  skipTemplates = [ "README.md.tpl" ]

  # Git author used to commit to the repository.

  # Name used when authoring commits.
  # Defaults to `jreleaserbot`.
  # 
  commitAuthor.name = "jreleaserbot"

  # E-mail used when authoring commits.
  # Defaults to `jreleaser@kordamp.org`.
  # 
  commitAuthor.email = "jreleaser@kordamp.org"

  # Git repository to push the manifest to.
  # Defaults are shown.

  # Enables or disables the repository.
  # Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `RELEASE`.
  # 
  repository.active = "ALWAYS"


  # The owner of the repository.
  # Defaults to the same owner as the release repository.
  # 
  repository.owner = "duke"

  # The name of the repository.
  # Defaults to `winget-app`.
  # 
  repository.name = "winget-app"

  # The tag associated with the manifest.
  # If left unspecified, will use `{{tagName}}`.
  #  
  repository.tagName = "{{distributionName}}-{{tagName}}"

  # The target branch to pull from.
  # Defaults to the branch pointed by HEAD.
  #  
  repository.branch = "HEAD"

  # The target branch to push to.
  # Defaults to the branch pointed by `#{branch}`.
  #    
  repository.branchPush = "{{projectName}}-{{tagName}}"

  # Username used for authoring commits.
  # Must have write access to the repository.
  # Defaults to the same username as the release repository.
  #  
  repository.username = "duke"

  # Password or OAuth token with write access to the repository.
  #  
  repository.token = "__USE_ENVIRONMENT_VARIABLE__"

  # Message when committing to the repository.
  # If left unspecified, `{{distributionName}} {{tagName}}` will be used.
  #  
  repository.commitMessage = "{{distributionName}} {{tagName}}"

  # The default package meta-data locale.
  # Defaults to `en-US`.
  #  
  defaultLocale = "en-US"

  # The package author.
  # Defaults to `#{project.author}`.
  # 
  author = "Duke"

  # The most common package term.
  # Defaults to `{{distributionExecutable}}`.
  #  
  moniker: "app"

  # The installer minimum operating system version.
  # Defaults to `10.0.0.0`.
  # 
  minimumOsVersion = "10.0.0.0"

  # ProductCode could be used for correlation of packages across sources.
  # Defaults to `{{distributionName}} {{productVersion}}`.
  # See https://learn.microsoft.com/en-us/windows/win32/msi/productcode
  #  
  productCode = "{12345678-1234-1234-1234-123456789012}"

  # List of additional package search terms.
  # 
  tags: = ["cli", "awesome"]

  # The package unique identifier.
  # Defaults to `{{projectVendor}}.{{distributionName}}`.
  #  
  package.identifier = "Acme.app"

  # The package version.
  # Defaults to `{{distributionName}}`.
  #  
  package.name = "app"

  # The package version.
  # Defaults to `{{projectVersion}}`.
  #  
  package.version = "1.2.3"

  # The package home page.
  # Defaults to `{{projectLinkHomepage}}`.
  #  
  package.url = "https://acme.com/app"

  # The publisher name.
  # Defaults to `{{projectVendor}}`.
  #  
  publisher.name = "Acme"

  # The publisher home page.
  # Defaults to `{{projectLinkHomepage}}`.
  #  
  publisher.url: https://acme.com/app

  # The publisher support page.
  # Defaults to `{{projectLinkBugTracker}}`.
  #  
  publisher.supportUrl: https://acme.com/app/support

  # Supported installer types.
  # Valid values are [`MSIX`, `MSI`, `APPX`, `EXE`, `ZIP`, `INNO`, `NULLSOFT`, `WIX`, `BURN`, `PWA`].
  # Defaults to `WIX`.
  # 
  installer.type = "WIX"

  # Scope indicates if the installer is per user or per machine.
  # Valid values are [`USER`, `MACHINE`].
  # Defaults to `MACHINE`.
  # 
  installer.scope = "MACHINE"

  # List of supported installer modes.
  # Valid values are [`SILENT`, `SILENT_WITH_PROGRESS`, `INTERACTIVE`].
  # Defaults to [`SILENT`, `SILENT_WITH_PROGRESS`].
  # 
  installer.modes = ["SILENT"]

  # The upgrade method.
  # Valid values are [`INSTALL`, `UNINSTALL_PREVIOUS`].
  # Defaults to `INSTALL`.
  # 
  installer.upgradeBehavior = "INSTALL"

  # Command or alias to run the package.
  # Defaults to `{{distributionExecutable}}`.
  #  
  installer.command = "app"

  # 
  [packagers.winget.installer.dependencies]
    # List of Windows feature dependencies.
    # 
    windowsFeatures =["some_feature"]

    # List of Windows library dependencies.
    # 
    windowsLibraries = ["some_library"]

    # List of external package dependencies
    # 
    externalDependencies = ["some_dependency"]

    # List of package dependencies from current source.
    # 
    packageDependencies = [
      {packageIdentifier = "Microsoft.OpenJDK.11" , minimumVersion: "11"}
    ]
{
  // 
  "packagers": {
    // 
    "winget": {
      // Enables or disables Winget.
      // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      //  
      "active": "ALWAYS",

      // Let the release continue if the packager fails.
      // Defaults to `false`.
      // 
      "continueOnError": true,

      // Custom download URL.
      //  
      "downloadUrl": "https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}",

      // Additional properties used when evaluating templates.
      //  
      "extraProperties": {
        // Key will be capitalized and prefixed with `winget`, i.e, `wingetFoo`.
        "foo": "bar"
      },

      // Directory with file templates used to prepare the Winget distribution.
      // Defaults to `src/jreleaser/distributions/#{distribution.name}/winget`.
      // If specified, path must exist.
      // 
      "templateDirectory": "path/to/winget/templates",

      // List of template files to be skipped.
      // Value may be an exact match or a regex.
      // 
      "skipTemplates": [
        "README.md.tpl"
      ],

      // Git author used to commit to the repository.
      // 
      "commitAuthor": {
        // Name used when authoring commits.
        // Defaults to `jreleaserbot`.
        // 
        "name": "jreleaserbot",

        // E-mail used when authoring commits.
        // Defaults to `jreleaser@kordamp.org`.
        // 
        "email": "jreleaser@kordamp.org"
      },

      // Git repository to push the manifest to.
      // Defaults are shown.
      // 
      "repository": {
        // Enables or disables the repository.
        // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        // Defaults to `RELEASE`.
        // 
        "active": "ALWAYS",


        // The owner of the repository.
        // Defaults to the same owner as the release repository.
        // 
        "owner": "duke",

        // The name of the repository.
        // Defaults to `winget-app`.
        // 
        "name": "winget-app",

        // The tag associated with the manifest.
        // If left unspecified, will use `{{tagName}}`.
        //  
        "tagName": "{{distributionName}}-{{tagName}}",

        // The target branch to pull from.
        // Defaults to the branch pointed by HEAD.
        //  
        "branch": "HEAD",

        // The target branch to push to.
        // Defaults to the branch pointed by `#{branch}`.
        //   
        "branchPush": "{{projectName}}-{{tagName}}",

        // Username used for authoring commits.
        // Must have write access to the repository.
        // Defaults to the same username as the release repository.
        //  
        "username": "duke",

        // Password or OAuth token with write access to the repository.
        //  
        "token": "__USE_ENVIRONMENT_VARIABLE__",

        // Message when committing to the repository.
        // If left unspecified, `{{distributionName}} {{tagName}}` will be used.
        //  
        "commitMessage": "{{distributionName}} {{tagName}}"
      },

      // The default package meta-data locale.
      // Defaults to `en-US`.
      //  
      "defaultLocale": "en-US",

      // The package author.
      // Defaults to `#{project.author}`.
      // 
      "author": "Duke",

      // The most common package term.
      // Defaults to `{{distributionExecutable}}`.
      //  
      "moniker": "app",

      // The installer minimum operating system version.
      // Defaults to `10.0.0.0`.
      // 
      "minimumOsVersion": "10.0.0.0",

      // ProductCode could be used for correlation of packages across sources.
      // Defaults to `{{distributionName}} {{productVersion}}`.
      // See https://learn.microsoft.com/en-us/windows/win32/msi/productcode
      //  
      "productCode": "{12345678-1234-1234-1234-123456789012}",

      // List of additional package search terms.
      // 
      "tags": [
        "cli",
        "awesome"
      ],

      // 
      "package": {
        // The package unique identifier.
        // Defaults to `{{projectVendor}}.{{distributionName}}`.
        //  
        "identifier": "Acme.app",

        // The package version.
        // Defaults to `{{distributionName}}`.
        //  
        "name": "app",

        // The package version.
        // Defaults to `{{projectVersion}}`.
        //  
        "version": "1.2.3",

        // The package home page.
        // Defaults to `{{projectLinkHomepage}}`.
        //  
        "url": "https://acme.com/app"
      },

      // 
      "publisher": {
        // The publisher name.
        // Defaults to `{{projectVendor}}`.
        //  
        "name": "Acme",

        // The publisher home page.
        // Defaults to `{{projectLinkHomepage}}`.
        //  
        "url": "https://acme.com/app",

        // The publisher support page.
        // Defaults to `{{projectLinkBugTracker}}`.
        //  
        "supportUrl": "https://acme.com/app/support"
      },

      // 
      "installer": {
        // Supported installer types.
        // Valid values are [`MSIX`, `MSI`, `APPX`, `EXE`, `ZIP`, `INNO`, `NULLSOFT`, `WIX`, `BURN`, `PWA`].
        // Defaults to `WIX`.
        // 
        "type": "WIX",

        // Scope indicates if the installer is per user or per machine.
        // Valid values are [`USER`, `MACHINE`].
        // Defaults to `MACHINE`.
        // 
        "scope": "MACHINE",

        // List of supported installer modes.
        // Valid values are [`SILENT`, `SILENT_WITH_PROGRESS`, `INTERACTIVE`].
        // Defaults to [`SILENT`, `SILENT_WITH_PROGRESS`].
        // 
        "modes": [
          "SILENT"
        ],

        // The upgrade method.
        // Valid values are [`INSTALL`, `UNINSTALL_PREVIOUS`].
        // Defaults to `INSTALL`.
        // 
        "upgradeBehavior": "INSTALL",

        // Command or alias to run the package.
        // Defaults to `{{distributionExecutable}}`.
        //  
        "command": "app",

        // 
        "dependencies": {
          // List of Windows feature dependencies.
          // 
          "windowsFeatures": [
            "some_feature"
          ],

          // List of Windows library dependencies.
          // 
          "windowsLibraries": [
            "some_library"
          ],

          // List of external package dependencies
          // 
          "externalDependencies": [
            "some_dependency"
          ],

          // List of package dependencies from current source.
          // 
          "packageDependencies": [
            {
              "packageIdentifier": "Microsoft.OpenJDK.11",
              "minimumVersion": "11"
            }
          ]
        }
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <packagers>
    <!--
      
    -->
    <winget>
      <!--
        Enables or disables Winget.
        Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
         
      -->
      <active>ALWAYS</active>

      <!--
        Let the release continue if the packager fails.
        Defaults to `false`.
        
      -->
      <continueOnError>true</continueOnError>

      <!--
        Custom download URL.
         
      -->
      <downloadUrl>https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}</downloadUrl>

      <!--
        Additional properties used when evaluating templates.
         
      -->
      <extraProperties>
        <!--
          Key will be capitalized and prefixed with `winget`, i.e, `wingetFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>

      <!--
        Directory with file templates used to prepare the Winget distribution.
        Defaults to `src/jreleaser/distributions/#{distribution.name}/winget`.
        If specified, path must exist.
        
      -->
      <templateDirectory>path/to/winget/templates</templateDirectory>

      <!--
        List of template files to be skipped.
        Value may be an exact match or a regex.
        
      -->
      <skipTemplates>
        <skipTemplate>README.md.tpl</skipTemplate>
      </skipTemplates>

      <!--
        Git author used to commit to the repository.
        
      -->
      <commitAuthor>

        <!--
           Name used when authoring commits.
          Defaults to `jreleaserbot`.
          
        -->
        <name>jreleaserbot</name>

        <!--
          E-mail used when authoring commits.
          Defaults to `jreleaser@kordamp.org`.
          
        -->
        <email>jreleaser@kordamp.org</email>
      </commitAuthor>

      <!--
        Git repository to push the manifest to.
        Defaults are shown.
        
      -->
      <repository>
        <!--
          Enables or disables the repository.
          Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
          Defaults to `RELEASE`.
          
        -->
        <active>ALWAYS</active>


        <!--
          The owner of the repository.
          Defaults to the same owner as the release repository.
          
        -->
        <owner>duke</owner>

        <!--
          The name of the repository.
          Defaults to `winget-app`.
          
        -->
        <name>winget-app</name>

        <!--
          The tag associated with the manifest.
          If left unspecified, will use `{{tagName}}`.
           
        -->
        <tagName>{{distributionName}}-{{tagName}}</tagName>

        <!--
          The target branch to pull from.
          Defaults to the branch pointed by HEAD.
           
        -->
        <branch>HEAD</branch>

        <!--
          The target branch to push to.
          Defaults to the branch pointed by `#{branch}`.
            
        -->
        <branchPush>{{projectName}}-{{tagName}}</branchPush>

        <!--
          Username used for authoring commits.
          Must have write access to the repository.
          Defaults to the same username as the release repository.
           
        -->
        <username>duke</username>

        <!--
          Password or OAuth token with write access to the repository.
           
        -->
        <token>__USE_ENVIRONMENT_VARIABLE__</token>

        <!--
          Message when committing to the repository.
          If left unspecified, `{{distributionName}} {{tagName}}` will be used.
           
        -->
        <commitMessage>{{distributionName}} {{tagName}}</commitMessage>
      </repository>

      <!--
        The default package meta-data locale.
        Defaults to `en-US`.
         
      -->
      <defaultLocale>en-US</defaultLocale>

      <!--
        The package author.
        Defaults to `#{project.author}`.
        
      -->
      <author>Duke</author>

      <!--
        The most common package term.
        Defaults to `{{distributionExecutable}}`.
         
      -->
      <moniker>app</moniker>

      <!--
        The installer minimum operating system version.
        Defaults to `10.0.0.0`.
        
      -->
      <minimumOsVersion>10.0.0.0</minimumOsVersion>

        ProductCode could be used for correlation of packages across sources.
        Defaults to `{{distributionName}} {{productVersion}}`.
        See https://learn.microsoft.com/en-us/windows/win32/msi/productcode
         
      -->
      <productCode>{12345678-1234-1234-1234-123456789012}</productCode>

      <!--
        List of additional package search terms.
        
      -->
      <tags>
        <tag>cli</tag>
        <tag>awesome</tag>
      </tags>

      <!--
        
      -->
      <package>
        <!--
          The package unique identifier.
          Defaults to `{{projectVendor}}.{{distributionName}}`.
           
        -->
        <identifier>Acme.app</identifier>

        <!--
          The package version.
          Defaults to `{{distributionName}}`.
           
        -->
        <name>app</name>

        <!--
          The package version.
          Defaults to `{{projectVersion}}`.
           
        -->
        <version>1.2.3</version>

        <!--
          The package home page.
          Defaults to `{{projectLinkHomepage}}`.
           
        -->
        <url>https://acme.com/app</url>
      </package>

      <!--
        
      -->
      <publisher>
        <!--
          The publisher name.
          Defaults to `{{projectVendor}}`.
           
        -->
        <name>Acme</name>

        <!--
          The publisher home page.
          Defaults to `{{projectLinkHomepage}}`.
           
        -->
        <url>https://acme.com/app</url>

        <!--
          The publisher support page.
          Defaults to `{{projectLinkBugTracker}}`.
           
        -->
        <supportUrl>https://acme.com/app/support</supportUrl>
      </publisher>

      <!--
        
      -->
      <installer>
        <!--
          Supported installer types.
          Valid values are [`MSIX`, `MSI`, `APPX`, `EXE`, `ZIP`, `INNO`, `NULLSOFT`, `WIX`, `BURN`, `PWA`].
          Defaults to `WIX`.
          
        -->
        <type>WIX</type>

        <!--
          Scope indicates if the installer is per user or per machine.
          Valid values are [`USER`, `MACHINE`].
          Defaults to `MACHINE`.
          
        -->
        <scope>MACHINE</scope>

        <!--
          List of supported installer modes.
          Valid values are [`SILENT`, `SILENT_WITH_PROGRESS`, `INTERACTIVE`].
          Defaults to [`SILENT`, `SILENT_WITH_PROGRESS`].
          
        -->
        <modes>
          </mode>SILENT</mode>
        </modes>

        <!--
          The upgrade method.
          Valid values are [`INSTALL`, `UNINSTALL_PREVIOUS`].
          Defaults to `INSTALL`.
          
        -->
        <upgradeBehavior>INSTALL</upgradeBehavior>

        <!--
          Command or alias to run the package.
          Defaults to `{{distributionExecutable}}`.
           
        -->
        <command>app</command>

        <!--
          
        -->
        <dependencies>
          <!--
            List of Windows feature dependencies.
            
          -->
          <windowsFeatures>
            <windowsFeature> some_feature</windowsFeature>
          </windowsFeatures>

          <!--
            List of Windows library dependencies.
            
          -->
          <windowsLibraries>
            <windowsLibrary>some_library</windowsLibrary>
          </windowsLibraries>

          <!--
            List of external package dependencies
            
          -->
          <externalDependencies>
            <externalDependency>some_dependency</externalDependency>
          </externalDependencies>

          <!--
            List of package dependencies from current source.
            
          -->
          <packageDependencies>
            <packageDependency>
              <packageIdentifier>Microsoft.OpenJDK.11</packageIdentifier>
              <minimumVersion>11</minimumVersion>
            </packageDependency>
          </packageDependencies>
        </dependencies>
      </installer>
    </winget>
  </packagers>
</jreleaser>
jreleaser {
  // 
  packagers {
    // 
    winget {
      // Enables or disables Winget.
      // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      //  
      active = 'ALWAYS'

      // Let the release continue if the packager fails.
      // Defaults to `false`.
      // 
      continueOnError = true

      // Custom download URL.
      //  
      downloadUrl = 'https://my.server.com/{{projectName}}/{{tagName}}/{{artifactFile}}'

      // Additional properties used when evaluating templates.
      // Key will be capitalized and prefixed with `winget`, i.e, `wingetFoo`.
      //  
      extraProperties.put('foo', 'bar')

      // Directory with file templates used to prepare the Winget distribution.
      // Defaults to `src/jreleaser/distributions/#{distribution.name}/winget`.
      // If specified, path must exist.
      // 
      templateDirectory = 'path/to/winget/templates'

      // List of template files to be skipped.
      // Value may be an exact match or a regex.
      // 
      skipTemplate('README.md.tpl')

      // Git author used to commit to the repository.
      // 
      commitAuthor {
        // Name used when authoring commits.
        // Defaults to `jreleaserbot`.
        // 
        name = 'jreleaserbot'

        // E-mail used when authoring commits.
        // Defaults to `jreleaser@kordamp.org`.
        // 
        email = 'jreleaser@kordamp.org'
      }

      // Git repository to push the manifest to.
      // Defaults are shown.
      // 
      repository {
        // Enables or disables the repository.
        // Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        // Defaults to `RELEASE`.
        // 
        active = 'ALWAYS'


        // The owner of the repository.
        // Defaults to the same owner as the release repository.
        // 
        repoOwner = 'duke'

        // The name of the repository.
        // Defaults to `winget-app`.
        // 
        name = 'winget-app'

        // The tag associated with the manifest.
        // If left unspecified, will use `{{tagName}}`.
        //  
        tagName = '{{distributionName}}-{{tagName}}'

        // The target branch to pull from.
        // Defaults to the branch pointed by HEAD.
        //  
        branch = 'HEAD'

        // The target branch to push to.
        // Defaults to the branch pointed by `#{branch}`.
        //   
        branchPush = '{{projectName}}-{{tagName}}'

        // Username used for authoring commits.
        // Must have write access to the repository.
        // Defaults to the same username as the release repository.
        //  
        username = 'duke'

        // Password or OAuth token with write access to the repository.
        //  
        token = '__USE_ENVIRONMENT_VARIABLE__'

        # Message when committing to the repository.
        # If left unspecified, `{{distributionName}} {{tagName}}` will be used.
        #  
        commitMessage = '{{distributionName}} {{tagName}}'
      }

      // The default package meta-data locale.
      // Defaults to `en-US`.
      //  
      defaultLocale = 'en-US'

      // The package author.
      // Defaults to `#{project.author}`.
      // 
      author = 'Duke'

      // The most common package term.
      // Defaults to `{{distributionExecutable}}`.
      //  
      moniker = 'app'

      // The installer minimum operating system version.
      // Defaults to `10.0.0.0`.
      // 
      minimumOsVersion = '10.0.0.0'

      // ProductCode could be used for correlation of packages across sources.
      // Defaults to `{{distributionName}} {{productVersion}}`.
      // See https://learn.microsoft.com/en-us/windows/win32/msi/productcode
      //  
      productCode = '{12345678-1234-1234-1234-123456789012}'

      // List of additional package search terms.
      // 
      tags = ['cli', 'awesome']

      // 
      wingetPackage {
        // The package unique identifier.
        // Defaults to `{{projectVendor}}.{{distributionName}}`.
        //  
        identifier = 'Acme.app'

        // The package version.
        // Defaults to `{{distributionName}}`.
        //  
        name = 'app'

        // The package version.
        // Defaults to `{{projectVersion}}`.
        //  
        version = '1.2.3'

        // The package home page.
        // Defaults to `{{projectLinkHomepage}}`.
        //  
        url = 'https://acme.com/app'
      }

      // 
      publisher {
        // The publisher name.
        // Defaults to `{{projectVendor}}`.
        //  
        name = 'Acme'

        // The publisher home page.
        // Defaults to `{{projectLinkHomepage}}`.
        //  
        url = 'https://acme.com/app'

        // The publisher support page.
        // Defaults to `{{projectLinkBugTracker}}`.
        //  
        supportUrl = 'https://acme.com/app/support'
      }

      // 
      installer {
        // Supported installer types.
        // Valid values are [`MSIX`, `MSI`, `APPX`, `EXE`, `ZIP`, `INNO`, `NULLSOFT`, `WIX`, `BURN`, `PWA`].
        // Defaults to `WIX`.
        // 
        type = 'WIX'

        // Scope indicates if the installer is per user or per machine.
        // Valid values are [`USER`, `MACHINE`].
        // Defaults to `MACHINE`.
        // 
        scope = 'MACHINE'

        // List of supported installer modes.
        // Valid values are [`SILENT`, `SILENT_WITH_PROGRESS`, `INTERACTIVE`].
        // Defaults to [`SILENT`, `SILENT_WITH_PROGRESS`].
        // 
        modes = ['SILENT']

        // The upgrade method.
        // Valid values are [`INSTALL`, `UNINSTALL_PREVIOUS`].
        // Defaults to `INSTALL`.
        // 
        upgradeBehavior = 'INSTALL'

        // Command or alias to run the package.
        // Defaults to `{{distributionExecutable}}`.
        //  
        command = 'app'

        // 
        dependencies {
          // List of Windows feature dependencies.
          // 
          windowsFeature('some_feature')

          // List of Windows library dependencies.
          // 
          windowsLibrary('some_library')

          // List of external package dependencies
          // 
          externalDependency('some_dependency')

          // List of package dependencies from current source.
          // 
          packageDependency {
            packageIdentifier = 'Microsoft.OpenJDK.11'
            minimumVersion = '11'
          }
        }
      }
    }
  }
}

Environment

When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.

Inside packagers section

System Property Environment Variable

active

jreleaser.packagers.winget.active

JRELEASER_PACKAGERS_WINGET_ACTIVE

Inside distributions section

System Property Environment Variable

active

jreleaser.distributions.${name}.winget.active

JRELEASER_DISTRIBUTIONS_${name}_WINGET_ACTIVE

repository.active

jreleaser.distributions.${name}.winget.repository.active

JRELEASER_DISTRIBUTIONS_${name}_WINGET_REPOSITORY_ACTIVE

repository.username

jreleaser.distributions.${name}.winget.repository.username
jreleaser.winget.github.username
jreleaser.winget.gitlab.username
jreleaser.winget.gitea.username
jreleaser.winget.codeberg.username
jreleaser.github.username
jreleaser.gitlab.username
jreleaser.gitea.username
jreleaser.codeberg.username

JRELEASER_DISTRIBUTIONS_${name}_WINGET_REPOSITORY_USERNAME
JRELEASER_WINGET_GITHUB_USERNAME
JRELEASER_WINGET_GITLAB_USERNAME
JRELEASER_WINGET_GITEA_USERNAME
JRELEASER_WINGET_CODEBERG_USERNAME
JRELEASER_GITHUB_USERNAME
JRELEASER_GITLAB_USERNAME
JRELEASER_GITEA_USERNAME
JRELEASER_CODEBERG_USERNAME

repository.token

jreleaser.distributions.${name}.winget.repository.token
jreleaser.winget.github.token
jreleaser.winget.gitlab.token
jreleaser.winget.gitea.token
jreleaser.winget.codeberg.token
jreleaser.github.token
jreleaser.gitlab.token
jreleaser.gitea.token
jreleaser.codeberg.token

JRELEASER_DISTRIBUTIONS_${name}_WINGET_REPOSITORY_TOKEN
JRELEASER_WINGET_GITHUB_TOKEN
JRELEASER_WINGET_GITLAB_TOKEN
JRELEASER_WINGET_GITEA_TOKEN
JRELEASER_WINGET_CODEBERG_TOKEN
JRELEASER_GITHUB_TOKEN
JRELEASER_GITLAB_TOKEN
JRELEASER_GITEA_TOKEN
JRELEASER_CODEBERG_TOKEN

repository.branch

jreleaser.distributions.${name}.winget.repository.branch
jreleaser.winget.github.branch
jreleaser.winget.gitlab.branch
jreleaser.winget.gitea.branch
jreleaser.winget.codeberg.branch
jreleaser.github.branch
jreleaser.gitlab.branch
jreleaser.gitea.branch
jreleaser.codeberg.branch

JRELEASER_DISTRIBUTIONS_${name}_WINGET_REPOSITORY_BRANCH
JRELEASER_WINGET_GITHUB_BRANCH
JRELEASER_WINGET_GITLAB_BRANCH
JRELEASER_WINGET_GITEA_BRANCH
JRELEASER_WINGET_CODEBERG_BRANCH
JRELEASER_GITHUB_BRANCH
JRELEASER_GITLAB_BRANCH
JRELEASER_GITEA_BRANCH
JRELEASER_CODEBERG_BRANCH

repository.branchPush

jreleaser.distributions.${name}.winget.repository.branch.push
jreleaser.winget.github.branch.push
jreleaser.winget.gitlab.branch.push
jreleaser.winget.gitea.branch.push
jreleaser.winget.codeberg.branch.push
jreleaser.github.branch.push
jreleaser.gitlab.branch.push
jreleaser.gitea.branch.push
jreleaser.codeberg.branch.push

JRELEASER_DISTRIBUTIONS_${name}_WINGET_REPOSITORY_BRANCH_PUSH
JRELEASER_WINGET_GITHUB_BRANCH_PUSH
JRELEASER_WINGET_GITLAB_BRANCH_PUSH
JRELEASER_WINGET_GITEA_BRANCH_PUSH
JRELEASER_WINGET_CODEBERG_BRANCH_PUSH
JRELEASER_GITHUB_BRANCH_PUSH
JRELEASER_GITLAB_BRANCH_PUSH
JRELEASER_GITEA_BRANCH_PUSH
JRELEASER_CODEBERG_BRANCH_PUSH

Substitute ${name} for the value of the named instance.

Space (' '), underscore (_), and dash (-) will be replaced by dot (.) to separate tokens in the System property. Space (' '), dash (-), and dot (.) will be replaced by underscore (_) to separate tokens in the environment variable, such that:

${name} System Property Environment Variable

foobar

foobar

FOOBAR

fooBar

foobar

FOOBAR

foo bar

foo.bar

FOO_BAR

foo-bar

foo.bar

FOO_BAR

foo_bar

foo.bar

FOO_BAR

foo.bar

foo.bar

FOO_BAR

Tokens

The repository token environment variable must match with the chosen Release service.

On GitHub, you can’t use the default secrets.GITHUB_TOKEN as this token only works for the repository that’s running the workflow. You must configure a Personal Access Token (PAT) instead. It is recommended that you use "fine-grained" PATs, rather than "classic" ones. The token must have:

  • Access to your tap repository; if this repository is part of a GitHub organization, make sure to choose that organization as the resource owner; if that organization doesn’t show up in the "resource owner" drop-down, contact your organization adminstrator and ask them to enable PAT access for that repository

  • The "Contents read and write" repository permission

DownloadURL

JReleaser follows these rules to find the download URL to use for a given artifact:

  1. if artifact.extraProperties.wingetDownloadUrl exists, use it.

  2. if artifact.extraProperties.downloadUrl exists, use it.

  3. if explicit downloadUrl is set on winget, use it.

  4. if distribution.extraProperties.wingetDownloadUrl exists, use it.

  5. if distribution.extraProperties.downloadUrl exists, use it.

  6. if releaser.${release}.skipRelease is false then use the releaser’s downloadUrl.

  7. if releaser.${release}.skipRelease is true then look for a matching uploader given an extraProperty named downloadUrlFrom on artifact, distribution, `winget (in that order). The value must be <uploaderType>:<uploaderName> such as "artifactory:app" or "s3:uploads".

  8. fail if no suitable URL is found.

With no extra configuration from your side rule 6. will be chosen which is the suitable default that most projects need.

Additional Locale Files

You may configure additional locale files other than the default. Place them in the same directory as the configured templateDirectory (default is src/jreleaser/distributions/<distribution-name>/winget) using the following naming convention: locale.<value>.yaml.tpl, where <value> is a valid locale identifier. For example, adding a locale file for fr-FR results in a file named locale.fr-FR.yaml.tpl.

Templates

The default location for templates is:

src/jreleaser/distributions/<distribution-name>/winget

The following list shows the filenames that may be used to override default templates:

  • installer.yaml.tpl

  • locale.yaml.tpl

  • version.yaml.tpl

Any additional files found in the template directories will be copied as is unless their filename ends with .tpl in which case Name Templates substitution will take place.

Templates may be initialized using the template command

Skip Templates

You may skip any template files by defining a set of skip rules in the skipTemplates property. For example, you may use any of these expressions to skip a template named README.md.tpl:

  • README.md.tpl: matches the full template name

  • README.md: matches the transformed template name

  • README.*: matches using a regex

Skip Artifacts

If there is more than one matching artifact in a given distribution you may add a skipWinget extra property to the target artifact to mark it as skipped for packaging with winget.

Skip License

If there’s a matching LICENSE file available at the root of the project it will be copied to the repository by default. You may set an extra property named skipLicenseFile on winget to skip this behavior.