JReleaser’s Release

It should be no surprise that JReleaser relies on itself to create its releases.

The following configuration file is used to create both release and snapshot releases:

jreleaser.yml
# Define properties we'll use later in this file
environment:
  properties:
    jdkPathPrefix: 'apps/jreleaser/build/jdks'
    jdkFilePrefix: 'zulu17.30.15-ca-jdk17.0.1'
    jpackageDir: out/jreleaser/assemble/jreleaser-installer/jpackage
    skipJpackageResolver: true

# General information about this project
project:
  name: jreleaser
  description: Release projects quickly and easily with JReleaser
  longDescription: |
    JReleaser is a release automation tool. Its goal is to simplify creating releases and
    publishing artifacts to multiple package managers while providing customizable options.

    JReleaser takes inputs from popular builds tools (Ant, Maven, Gradle) such as JAR files,
    binary distributions (.zip, .tar), jlink images, or any other file that you’d like to
    publish as a Git release on popular Git services such as GitHub, GitLab, or Gitea.
    Distribution files may additionally be published to be consumed by popular package managers
    such as Homebrew, Chocolatey, Snapcraft, or get ready to be launched via JBang. Releases
    may be announced in a variety of channels such as Twitter, Zulip, SDKMAN!, and more.

  website: https://jreleaser.org
  authors:
    - Andres Almiray
  license: Apache-2.0
  java:
    groupId: org.jreleaser
    version: 8
    multiProject: true
  extraProperties:
    inceptionYear: 2020
  tags:
    - 'jreleaser'
    - 'release'
    - 'tool'
    - 'java'
    - 'git'

platform:
  replacements:
    # Replace matching platforms in filenames of assembled artifacts
    aarch_64: aarch64

release:
  github:
    overwrite: true
    sign: true
    discussionCategoryName: Announcements
    changelog:
      formatted: ALWAYS
      format: '- {{commitShortHash}} {{commitTitle}}'
      contributors:
        format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
      # Label commits by matching their first line
      labelers:
        - label: 'merge_pull'
          title: 'Merge pull'
        - label: 'merge_branch'
          title: 'Merge branch'
        - label: 'translation'
          title: '[translation]'
        - label: 'task'
          title: '[chore]'
        - label: 'dependencies'
          title: '[deps]'
        - label: 'build'
          title: '[build]'
        - label: 'feature'
          title: 'Resolves #'
          body: 'Resolves #'
        - label: 'issue'
          title: 'Fixes #'
          body: 'Fixes #'
        - label: 'issue'
          title: 'Relates to #'
          body: 'Relates to #'
        - label: 'allcontributors'
          title: 'docs: update'
      # Categorize commits by labels
      categories:
        - title: 'Merge'
          labels:
            - 'merge_pull'
            - 'merge_branch'
        - title: '🚀 Features'
          labels:
            - 'feature'
        - title: '✅ Issues'
          labels:
            - 'issue'
        - title: '🧰 Tasks'
          labels:
            - 'task'
        - title: '🌐 Translation'
          labels:
            - 'translation'
        - title: '⚙️  Dependencies'
          labels:
            - 'dependencies'
        - title: '🛠  Build'
          labels:
            - 'build'
        - title: 'allcontributors'
          labels:
            - 'allcontributors'
      hide:
        # hide Merge commits
        categories:
          - 'Merge'
          - 'allcontributors'
        # hide contributions from GitHub bots
        contributors:
          - 'GitHub'
          - 'allcontributors'
      replacers:
        # Remove `[chore] ` from the commit message
        - search: '\[chore\] '
        # Remove `[deps] ` from the commit message
        - search: '\[deps\] '
        # Remove `[translation] ` from the commit message
        - search: '\[translation\] '
        # Remove `[build] ` from the commit message
        - search: '\[build\] '

# File signing is always active
signing:
  active: always
  armored: true
  # Do not sign additional files, only distribution artifacts and checksums
  files: false

checksum:
  # Do not checksum additional files, only distribution artifacts
  files: false

# Announcing a release only occurs when it's not snapshot
announce:
  twitter:
    active: release
    status: 🚀 JReleaser {{projectVersion}} has been released! {{releaseNotesUrl}}

