Flatpak

Flatpak is a framework for distributing desktop applications across various Linux distributions. It has been created by developers who have a long history of working on the Linux desktop, and is run as an independent open source project.

We recommend reading the Upstream Metadata and the Flatpak manifest documentation as Flatpak depends on them.

The following artifact extensions are supported by this packager:

  • .tgz

  • .txz

  • .tar.gz

  • .tar.xz

  • .tar

  • .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:
  # 
  flatpak:
    # Enables or disables Flatpak.
    # 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 `flatpak`, i.e, `flatpakFoo`.
      foo: bar

    # Directory with file templates used to prepare the Flatpak distribution.
    # Defaults to `src/jreleaser/distributions/#{distribution.name}/flatpak`.
    # If specified, path must exist.
    # 
    templateDirectory: path/to/flatpak/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 `com.acme.duke`.
      # 
      name: com.acme.duke

      # 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}}'

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

    # Unique identifier for this component.
    # See <id>
    # 
    componentId: com.acme.app

    # The categories this software component is associated with
    # See <categories>
    # 
    categories:
      - Development

    # Represent the developers or project responsible for development of the project.
    # See <developer_name>
    # Defaults to the project's authors separated by comma.
    # 
    developerName: Duke

    # Sets the Flatpak runtime and Sdk.
    # Valid values are [`FREEDESKTOP`, `GNOME`, `KDE`, `ELEMENTARY`].
    # See Available Runtimes.
    # 
    runtime: FREEDESKTOP

    # The runtime's version to use.
    # 
    runtimeVersion: '21.08'

    # List of Sdk extensions to apply.
    # 
    sdkExtensions:
      - org.flatpack.custom.extension

    # List of sandbox permissions.
    # 
    finishArgs:
      - '--share=network'

    # Releases to be skipped from the list of releases.
    # Values may be either an exact version match or a regex.
    # 
    skipReleases:
      - 1.2.3
      - .*-.*

    # A list of screenshots.
    # If undefined, defaults to `#{project.screenshots}`.
    # 
    screenshots:
        # Publicly available URL. PNG format is preferred.
        #  
      - url: https://acme.com/app.png
        # The type of image.
        # Valid values are [`SOURCE`, `THUMBNAIL`].
        # Defaults to `SOURCE`.
        # 
        type: THUMBNAIL
        # Marks this screenshot as the primary one.
        # Only a single screenshot may be set as primary.
        # 
        primary: true
        # A description of the image.
        # Should be no more than 100 characters long.
        # 
        caption: App in action
        # Image width in pixels.
        # Required if type = `THUMBNAIL`.
        # 
        width: 250
        # Image height in pixels.
        # Required if type = `THUMBNAIL`.
        # 
        height: 250
        # Additional properties used when evaluating templates.
        #  
        extraProperties:
          # Key will be capitalized and prefixed with `screenshot`, i.e, `screenshotFoo`.
          foo: bar

    # A list of icons.
    # If undefined, defaults to `#{project.icons}`.
    # 
    icons:
        # Publicly available URL. PNG format is preferred.
        #  
      - url: https://acme.com/app.png
        # Marks this icon as the primary one.
        # Only a single icon may be set as primary.
        # 
        primary: true
        # Image width in pixels.
        # 
        width: 250
        # Image height in pixels.
        # 
        height: 250
        # Additional properties used when evaluating templates.
        #  
        extraProperties:
          # Key will be capitalized and prefixed with `icon`, i.e, `iconFoo`.
          foo: bar