assemble:
  # Configure a cross-platform Jlink assembly
  jlink:
    jreleaser-standalone:
      active: always
      java:
        version: 11
        mainClass: org.jreleaser.cli.Main
      imageName: '{{distributionName}}-{{projectEffectiveVersion}}'
      executable: jreleaser
      jdeps:
        multiRelease: base
        ignoreMissingDeps: true
      additionalModuleNames:
        - 'java.security.sasl'
        - 'java.security.jgss'
        - 'jdk.crypto.cryptoki'
        - 'jdk.crypto.ec'
        - 'jdk.localedata'
        - 'jdk.net'
        - 'jdk.security.auth'
        - 'jdk.security.jgss'
      targetJdks:
        - path: '{{jdkPathPrefix}}/zulu17Osx/{{jdkFilePrefix}}-macosx_x64/zulu-17.jdk/Contents/Home'
          platform: 'osx-x86_64'
        - path: '{{jdkPathPrefix}}/zulu17OsxArm/{{jdkFilePrefix}}-macosx_aarch64/zulu-17.jdk/Contents/Home'
          platform: 'osx-aarch_64'
        - path: '{{jdkPathPrefix}}/zulu17Linux/{{jdkFilePrefix}}-linux_x64'
          platform: 'linux-x86_64'
        - path: '{{jdkPathPrefix}}/zulu17LinuxArm/{{jdkFilePrefix}}-linux_aarch64'
          platform: 'linux-aarch_64'
        - path: '{{jdkPathPrefix}}/zulu17LinuxMusl/{{jdkFilePrefix}}-linux_musl_x64'
          platform: 'linux_musl-x86_64'
        - path: '{{jdkPathPrefix}}/zulu17LinuxMuslArm/{{jdkFilePrefix}}-linux_musl_aarch64'
          platform: 'linux_musl-aarch_64'
        - path: '{{jdkPathPrefix}}/zulu17Windows/{{jdkFilePrefix}}-win_x64'
          platform: 'windows-x86_64'
        - path: '{{jdkPathPrefix}}/zulu17WindowsArm/{{jdkFilePrefix}}-win_aarch64'
          platform: 'windows-aarch_64'
      mainJar:
        path: 'apps/jreleaser/build/libs/jreleaser-{{projectVersion}}.jar'
      jars:
        - pattern: 'apps/jreleaser/build/dependencies/flat/*.jar'

  # Configure platform specific installers
  jpackage:
    jreleaser-installer:
      active: always
      jlink: jreleaser-standalone
      attachPlatform: true
      applicationPackage:
        appName: jreleaser
        appVersion: '{{projectVersionNumber}}'
        vendor: JReleaser
      osx:
        types: [pkg]
        appName: JReleaser
        packageName: JReleaser
        packageIdentifier: org.jreleaser.cli
        icon: 'src/media/jreleaser.icns'
        resourceDir: 'src/jpackage/osx'
      linux:
        types: [deb,rpm]
        maintainer: jreleaser@kordamp.org
        icon: 'src/media/icon_256x256.png'
      windows:
        types: [msi]
        console: true
        dirChooser: true
        icon: 'src/media/jreleaser.ico'
        resourceDir: 'src/jpackage/windows'

# Configure 5 distributions
distributions:
  # Distribution 1 is of type JAVA_BINARY
  jreleaser:
    java:
      mainClass: org.jreleaser.cli.Main
    chocolatey:
      active: always
      remoteBuild: true
      title: JReleaser
      iconUrl: 'https://rawcdn.githack.com/jreleaser/jreleaser/0934fa1fa3f0bd09c0c8c39fbdeb5df2ce507457/src/media/icon_128x128.png'
      bucket:
        active: release
    jbang:
      active: always
    macports:
      active: always
      categories:
        - devel
        - java
      maintainers:
        - '@aalmiray'
      repository:
        active: release
        name: jreleaser-macports
    scoop:
      active: always
      bucket:
        active: release
    sdkman:
      active: release
      architectures:
        - buildOn: [ amd64, arm64 ]
      plugs:
        - name: dot-config-files
          attributes:
            interface: personal-files
          writes:
            - $HOME/.jreleaser
          reads:
            - $HOME/.gnupg
            - $HOME/.gitconfig
            - $HOME/.config/jgit
      localPlugs:
        - network
        - home
        - dot-config-files
    spec:
      active: always
      repository:
        active: release
        name: jreleaser-copr
    artifacts:
      # Transform the artifact name
      - path: apps/{{distributionName}}/build/distributions/{{distributionName}}-{{projectVersion}}.zip
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}.zip'
        extraProperties:
          skipSpec: true
      - path: apps/{{distributionName}}/build/distributions/{{distributionName}}-{{projectVersion}}.tar
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}.tar'

  # Distribution 2 is of type JAVA_BINARY
  jreleaser-ant-tasks:
    artifacts:
      # Transform the artifact name
      - path: plugins/{{distributionName}}/build/distributions/{{distributionName}}-{{projectVersion}}.zip
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}.zip'

  # Distribution 3 is of type SINGLE_JAR
  jreleaser-tool-provider:
    type: SINGLE_JAR
    artifacts:
      # Transform the artifact name
      - path: apps/{{distributionName}}/build/libs/{{distributionName}}-{{projectVersion}}.jar
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}.jar'

  # Distribution 4 is of type JLINK
  # Name matches the assembled Jlink distribution
  jreleaser-standalone:
    brew:
      active: always
      formulaName: jreleaser
      multiPlatform: true
      tap:
        active: release
        commitMessage: 'jreleaser {{tagName}}'
    docker:
      # inherited by specs
      active: always
      repository:
        active: release
        commitMessage: 'jreleaser {{tagName}}'
      # inherited by specs
      registries:
        - serverName: DEFAULT
          username: jreleaser
      # inherited by specs
      labels:
        'org.opencontainers.image.title': 'jreleaser'
      # inherited by specs
      postCommands:
        - 'VOLUME /workspace'
      # configure 2 specs
      specs:
        slim:
          imageNames:
            - 'jreleaser/jreleaser-{{dockerSpecName}}:{{tagName}}'
            - 'jreleaser/jreleaser-{{dockerSpecName}}:latest'
          # match by platform
          matchers:
            platform: 'linux-x86_64'
          preCommands:
            - 'ARG DEBIAN_FRONTEND=noninteractive'
            - 'ENV TZ=Europe/Zurich'
            - 'RUN apt-get update && apt-get install -y unzip binutils fakeroot rpm'
        alpine:
          imageNames:
            - 'jreleaser/jreleaser-{{dockerSpecName}}:{{tagName}}'
            - 'jreleaser/jreleaser-{{dockerSpecName}}:latest'
          # match by platform
          matchers:
            platform: 'linux_musl-x86_64'
          preCommands:
            - 'RUN apk add unzip binutils fakeroot rpm'
    gofish:
      active: always
      repository:
        active: release
        commitMessage: 'jreleaser {{tagName}}'

  # Distribution 4 is of type NATIVE_PACKAGE
  jreleaser-installer:
    type: NATIVE_PACKAGE
    executable:
      windowsExtension: exe
    artifacts:
      # Transform the artifact name
      - path: '{{jpackageDir}}/JReleaser-{{projectVersionNumber}}-osx-x86_64.pkg'
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}-osx-x86_64.pkg'
        platform: 'osx-x86_64'
      - path: '{{jpackageDir}}/jreleaser_{{projectVersionNumber}}-1_amd64.deb'
        transform: '{{distributionName}}/{{distributionName}}_{{projectEffectiveVersion}}-1_amd64.deb'
        platform: 'linux-x86_64'
      - path: '{{jpackageDir}}/jreleaser-{{projectVersionNumber}}-1.x86_64.rpm'
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}-1.x86_64.rpm'
        platform: 'linux-x86_64'
      - path: '{{jpackageDir}}/jreleaser-{{projectVersionNumber}}-windows-x86_64.msi'
        transform: '{{distributionName}}/{{distributionName}}-{{projectEffectiveVersion}}-windows-x86_64.msi'
        platform: 'windows-x86_64'