# 
[packagers.flatpak]
  # Enables or disables Flatpak.
  # 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 `flatpak`, i.e, `flatpakFoo`.

  # Directory with file templates used to prepare the Flatpak distribution.
  # Defaults to `src/jreleaser/distributions/#{distribution.name}/flatpak`.
  # If specified, path must exist.
  # 
  templateDirectory = "path/to/flatpak/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 `com.acme.duke`.
  # 
  repository.name = "com.acme.duke"

  # 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}}"

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

  # Unique identifier for this component.
  # See <id>
  # 
  componentId = "com.acme.app"

  # The categories this software component is associated with
  # See <categories>
  # 
  categories = ["Development"]

  # Represent the developers or project responsible for development of the project.
  # See <developer_name>
  # Defaults to the project's authors separated by comma.
  # 
  developerName = "Duke"

  # Sets the Flatpak runtime and Sdk.
  # Valid values are [`FREEDESKTOP`, `GNOME`, `KDE`, `ELEMENTARY`].
  # See Available Runtimes.
  # 
  runtime = "FREEDESKTOP"

  # The runtime's version to use.
  # 
  runtimeVersion = "21.08"

  # List of Sdk extensions to apply.
  # 
  sdkExtensions = ["org.flatpack.custom.extension"]

  # List of sandbox permissions.
  # 
  finishArgs = ["--share=network"]

  # Releases to be skipped from the list of releases.
  # Values may be either an exact version match or a regex.
  # 
  skipReleases = ["1.2.3", ".*-.*"]

  # A list of screenshots.
  # If undefined, defaults to `#{project.screenshots}`.
  # 
  [[packagers.flatpak.screenshots]]
    # Publicly available URL. PNG format is preferred.
    #  
    url = "https://acme.com/app.png"
    # The type of image.
    # Valid values are [`SOURCE`, `THUMBNAIL`].
    # Defaults to `SOURCE`.
    # 
    type = "THUMBNAIL"
    # Marks this screenshot as the primary one.
    # Only a single screenshot may be set as primary.
    # 
    primary = true
    # A description of the image.
    # Should be no more than 100 characters long.
    # 
    caption = "App in action"
    # Image width in pixels.
    # Required if type = `THUMBNAIL`.
    # 
    width = 250
    # Image height in pixels.
    # Required if type = `THUMBNAIL`.
    # 
    height = 250
    # Additional properties used when evaluating templates.
    #  
    extraProperties.foo = "bar"
    # Key will be capitalized and prefixed with `screenshot`, i.e, `screenshotFoo`.

  # A list of icons.
  # If undefined, defaults to `#{project.icons}`.
  # 
  [[packagers.flatpak.icons]]
    # Publicly available URL. PNG format is preferred.
    #  
    url = "https://acme.com/app.png"
    # Marks this icon as the primary one.
    # Only a single icon may be set as primary.
    # 
    primary = true
    # Image width in pixels.
    # 
    width = 250
    # Image height in pixels.
    # 
    height = 250
    # Additional properties used when evaluating templates.
    #  
    extraProperties.foo = "bar"
    # Key will be capitalized and prefixed with `icon`, i.e, `iconFoo`.
{
  // 
  "packagers": {
    // 
    "flatpak": {
      // Enables or disables Flatpak.
      // 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 `flatpak`, i.e, `flatpakFoo`.
        "foo": "bar"
      },

      // Directory with file templates used to prepare the Flatpak distribution.
      // Defaults to `src/jreleaser/distributions/#{distribution.name}/flatpak`.
      // If specified, path must exist.
      // 
      "templateDirectory": "path/to/flatpak/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 `com.acme.duke`.
        // 
        "name": "com.acme.duke",

        // 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}}",

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

      // Unique identifier for this component.
      // See <id>
      // 
      "componentId": "com.acme.app",

      // The categories this software component is associated with
      // See <categories>
      // 
      "categories": [
        "Development"
      ],

      // Represent the developers or project responsible for development of the project.
      // See <developer_name>
      // Defaults to the project's authors separated by comma.
      // 
      "developerName": "Duke",

      // Sets the Flatpak runtime and Sdk.
      // Valid values are [`FREEDESKTOP`, `GNOME`, `KDE`, `ELEMENTARY`].
      // See Available Runtimes.
      // 
      "runtime": "FREEDESKTOP",

      // The runtime's version to use.
      // 
      "runtimeVersion": "21.08",

      // List of Sdk extensions to apply.
      // 
      "sdkExtensions": [
        "org.flatpack.custom.extension"
      ],

      // List of sandbox permissions.
      // 
      "finishArgs": [
        "--share=network"
      ]

      // Releases to be skipped from the list of releases.
      // Values may be either an exact version match or a regex.
      // 
      "skipReleases": [
        "1.2.3",
        ".*-.*"
      ],

      // A list of screenshots.
      // If undefined, defaults to `#{project.screenshots}`.
      // 
      screenshots: [
        {
          // Publicly available URL. PNG format is preferred.
          //  
          "url": "https://acme.com/app.png",
          // The type of image.
          // Valid values are [`SOURCE`, `THUMBNAIL`].
          // Defaults to `SOURCE`.
          // 
          "type": "THUMBNAIL",
          // Marks this screenshot as the primary one.
          // Only a single screenshot may be set as primary.
          // 
          "primary": true,
          // A description of the image.
          // Should be no more than 100 characters long.
          // 
          "caption": "App in action",
          // Image width in pixels.
          // Required if type = `THUMBNAIL`.
          // 
          "width": 250,
          // Image height in pixels.
          // Required if type = `THUMBNAIL`.
          // 
          "height": 250,
          // Additional properties used when evaluating templates.
          //  
          "extraProperties": {
            // Key will be capitalized and prefixed with `screenshot`, i.e, `screenshotFoo`.
            "foo": "bar"
          }
        }
      ],
      // A list of icons.
      // If undefined, defaults to `#{project.icons}`.
      // 
      icons: [
        {
          // Publicly available URL. PNG format is preferred.
          //  
          "url": "https://acme.com/app.png",
          // Marks this icon as the primary one.
          // Only a single icon may be set as primary.
          // 
          "primary": true,
          // Image width in pixels.
          // 
          "width": 250,
          // Image height in pixels.
          // 
          "height": 250,
          // Additional properties used when evaluating templates.
          //  
          "extraProperties": {
            // Key will be capitalized and prefixed with `icon`, i.e, `iconFoo`.
            "foo": "bar"
          }
        }
      ]
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <packagers>
    <!--
      
    -->
    <flatpak>
      <!--
        Enables or disables Flatpak.
        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 `flatpak`, i.e, `flatpakFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>

      <!--
        Directory with file templates used to prepare the Flatpak distribution.
        Defaults to `src/jreleaser/distributions/#{distribution.name}/flatpak`.
        If specified, path must exist.
        
      -->
      <templateDirectory>path/to/flatpak/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 `com.acme.duke`.
          
        -->
        <name>com.acme.duke</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>

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

      <!--
        Unique identifier for this component.
        See <id>
        
      -->
      <componentId>com.acme.app</componentId>

      <!--
        The categories this software component is associated with
        See <categories>
        
      -->
      <categories>
        <category>Development</category>
      </categories>

      <!--
        Represent the developers or project responsible for development of the project.
        See <developer_name>
        Defaults to the project's authors separated by comma.
        
      -->
      <developerName>Duke</developerName>

      <!--
        Sets the Flatpak runtime and Sdk.
        Valid values are [`FREEDESKTOP`, `GNOME`, `KDE`, `ELEMENTARY`].
        See Available Runtimes.
        
      -->
      <runtime>FREEDESKTOP</runtime>

      <!--
        The runtime's version to use.
        
      -->
      <runtimeVersion>21.08</runtimeVersion>

      <!--
        List of Sdk extensions to apply.
        
      -->
      <sdkExtensions>
        <sdkExtension>org.flatpack.custom.extension</sdkExtension>
      </sdkExtensions>

      <!--
        List of sandbox permissions.
        
      -->
      <finishArgs>
        <finishArg>--share=network</finishArg>
      </finishArgs>

      <!--
        Releases to be skipped from the list of releases.
        Values may be either an exact version match or a regex.
        
      -->
      <skipReleases>
        <skipRelease>1.2.3</skipRelease>
        <skipRelease>.*-.*</skipRelease>
      </skipReleases>

      <!--
        A list of screenshots.
        If undefined, defaults to `#{project.screenshots}`.
        
      -->
      <screenshots>
        <screenshot>
          <!--
            Publicly available URL. PNG format is preferred.
             
          -->
          <url>https://acme.com/app.png</url>
          <!--
            The type of image.
            Valid values are [`SOURCE`, `THUMBNAIL`].
            Defaults to `SOURCE`.
            
          -->
          <type>THUMBNAIL</type>
          <!--
            Marks this screenshot as the primary one.
            Only a single screenshot may be set as primary.
            
          -->
          <primary>true</primary>
          <!--
            A description of the image.
            Should be no more than 100 characters long.
            
          -->
          <caption>App in action</caption>
          <!--
            Image width in pixels.
            Required if type = `THUMBNAIL`.
            
          -->
          <width>250</width>
          <!--
            Image height in pixels.
            Required if type = `THUMBNAIL`.
            
          -->
          <height>250</height>
          <!--
            Additional properties used when evaluating templates.
             
          -->
          <extraProperties>
            <!--
              Key will be capitalized and prefixed with `screenshot`, i.e, `screenshotFoo`.
            -->
            <foo>bar</foo>
          </extraProperties>
        </screenshot>
      </screenshots>

      <!--
        A list of icons.
        If undefined, defaults to `#{project.icons}`.
        
      -->
      <icons>
        <icon>
          <!--
            Publicly available URL. PNG format is preferred.
             
          -->
          <url>https://acme.com/app.png</url>
          <!--
            Marks this icon as the primary one.
            Only a single icon may be set as primary.
            
          -->
          <primary>true</primary>>
          <!--
            Image width in pixels.
            
          -->
          <width>250</width>
          <!--
            Image height in pixels.
            
          -->
          <height>250</height>
          <!--
            Additional properties used when evaluating templates.
             
          -->
          <extraProperties>
            <!--
              Key will be capitalized and prefixed with `icon`, i.e, `iconFoo`.
            -->
            <foo>bar</foo>
          </extraProperties>
        </icon>
      </icons>
    </flatpak>
  </packagers>
</jreleaser>
jreleaser {
  // 
  packagers {
    // 
    flatpak {
      // Enables or disables Flatpak.
      // 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 `flatpak`, i.e, `flatpakFoo`.
      //  
      extraProperties.put('foo', 'bar')

      // Directory with file templates used to prepare the Flatpak distribution.
      // Defaults to `src/jreleaser/distributions/#{distribution.name}/flatpak`.
      // If specified, path must exist.
      // 
      templateDirectory = 'path/to/flatpak/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 `com.acme.duke`.
        // 
        name = 'com.acme.duke'

        // 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}}'

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

      // Unique identifier for this component.
      // See &lt;id&gt;
      // 
      componentId = 'com.acme.app'

      // The categories this software component is associated with
      // See &lt;categories&gt;
      // 
      category('Development')

      // Represent the developers or project responsible for development of the project.
      // See &lt;developer_name&gt;
      // Defaults to the project's authors separated by comma.
      // 
      developerName = 'Duke'

      // Sets the Flatpak runtime and Sdk.
      // Valid values are [`FREEDESKTOP`, `GNOME`, `KDE`, `ELEMENTARY`].
      // See Available Runtimes.
      // 
      runtime = 'FREEDESKTOP'

      // The runtime's version to use.
      // 
      runtimeVersion = '21.08'

      // List of Sdk extensions to apply.
      // 
      sdkExtension('org.flatpack.custom.extension')

      // List of sandbox permissions.
      // 
      finishArg('--share=network')

      // Releases to be skipped from the list of releases.
      // Values may be either an exact version match or a regex.
      // 
      skipRelease('1.2.3')
      skipRelease('.*-.*')

      // A list of screenshots.
      // If undefined, defaults to `#{project.screenshots}`.
      // 
      screenshot {
        // Publicly available URL. PNG format is preferred.
        //  
        url = 'https://acme.com/app.png'
        // The type of image.
        // Valid values are [`SOURCE`, `THUMBNAIL`].
        // Defaults to `SOURCE`.
        // 
        screenshotType = THUMBNAIL
        // Marks this screenshot as the primary one.
        // Only a single screenshot may be set as primary.
        // 
        primary = true
        // A description of the image.
        // Should be no more than 100 characters long.
        // 
        caption = 'App in action'
        // Image width in pixels.
        // Required if type = `THUMBNAIL`.
        // 
        width = 250
        // Image height in pixels.
        // Required if type = `THUMBNAIL`.
        // 
        height = 250
        // Additional properties used when evaluating templates.
        // Key will be capitalized and prefixed with `screenshot`, i.e, `screenshot`.
        //  
        extraProperties.put('foo', 'bar')
      }

      // A list of icons.
      // If undefined, defaults to `#{project.icons}`.
      // 
      icon {
        // Publicly available URL. PNG format is preferred.
        //  
        url = 'https://acme.com/app.png'
        // Marks this icon as the primary one.
        // Only a single icon may be set as primary.
        // 
        primary = true
        // Image width in pixels.
        // 
        width = 250
        // Image height in pixels.
        // 
        height = 250
        // Additional properties used when evaluating templates.
        // Key will be capitalized and prefixed with `icon`, i.e, `icon`.
        //  
        extraProperties.put('foo', 'bar')
      }
    }
  }
}

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.flatpak.active

JRELEASER_PACKAGERS_FLATPAK_ACTIVE

Inside distributions section

System Property Environment Variable

active

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

JRELEASER_DISTRIBUTIONS_${name}_FLATPAK_ACTIVE

repository.active

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

JRELEASER_DISTRIBUTIONS_${name}_FLATPAK_REPOSITORY_ACTIVE

repository.username

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

JRELEASER_DISTRIBUTIONS_${name}_FLATPAK_REPOSITORY_USERNAME
JRELEASER_FLATPAK_GITHUB_USERNAME
JRELEASER_FLATPAK_GITLAB_USERNAME
JRELEASER_FLATPAK_GITEA_USERNAME
JRELEASER_FLATPAK_CODEBERG_USERNAME
JRELEASER_GITHUB_USERNAME
JRELEASER_GITLAB_USERNAME
JRELEASER_GITEA_USERNAME
JRELEASER_CODEBERG_USERNAME

repository.token

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

JRELEASER_DISTRIBUTIONS_${name}_FLATPAK_REPOSITORY_TOKEN
JRELEASER_FLATPAK_GITHUB_TOKEN
JRELEASER_FLATPAK_GITLAB_TOKEN
JRELEASER_FLATPAK_GITEA_TOKEN
JRELEASER_FLATPAK_CODEBERG_TOKEN
JRELEASER_GITHUB_TOKEN
JRELEASER_GITLAB_TOKEN
JRELEASER_GITEA_TOKEN
JRELEASER_CODEBERG_TOKEN

repository.branch

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

JRELEASER_DISTRIBUTIONS_${name}_FLATPAK_REPOSITORY_BRANCH
JRELEASER_FLATPAK_GITHUB_BRANCH
JRELEASER_FLATPAK_GITLAB_BRANCH
JRELEASER_FLATPAK_GITEA_BRANCH
JRELEASER_FLATPAK_CODEBERG_BRANCH
JRELEASER_GITHUB_BRANCH
JRELEASER_GITLAB_BRANCH
JRELEASER_GITEA_BRANCH
JRELEASER_CODEBERG_BRANCH

repository.branchPush

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

JRELEASER_DISTRIBUTIONS_${name}_FLATPAK_REPOSITORY_BRANCH_PUSH
JRELEASER_FLATPAK_GITHUB_BRANCH_PUSH
JRELEASER_FLATPAK_GITLAB_BRANCH_PUSH
JRELEASER_FLATPAK_GITEA_BRANCH_PUSH
JRELEASER_FLATPAK_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.flatpakDownloadUrl exists, use it.

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

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

  4. if distribution.extraProperties.flatpakDownloadUrl 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, `flatpak (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.

Icon

You must define at least one icon. A square (256x256 pixels) image in PNG format is preferred.

Skip Screenshots

You may add a skipFlatpak extra property to a target screenshot to mark it as skipped for packaging with Flatpak.

Skip Icons

You may add a skipFlatpak extra property to a target icon to mark it as skipped for packaging with Flatpak.

Templates

The default location for templates is:

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

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

  • cli-app.yml.tpl

  • cli-metainfo.xml.tpl

  • desktop-app.desktop.tpl

  • desktop-app.yml.tpl

  • desktop-metainfo.xml.tpl

  • flathub.json.tpl

  • README.md.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 skipFlatpak extra property to the target artifact to mark it as skipped for packaging with flatpak.

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 flatpak to skip this behavior.

Publication to Flathub

Flathub is the home of hundreds of apps which can be easily installed on any Linux distribution.

You are responsible for submitting a ticket to Flathub for adding a new app. JReleaser does not create a ticket nor a pull request for you. However, once your application has been accepted to Flathub you may update the flatpack configuration to point to the appointed repository.

Please consult the App Submission to know more.

Repository

The repository section allows setting extra properties that may be used to provide additional hints when interacting with the git repository that holds packager files.

GitLab

Define a projectIdentifier property to directly locate the project associated with the repository, such as

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

packagers:
  flatpak:
    repository:
      extraProperties:
        projectIdentifier: 12345678
[packagers.flatpak]
  repository.extraProperties.projectIdentifier = "12345678"
{
  "packagers": {
    "flatpak": {
      "repository": {
        "extraProperties": {
          "projectIdentifier": "12345678"
        }
      }
    }
  }
}
<jreleaser>
  <packagers>
    <flatpak>
      <repository>
        <extraProperties>
          <projectIdentifier>12345678</projectIdentifier>
        </extraProperties>
      </repository>
    </flatpak>
  </packagers>
</jreleaser>
jreleaser {
  packagers {
    flatpak {
      repository {
        extraProperties.put("projectIdentifier", "12345678")
      }
    }
  }
}