files:
  artifacts:
    - path: VERSION

Which will create and tag a prerelease on GitHub when the project is snapshot, and a regular release when the project is not snapshot.

The release will have the following assets:

# binaries created by the build
jreleaser-1.0.0.tar
jreleaser-1.0.0.zip
jreleaser-ant-tasks-1.0.0.zip
jreleaser-tool-provider-1.0.0.jar

# binaries created by the Jlink assembler
jreleaser-standalone-1.0.0-linux-aarch64.zip
jreleaser-standalone-1.0.0-linux-x86_64.zip
jreleaser-standalone-1.0.0-linux_musl-aarch64.zip
jreleaser-standalone-1.0.0-linux_musl-x86_64.zip
jreleaser-standalone-1.0.0-osx-aarch64.zip
jreleaser-standalone-1.0.0-osx-x86_64.zip
jreleaser-standalone-1.0.0-windows-aarch64.zip
jreleaser-standalone-1.0.0-windows-x86_64.zip

# binaries created by the Jpackage assembler
jreleaser-installer-1.0.0-osx-x86_64.pkg
jreleaser-installer-1.0.0-1_amd64.deb
jreleaser-installer-1.0.0-1.x86_64.rpm
jreleaser-installer-1.0.0-windows-x86_64.msi

# checksums
checksums_rmd160.txt
checksums_sha256.txt
jreleaser-1.0.0.zip.rmd160
jreleaser-1.0.0.zip.sha256

# signatures
checksums_rmd160.txt.asc
checksums_sha256.txt.asc
jreleaser-1.0.0.tar.asc
jreleaser-1.0.0.zip.asc
jreleaser-ant-tasks-1.0.0.zip.asc
jreleaser-tool-provider-1.0.0.jar.asc
jreleaser-standalone-1.0.0-linux-aarch64.zip.asc
jreleaser-standalone-1.0.0-linux-x86_64.zip.asc
jreleaser-standalone-1.0.0-linux_musl-aarch64.zip.asc
jreleaser-standalone-1.0.0-linux_musl-x86_64.zip.asc
jreleaser-standalone-1.0.0-osx-aarch64.zip.asc
jreleaser-standalone-1.0.0-osx-x86_64.zip.asc
jreleaser-standalone-1.0.0-windows-aarch64.zip.asc
jreleaser-standalone-1.0.0-windows-x86_64.zip.asc
jreleaser-installer-1.0.0-osx-x86_64.pkg.asc
jreleaser-installer-1.0.0-1_amd64.deb.asc
jreleaser-installer-1.0.0-1.x86_64.rpm.asc
jreleaser-installer-1.0.0-windows-x86_64.msi.asc

# additional files
VERSION

Additionally, the following repositories will be updated with new packagers:

Docker images will also be published to DockerHub: