diff --git a/docs/antora.yml b/docs/antora.yml new file mode 100644 index 0000000..3d49052 --- /dev/null +++ b/docs/antora.yml @@ -0,0 +1,12 @@ +name: guide +title: JReleaser +version: dev +asciidoc: + attributes: + jreleaser-version: 0.1.0-SNAPSHOT + icons: font +nav: +- modules/ROOT/nav-start.adoc +- modules/configuration/nav.adoc +- modules/tools/nav.adoc +- modules/ROOT/nav-end.adoc diff --git a/docs/modules/ROOT/nav-end.adoc b/docs/modules/ROOT/nav-end.adoc new file mode 100644 index 0000000..a24d4b9 --- /dev/null +++ b/docs/modules/ROOT/nav-end.adoc @@ -0,0 +1 @@ +* xref:links.adoc[] diff --git a/docs/modules/ROOT/nav-start.adoc b/docs/modules/ROOT/nav-start.adoc new file mode 100644 index 0000000..16b4abe --- /dev/null +++ b/docs/modules/ROOT/nav-start.adoc @@ -0,0 +1,2 @@ +* xref:install.adoc[] +* xref:quick_start.adoc[] diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc new file mode 100644 index 0000000..a341862 --- /dev/null +++ b/docs/modules/ROOT/pages/index.adoc @@ -0,0 +1,15 @@ += JReleaser + +JReleaser is a release automation tool for Java projects. Its goal is to simplify creating releases and publishing artifacts +to multiple package managers while providing customizable options. + +A release process can be customized with a `jreleaser.yml` file if using the xref:tools:cli.adoc[CLI] or +xref:tools:ant.adoc[ANT] options, or direct DSL configuration inside a `pom.xml` (xref:tools:maven.adoc[Maven]) or +`build.gradle` (xref:tools:gradle.adoc[Gradle]) file. + +Once setup, you can create a new release by invoking the `full-release` command. + +*Acknowledgments* + +JReleaser is heavily inspired by link:https://goreleaser.com[GoReleaser]. + diff --git a/docs/modules/ROOT/pages/install.adoc b/docs/modules/ROOT/pages/install.adoc new file mode 100644 index 0000000..4e2efa5 --- /dev/null +++ b/docs/modules/ROOT/pages/install.adoc @@ -0,0 +1,85 @@ += Install + +There are multiple choices depending on your preference. + +== CLI +The +---- + +*manually*: + +Download the pre-compiled binary from the link:https://github.com/jreleaser/jreleaser/releases[releases page], +uncompress and copy to the desired location. + +== Maven +Configure the xref:tools:maven.adoc[jreleaser-maven-plugin] in your POM file + +[source,xml] +[subs="verbatim,attributes"] +.pom.xml +---- + + org.jreleaser + jreleaser-maven-plugin + {jreleaser-version} + +---- + +== Gradle +Configure the xref:tools:gradle.adoc[jreleaser-gradle-plugin] in your `build.gradle` or `settings.gradle` file + +[source,groovy] +[subs="attributes"] +.build.gradle +---- +plugins { + id 'org.jreleaser' version '{jreleaser-version}' +} +---- + +== Ant +Download the xref:tools:ant.adoc[jreleaser-ant-tasks] ZIP bundle from the +link:https://github.com/jreleaser/jreleaser/releases[releases page] and unzip it in your project. Place all JARs inside +the `lib` folder. Create this folder if there is none. Add the following elements to your `build.xml` file + +[source,xml] +[subs="verbatim,attributes"] +.build.xml +---- + + + + + + + + + +---- + diff --git a/docs/modules/ROOT/pages/links.adoc b/docs/modules/ROOT/pages/links.adoc new file mode 100644 index 0000000..09e106a --- /dev/null +++ b/docs/modules/ROOT/pages/links.adoc @@ -0,0 +1,6 @@ += Links + +* Follow the progress on the link:https://github.com/jreleaser/jreleaser[GitHub repository] +* Follow link;https://twitter.com/jreleaser[@jreleaser] on Twitter for updates +* Ask questions on link:https://stackoverflow.com/questions/tagged/jreleaser[StackOverflow] +* For questions, support and general discussion, please use link:https://github.com/jreleaser/jreleaser/discussions[GitHub Discussions] diff --git a/docs/modules/ROOT/pages/quick_start.adoc b/docs/modules/ROOT/pages/quick_start.adoc new file mode 100644 index 0000000..533692a --- /dev/null +++ b/docs/modules/ROOT/pages/quick_start.adoc @@ -0,0 +1,63 @@ += Quick Start + +Once JReleaser is installed you may initialize its config file by invoking the following command: + +[source] +---- +$ jreleaser init --format yml +[INFO] Writing file /Home/duke/app/jreleaser.yml +[INFO] JReleaser initialized at /Home/duke/app +---- + +This generates a `jreleaser.yml` file with the following configuration + +[source,yaml] +.jreleaser.yml +---- +project: + name: app + version: 1.0.0-SNAPSHOT + description: Awesome App + longDescription: Awesome App + website: https://acme.com/app + authors: + - Duke + license: Apache-2 + java: + groupId: com.acme + version: 8 + +release: + github: + owner: duke + +distributions: + app: + artifacts: + - path: path/to/{{distributionName}}-{{projectVersion}}.zip +---- + +Edit the file to suite your needs. JReleaser does not create artifact files for you. It assumes those are created using +other tools; JReleaser only cares if the resolved artifact paths exist. Once you have edited the file you may verify its +configuration by invoking + +[source] +---- +$ jreleaser config +---- + +At any time you may invoke any of the other commands, but when it's time to make a release you have to invoke + +[source] +---- +$ jreleaser full-release +---- + +This command performs the following actions: + +* checksums all artifacts. +* signs all files (if signing is enabled). +* creates a release at the chosen Git repository. +* prepares, packages, and uploads configured packagers (brew, jbang, etc). +* announces the release. + diff --git a/docs/modules/configuration/nav.adoc b/docs/modules/configuration/nav.adoc new file mode 100644 index 0000000..1ebd56b --- /dev/null +++ b/docs/modules/configuration/nav.adoc @@ -0,0 +1,17 @@ +.Configuration +* xref:project.adoc[] +* xref:signing.adoc[] +* xref:release/index.adoc[] +** xref:release/github.adoc[] +* xref:packagers/index.adoc[] +** xref:packagers/chocolatey.adoc[] +** xref:packagers/homebrew.adoc[] +** xref:packagers/jbang.adoc[] +** xref:packagers/scoop.adoc[] +** xref:packagers/snap.adoc[] +* xref:distributions.adoc[] +* xref:files.adoc[] +* xref:announce/index.adoc[] +** xref:announce/sdkman.adoc[] +** xref:announce/twitter.adoc[] +** xref:announce/zulip.adoc[] diff --git a/docs/modules/configuration/pages/announce/index.adoc b/docs/modules/configuration/pages/announce/index.adoc new file mode 100644 index 0000000..be3a717 --- /dev/null +++ b/docs/modules/configuration/pages/announce/index.adoc @@ -0,0 +1,14 @@ += Announce + +Releases can be announced to several media once they have been successfully created. + +[source,yaml] +[subs="+macros"] +---- +# [optional] +announce: + # Enable or disable all configured announcers. + # Defaults to `true`. + # [optional] + enabled: true +---- diff --git a/docs/modules/configuration/pages/announce/sdkman.adoc b/docs/modules/configuration/pages/announce/sdkman.adoc new file mode 100644 index 0000000..f57acc6 --- /dev/null +++ b/docs/modules/configuration/pages/announce/sdkman.adoc @@ -0,0 +1,53 @@ += Sdkman + +Publishes a release to link:https://sdkman.io[SDKMAN!]. Please follow the instructions at +link:https://sdkman.io/vendors[] to register your project as a candidate and obtain publishing credentials. + +[source,yaml] +[subs="+macros"] +---- +announce: + # [optional] + sdkman: + + # Enable or disable this announcer. + # Defaults to `true`. + # [optional] + enabled: true + + # The name of the candidate registered in thew SDKMAN! database. + # If unspecified, will use ${project.name}. + # [optional] + candidate: + + # Announce a major release if `true`, minor release if `false`. + # Defaults to `true`. + # [optional] + major: true + + # The consumer key for publishing to SDKMAN!. + # If left unspecified, the JRELEASER_SDKMAN_CONSUMER_KEY environment variable must be defined. + # [required] + consumerKey: + + # The consumer token for publishing to SDKMAN!. + # If left unspecified, the JRELEASER_SDKMAN_CONSUMER_TOKEN environment variable must be defined. + # [required] + consumerToken: +---- + +This announcer has the following considerations: + +* No snapshot releases are supported. +* Only `zip` artifacts are supported. +* The default platform is set to `UNIVERSAL` if the artifact did not define a value for its `platform` field. +* If there's more than one artifact then each artifact requires distinct `platform` values, otherwise the latest + artifact will override any previous matches by platform. +* Announcing will be skipped if no suitable artifacts are found. + +Supported platform values are: + +* `mac`, `osx`. +* `win`, `windows`. +* `linux`. + diff --git a/docs/modules/configuration/pages/announce/twitter.adoc b/docs/modules/configuration/pages/announce/twitter.adoc new file mode 100644 index 0000000..721ee00 --- /dev/null +++ b/docs/modules/configuration/pages/announce/twitter.adoc @@ -0,0 +1,44 @@ += Twitter + +Tweets a new release. You must register a new Twitter application and obtain the set of credentaials. Follow the +instructions from link:https://developer.twitter.com/en/portal/projects-and-apps[Twitter] to complete this task. + +[source,yaml] +[subs="+macros"] +---- +announce: + # [optional] + twitter: + + # Enable or disable this announcer. + # Defaults to `true`. + # [optional] + enabled: true + + # The consumer key. + # If left unspecified, the JRELEASER_TWITTER_CONSUMER_KEY environment variable must be defined. + # [required] + consumerKey: + + # The consumer token. + # If left unspecified, the JRELEASER_TWITTER_CONSUMER_TOKEN environment variable must be defined. + # [required] + consumerToken: + + # The access token. + # If left unspecified, the JRELEASER_TWITTER_ACCESS_TOKEN environment variable must be defined. + # [required] + accessToken: + + # The access token secret. + # If left unspecified, the JRELEASER_TWITTER_ACCESS_TOKEN_SECRET environment variable must be defined. + # [required] + accessTokenSecret: + + # The announcement message. + # Review the available xref:configuration:templates.adoc[]. + # [optional] + status: icon:rocket[] {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}} +---- + + diff --git a/docs/modules/configuration/pages/announce/zulip.adoc b/docs/modules/configuration/pages/announce/zulip.adoc new file mode 100644 index 0000000..c44e33d --- /dev/null +++ b/docs/modules/configuration/pages/announce/zulip.adoc @@ -0,0 +1,46 @@ += Zulip + +Enables posting a message to a link:https://zulip.com/[Zulip] server. You must procure an account and apiKey to use +this announcer. + +[source,yaml] +[subs="+macros"] +---- +announce: + # [optional] + zulip: + + # Enable or disable this announcer. + # Defaults to `true`. + # [optional] + enabled: true + + # The Zulip account (typically an email address) to use. + # [required] + account: announce-bot@my.zulipchat.com + + # The Zulip server endpoint + # [required] + apiHost: https://my.zulipchat.com/api/v1 + + # The ApiKey associated with the given account. + # If left unspecified, the JRELEASER_ZULIP_API_KEY environment variable must be defined. + # [required] + apiKey: true + + # The channel where the message will be sent to + # Defaults to `announce`. + # [optional] + channel: announce + + # The messages' subject. + # Review the available xref:configuration:templates.adoc[]. + # [optional] + subject: {{projectNameCapitalized}} {{projectVersion}} + + # The announcement message. + # Review the available xref:configuration:templates.adoc[]. + # [optional] + message: icon:rocket[] {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}} +---- + diff --git a/docs/modules/configuration/pages/distributions.adoc b/docs/modules/configuration/pages/distributions.adoc new file mode 100644 index 0000000..46e3f49 --- /dev/null +++ b/docs/modules/configuration/pages/distributions.adoc @@ -0,0 +1,108 @@ += Distributions + +Distributions define artifacts that may be published using supported packages and announced with supported announcers. + +Each distribution is responsible for defining a unique name and a list of artifacts that belong to it. + +JReleaser requires at least 1 distribution to be configured. A distribution requires at least 1 artifact to be listed. + +Distributions inherit the configuration specified in the xref:configuration:packagers/index.adoc[] block and may override it. + +[source,yaml] +[subs="+macros"] +---- +# [required] +distributions: + # A named distribution + # [required] + app: + + # Enables or disables the distribution. + # Defaults to `true`. + # [optional] + enabled: true + + # The distribution type. + # Used to determine packager templates. + # Supported values are: [BINARY]. + # [required] + type: BINARY + + # Name of the executable launcher. + # If left undefined, will use {$distribution.name}. + # [optional] + executable: app + + # A list of tags. + # [optional] + tags: + - cli + - awesome + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `distribution`, i.e, `distributionFoo`. + foo: bar + + # A list of artifacts. + # At least on entry must be present + # [required] + artifacts: + - path: path/to/{{distributionName}}-{{projectVersion}}.zip + # If left undefined, will use {distribution.javaVersion}. + javaVersion: 8 + - path: path/to/{{distributionName}}-{{projectVersion}}-mac.zip + platform: osx + - path: path/to/{{distributionName}}-{{projectVersion}}-win.zip + platform: windows + + # [optional] + java: + # Maven coordinates: groupId. + # If left undefined, will use ${project.java.groupId}. + # [optional] + groupId: com.acme + + # Maven coordinates: artifactId. + # If left undefined, will use ${project.java.artifactId}. + # [optional] + artifactId: app + + # The minimum Java version required by consumers to run the application. + # If left undefined, will use ${project.java.version}. + # [optional] + version: 8 + + # The application's entry point. + # If left undefined, will use ${project.java.mainClass}. + # [optional] + mainClass: com.acme.Main + + # Identifies the project as being member of a multi-project build. + # If left undefined, will use ${project.java.multiProject}. + # Defaults to `false`. + # [optional] + multiProject : false +---- + +It's recommended to list universal artifacts first, then platform specific. + +The value of `platform` is dictated by the normalized values detected by +link:https://github.com/trustin/os-maven-plugin[os-maven-plugin]. You may use the plain `platform` value or append a +`arch` classifier. The following values are currently recognized + +[horizontal] +platform:: `aix`, `hpux`, `os400`, `linux`, `osx`, `freebsd`, `openbsd`, `netbsd`, `sunos`, `windows`, `zos`. +arch:: `x86_64`, `x86_32`, `itanium_64`, `itanium_32`, `sparc_32`, `sparc_64`, `arm_32`, `aarch_64`, `mips_32`, +`mipsel_32`, `mips_64`, `mipsel_64`, `ppc_32`, `ppcle_32`, `ppc_64`, `ppcle_64`, `s390_32`, `s390_64`, `riscv` + +Examples: + +* `osx` +* `osx-arm` +* `windows` +* `linux` +* `linux-x86_32` + + diff --git a/docs/modules/configuration/pages/files.adoc b/docs/modules/configuration/pages/files.adoc new file mode 100644 index 0000000..a51ec97 --- /dev/null +++ b/docs/modules/configuration/pages/files.adoc @@ -0,0 +1,16 @@ += Files + +You can define a set of additional files that should be uploaded as part of the release. These files may also +be checksumed and signed before uploading. + +[source,yaml] +[subs="+macros"] +---- +# Defines a list of files. +# Each entry must define a path: field. +# The path may be relative to the project's basedir or absolute. +# [optional] +files: + - path: path/to/some/file.txt + - path: path/to/another/file.md +---- diff --git a/docs/modules/configuration/pages/index.adoc b/docs/modules/configuration/pages/index.adoc new file mode 100644 index 0000000..4c13063 --- /dev/null +++ b/docs/modules/configuration/pages/index.adoc @@ -0,0 +1,6 @@ += Configuration + +This section describes elements that can be configured in `jrelease.yml` file. This file can be generated by running +`jreleaser init --format yml` or start from scratch. Other configuration formats besides YAML may be supported as well, +such as JSON, the xref:tools:maven.adoc[Maven] DSL, the xref:tools:gradle.adoc[Gradle] DSL. + diff --git a/docs/modules/configuration/pages/packagers/chocolatey.adoc b/docs/modules/configuration/pages/packagers/chocolatey.adoc new file mode 100644 index 0000000..a54edae --- /dev/null +++ b/docs/modules/configuration/pages/packagers/chocolatey.adoc @@ -0,0 +1,144 @@ += Chocolatey + +Publishes packages to link:https://chocolatey.org[]. + +NOTE: At the moment, only artifacts with `.zip` extension may be packaged with Chocolatey. + +WARNING: Local publication of packages is currently not supported. Please set `remoteBuild` to `true` and trigger a +build in CI. Local publication will be added at a later release. + +WARNING: Snapshots are not supported. + +[source,yaml] +[subs="+macros"] +---- +# [optional] +packagers: + # [optional] + chocolatey: + # Enables or disables Chocolatey. + # Defaults to `false`. + # [optional] + enabled: true + + # Directory with file templates used to prepare the Chocolatey distribution + # Defaults to `src/distribution/${distribution.name}/chocolatey`. + # If specified, path must exist. + # [optional] + templateDirectory: path/to/chocolatey/templates + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `chocolatey`, i.e, `chocolateyFoo`. + foo: bar + + # The username that can publish Chocolatey packages. + # If left unspecified, the release owner will be used. + # [required] + username: duke + + # Whether to build the package on a remote server or locally. + # Defaults to `false`. + # [optional] + remoteBuild: false + + # Git author used to commit to the bucket repository. + # [optional] + commitAuthor: + # Name used when authoring commits. + # If left undefined, will use the releaser's commit name. + # [optional] + name: jreleaser-bot + + # E-mail used when authoring commits. + # If left undefined, will use the releaser's commit email. + # [optional] + email: pass:[jreleaser-bot@jreleaser.org] + + # Git repository to push the package it remoteBuild is `true`. + # Defaults are shown. + # [optional] + bucket: + + # The owner of the bucket repository. + # Defaults to the same owner as the release repository. + # [optional] + owner: duke + + # The name of the bucket repository. + # Defaults to `${distribution.name}-chocolatey-bucket`. + # [optional] + name: app-chocolatey-bucket + + # Username used for authoring commits. Must have write access to the bucket repository. + # Defaults to the same username as the release repository. + # [optional] + username: duke + + # Password or OAuth token with write access to the bucket repository. + # If left unspecified, the JRELEASER_CHOCOLATEY_GITHUB_TOKEN environment variable may be defined. + # [optional] + token: 1n$3cUrEP@s$w0rd +---- + +Assuming that the current version is `1.2.3`, and a distribution named `app`, the above configuration will generate +the following files in `out/jreleaser/app/prepare`, which may be published to `app-chocolatey-bucket` + +[source,xml] +[subs="verbatim"] +.app.nuspec +---- + + + + + + app + 1.2.3 + Duke + Sample app + + app + https://acme.com/app + Apache-2.0 + false + + Sample app + https://github.com/duke/app/releases/tag/v1.2.3 + + + + + +---- + +[source] +.tools/chocolateyinstall.ps1 +---- +$tools = Split-Path $MyInvocation.MyCommand.Definition +$package = Split-Path $tools +$app_home = Join-Path $package 'app-1.2.3' +$app_bat = Join-Path $app_home 'bin/app.cmd' + +Install-ChocolateyZipPackage ` + -PackageName 'app' ` + -Url 'https://github.com/duke/app/releases/download/v1.2.3/app-1.2.3.zip' ` + -Checksum '812121a64bbd3f49286f7b0be3c9209068f71fcf9541f313708979602e8de466' ` + -ChecksumType 'sha256' ` + -UnzipLocation $package + +Install-BinFile -Name 'app' -Path $app_bat +---- + +[source] +.tools/chocolateyuninstall.ps1 +---- +$tools = Split-Path $MyInvocation.MyCommand.Definition +$package = Split-Path $tools +$app_home = Join-Path $package 'app-1.2.3' +$app_bat = Join-Path $app_home 'bin/app.cmd' + +Uninstall-BinFile -Name 'app' -Path $app_bat +---- + diff --git a/docs/modules/configuration/pages/packagers/homebrew.adoc b/docs/modules/configuration/pages/packagers/homebrew.adoc new file mode 100644 index 0000000..f3fcfad --- /dev/null +++ b/docs/modules/configuration/pages/packagers/homebrew.adoc @@ -0,0 +1,126 @@ += Homebrew + +The `brew` section specifies how the formula should be created. You can check the +link:https://github.com/Homebrew/brew/blob/master/docs/How-to-Create-and-Maintain-a-Tap.md[Homebrew documentation] and the +link:https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md[formula cookbook] for more details. + +NOTE: At the moment, only artifacts with `.zip` extension may be packaged with Homebrew. + +WARNING: Snapshots are not supported. + +[source,yaml] +[subs="+macros"] +---- +# [optional] +packagers: + # [optional] + brew: + # Enables or disables Homebrew. + # Defaults to `false`. + # [optional] + enabled: true + + # Directory with file templates used to prepare the Homebrew distribution + # Defaults to `src/distribution/${distribution.name}/brew`. + # If specified, path must exist. + # [optional] + templateDirectory: path/to/brew/templates + + # A map of Homebrew dependencies. + # The key `:java` will be added automatically if not defined. + # [optional] + dependencies: + # key in symbol format + # mapped as `depends_on :key1 => "value1"` + ':key1': value1 + + # plain key + # mapped as `depends_on "key2" => "value2"` + key2: value2 + + # key in symbol format without value + # mapped as `depends_on `:key3` + ':key3': 'null' + + # plain key without value + # mapped as `depends_on `"key4"` + key4: 'null' + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `brew`, i.e, `brewFoo`. + foo: bar + + # Git author used to commit to the tap repository. + # [optional] + commitAuthor: + # Name used when authoring commits. + # If left undefined, will use the releaser's commit name. + # [optional] + name: jreleaser-bot + + # E-mail used when authoring commits. + # If left undefined, will use the releaser's commit email. + # [optional] + email: pass:[jreleaser-bot@jreleaser.org] + + # Git repository to push the formula to. + # Defaults are shown. + # [optional] + tap: + + # The owner of the tap repository. + # Defaults to the same owner as the release repository. + # [optional] + owner: duke + + # The name of the tap repository. + # Defaults to `homebrew-tap`. + # [optional] + name: homebrew-tap + + # Username used for authoring commits. Must have write access to the tap repository. + # Defaults to the same username as the release repository. + # [optional] + username: duke + + # Password or OAuth token with write access to the tap repository. + # If left unspecified, the JRELEASER_HOMEBREW_GITHUB_TOKEN environment variable may be defined. + # [optional] + token: 1n$3cUrEP@s$w0rd +---- + +Assuming that the current version is `1.2.3`, and a distribution named `app`, the above configuration will generate +a `app.rb` formula in the `duke/homebrew-tap` repository: + +[source,ruby] +---- +class App < Formula + desc "Sample app" + homepage "https://acme.com/app" + version "1.2.3" + url "https://github.com/duke/app/releases/download/v1.2.3/app-1.2.3.zip" + sha256 "812121a64bbd3f49286f7b0be3c9209068f71fcf9541f313708979602e8de466" + license "Apache-2.0" + + bottle :unneeded + + depends_on :java => "8" + + def install + libexec.install Dir["*"] + bin.install_symlink "#{libexec}/bin/app" + end + + test do + output = shell_output("#{bin}/app --version") + assert_match "1.2.3", output + end +end +---- + +NOTE: JReleaser does not generate a valid homebrew-core formula. The generated formulas are meant to be published as +link:https://docs.brew.sh/Taps.html[homebrew taps], and in their current form will not be accepted in any of the official +homebrew repositories. + diff --git a/docs/modules/configuration/pages/packagers/index.adoc b/docs/modules/configuration/pages/packagers/index.adoc new file mode 100644 index 0000000..bad3c5b --- /dev/null +++ b/docs/modules/configuration/pages/packagers/index.adoc @@ -0,0 +1,38 @@ += Packagers + +After a release is created at the desired remote Git host, JReleaser can generate and publish specialized packagers +into their respective distribution media, such a Git repository you have access to, or a packager store. + +The sections defined here can be applied globally (for all distributions) or per distribution. Global configuration is +inherited by distribution configuration. Here's for example how xref:packagers/homebrew.adoc[] and xref:packagers/Scoop.adoc[] +can be activated for all distributions: + +[source,yaml] +[subs="+macros"] +---- +packagers: + brew: + enabled: true + scoop: + enabled: true +---- + +Given this setup here's how a distribution may inherit that configuration and disable Scoop while keeping Homebrew active: + +[source,yaml] +[subs="+macros"] +---- +packagers: + brew: + enabled: true + scoop: + enabled: true + +distributions: + app: + scoop: + enabled: false + artifacts: + - path: path/to/app-1.0.0.zip +---- + diff --git a/docs/modules/configuration/pages/packagers/jbang.adoc b/docs/modules/configuration/pages/packagers/jbang.adoc new file mode 100644 index 0000000..2b00a13 --- /dev/null +++ b/docs/modules/configuration/pages/packagers/jbang.adoc @@ -0,0 +1,138 @@ += Jbang + +Unleash the power of Java with link:https://github.com/jbangdev/jbang[jbang]. You can publish distributions as jbang +catalogs. + +Each separate executable will have its own jbang script. All executables will be collected in the same catalog. Existing +catalogs located at the target repository will be merged into a single catalog. + +Snapshots are supported, in which case executables will bear the `-snapshot` suffix in their alias. + +[source,yaml] +[subs="+macros"] +---- +# [optional] +packagers: + # [optional] + jbang: + # Enables or disables Jbang. + # Defaults to `false`. + # [optional] + enabled: true + + # Directory with file templates used to prepare the Jbang distribution + # Defaults to `src/distribution/${distribution.name}/jbang`. + # If specified, path must exist. + # [optional] + templateDirectory: path/to/jbang/templates + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `jbang`, i.e, `jbangFoo`. + foo: bar + + # Git author used to commit to the catalog repository. + # [optional] + commitAuthor: + # Name used when authoring commits. + # If left undefined, will use the releaser's commit name. + # [optional] + name: jreleaser-bot + + # E-mail used when authoring commits. + # If left undefined, will use the releaser's commit email. + # [optional] + email: pass:[jreleaser-bot@jreleaser.org] + + # Git repository to push the catalog to. + # Defaults are shown. + # [optional] + catalog: + + # The owner of the catalog repository. + # Defaults to the same owner as the release repository. + # [optional] + owner: duke + + # The name of the catalog repository. + # Defaults to `jbang-catalog`. + # [optional] + name: jbang-catalog + + # Username used for authoring commits. Must have write access to the catalog repository. + # Defaults to the same username as the release repository. + # [optional] + username: duke + + # Password or OAuth token with write access to the catalog repository. + # If left unspecified, the JRELEASER_JBANG_GITHUB_TOKEN environment variable may be defined. + # [optional] + token: 1n$3cUrEP@s$w0rd +---- + +NOTE: You must define a value for `mainClass` in the owning distribution. + +NOTE: When the project's version is snapshot, unless manually updated, the default prepared template assumes JARs may be +resolved from link:https://jitpack.io[]. + +Assuming that the current version is `1.2.3`, and a distribution named `app`, the above configuration will generate +a `app.java` file in the `duke/jbang-catalog` repository: + +[source,json] +.jbang-catalog.json +---- +{ + "aliases": { + "app": { + "script-ref": "app.java", + "description": "Sample app" + } + } +} +---- + +[source,java] +.app.java +---- +//usr/bin/env jbang "$0" "$@" ; exit $? +//JAVA 8 +//DEPS com.acme:app:1.2.3 + +public class app { + public static void main(String... args) throws Exception { + com.acme.Main.main(args); + } +} +---- + +When the version is snapshot then the catalog and the script template change to: + +[source,json] +.jbang-catalog.json +---- +{ + "aliases": { + "app-snapshot": { + "script-ref": "app_snapshot.java", + "description": "Sample app" + } + } +} +---- + +[source,java] +.app_snapshot.java +---- +//usr/bin/env jbang "$0" "$@" ; exit $? +//JAVA 8 +//REPOS jitpack +//DEPS com.github.duke:app:main-SNAPSHOT + +public class app_snapshot { + public static void main(String... args) throws Exception { + com.acme.Main.main(args); + } +} +---- + diff --git a/docs/modules/configuration/pages/packagers/scoop.adoc b/docs/modules/configuration/pages/packagers/scoop.adoc new file mode 100644 index 0000000..b0f0ee3 --- /dev/null +++ b/docs/modules/configuration/pages/packagers/scoop.adoc @@ -0,0 +1,125 @@ += Scoop + +JReleaser can generate and publish a _Scoop App Manifest_ into a repository that you have access to. + +The `scoop` section specifies how the manifest should be created. + +NOTE: At the moment, only artifacts with `.zip` extension may be packaged with Scoop. + +WARNING: Snapshots are not supported. + +[source,yaml] +[subs="+macros"] +---- +# [optional] +packagers: + # [optional] + scoop: + # Enables or disables Scoop. + # Defaults to `false`. + # [optional] + enabled: true + + # Directory with file templates used to prepare the Scoop distribution + # Defaults to `src/distribution/${distribution.name}/scoop`. + # If specified, path must exist. + # [optional] + templateDirectory: path/to/scoop/templates + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `scoop`, i.e, `scoopFoo`. + foo: bar + + # URL used to check the latest version. + # Defaults to the releaser's `latestReleaseUrlFormat`. + # [optional] + checkverUrl: + + # URL used to download a new version. + # Defaults to the releaser's `downloadUrlFormat`. + # [optional] + autoupdateUrl: + + # Git author used to commit to the bucket repository. + # [optional] + commitAuthor: + # Name used when authoring commits. + # If left undefined, will use the releaser's commit name. + # [optional] + name: jreleaser-bot + + # E-mail used when authoring commits. + # If left undefined, will use the releaser's commit email. + # [optional] + email: pass:[jreleaser-bot@jreleaser.org] + + # Git repository to push the app manifest. + # Defaults are shown. + # [optional] + bucket: + + # The owner of the bucket repository. + # Defaults to the same owner as the release repository. + # [optional] + owner: duke + + # The name of the bucket repository. + # Defaults to `${distribution.name}-scoop-bucket`. + # [optional] + name: app-scoop-bucket + + # Username used for authoring commits. Must have write access to the bucket repository. + # Defaults to the same username as the release repository. + # [optional] + username: duke + + # Password or OAuth token with write access to the bucket repository. + # If left unspecified, the JRELEASER_SCOOP_GITHUB_TOKEN environment variable may be defined. + # [optional] + token: 1n$3cUrEP@s$w0rd +---- + +Assuming that the current version is `1.2.3`, and a distribution named `app`, the above configuration will generate +a `manifest.json` formula in the `duke/app-scoop-bucket` repository: + +[source,json] +---- +{ + "homepage": "https://acme.com/app", + "description": "Sample app", + "version": "1.2.3", + "license": "Apache-2.0", + "url": "https://github.com/duke/app/releases/download/v1.2.3/app-1.2.3.zip", + "hash": "sha256:812121a64bbd3f49286f7b0be3c9209068f71fcf9541f313708979602e8de466", + "extract_dir": "app-1.2.3", + "env_add_path": "bin", + "suggest": { + "JDK": [ + "java/oraclejdk", + "java/openjdk" + ] + }, + "checkver": { + "url": "https://github.com/duke/app/releases/latest", + "re": "v([\\d.]+).zip" + }, + "autoupdate": { + "url": "https://github.com/duke/app/releases/download/v1.2.3/app-$version.zip", + "extract_dir": "app-$version", + "hash": { + "url": "$url.sha256" + } + } +} +---- + +Your users can then install your app by doing: + +[source] +---- +scoop bucket add duke https://github.com/duke/app-scoop-bucket.git +scoop install duke/app +---- + diff --git a/docs/modules/configuration/pages/packagers/snap.adoc b/docs/modules/configuration/pages/packagers/snap.adoc new file mode 100644 index 0000000..8bf17f6 --- /dev/null +++ b/docs/modules/configuration/pages/packagers/snap.adoc @@ -0,0 +1,188 @@ += Snap + +link:http://snapcraft.io[Snaps] are a new packaging format, that will let you publish your project directly to the +Ubuntu store. From there it will be installable in all the link:https://snapcraft.io/docs/core/install[supported Linux distros], +with automatic and transactional updates. + +You can read more about it in the link:https://snapcraft.io/docs/[snapcraft docs]. + +NOTE: At the moment, only artifacts with `.tar.gz` or `.tar` extension may be packaged with Snapcraft. + +WARNING: Snapshots are not supported. + +[source,yaml] +[subs="+macros"] +---- +# [optional] +packagers: + # [optional] + snap: + # Enables or disables Snapcraft. + # Defaults to `false`. + # [optional] + enabled: true + + # Directory with file templates used to prepare the Snapcraft distribution + # Defaults to `src/distribution/${distribution.name}/snap`. + # If specified, path must exist. + # [optional] + templateDirectory: path/to/snap/templates + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `snap`, i.e, `snapFoo`. + foo: bar + + # Git author used to commit to the snap repository. + # [optional] + commitAuthor: + # Name used when authoring commits. + # If left undefined, will use the releaser's commit name. + # [optional] + name: jreleaser-bot + + # E-mail used when authoring commits. + # If left undefined, will use the releaser's commit email. + # [optional] + email: pass:[jreleaser-bot@jreleaser.org] + + # Exported snapcraft login credentials. + # Will be sent to local snapcraft build with `snapcraft login --with ${exportedLogin`. + # Required if `remoteBuild` is set to `false`. + exportedLogin: + + # Whether to build the package on a remote server or locally. + # If set to `true` then the package must be configured to be built + # via link:https://snapcraft.io[]. + # Review the docs at link:https://snapcraft.io/build[]. + # Defaults to `false`. + # [optional] + remoteBuild: false + + # Git repository to push the package it remoteBuild is `true`. + # Defaults are shown. + # [optional] + snap: + + # The owner of the snap repository. + # Defaults to the same owner as the release repository. + # [optional] + owner: duke + + # The name of the tap repository. + # Defaults to `homebrew-tap`. + # [optional] + name: homebrew-tap + + # Username used for authoring commits. Must have write access to the snap repository. + # Defaults to the same username as the release repository. + # [optional] + username: duke + + # Password or OAuth token with write access to the snap repository. + # If left unspecified, the JRELEASER_SNAP_GITHUB_TOKEN environment variable may be defined. + # [optional] + token: 1n$3cUrEP@s$w0rd + + # A snap of type base to be used as the execution environment for this snap. + # Valid values are: + # * bare - Empty base snap; + # * core - Ubuntu Core 16; + # * core18 - Ubuntu Core 18. + # Defaults to `core18`. + # [optional] + base: core18 + + # A guardrail to prevent you from releasing a snap to all your users before + # it is ready. + # `devel` will let you release only to the `edge` and `beta` channels in the + # store. `stable` will let you release also to the `candidate` and `stable` + # channels. More info about channels here: + # link:https://snapcraft.io/docs/reference/channels[]. + # Defaults to `stable`. + # [optional] + grade: stable + + # Snaps can be setup to follow three different confinement policies: + # `strict`, `devmode` and `classic`. A strict confinement where the snap + # can only read and write in its own namespace is recommended. Extra + # permissions for strict snaps can be declared as `plugs` for the app, which + # are explained later. More info about confinement here: + # link:https://snapcraft.io/docs/reference/confinement[]. + # Defaults to `strict`. + # [optional] + confinement: strict + + # List of plug names the application is associated with. + # When a plug is connected to one of these slots, the application + # will be granted the permissions specified for that interface. + # If attributes are required, or the plug name does not match the + # interface name, more details must be declared in the `plugs` field. + # link:https://snapcraft.io/docs/reference/interfaces[]. + # [optional] + localPlugs: + - some_plug_name + + # List of slot names the application is associated with. + # When a plug is connected to one of these slots, the application + # will be granted the permissions specified for that interface. + # If attributes are required, or the slot name does not match the + # interface name, more details must be declared in the `slots` field. + # link:https://snapcraft.io/docs/reference/interfaces[]. + # [optional] + localSlots: + - some_slot_name + + # Allows plugs to be configured. + # [optional] + plugs: + some_plug_name: + key: value + + # Allows slots to be configured. + # [optional] + slots: + some_slot_name: + key: value + read: + - $HOME/.foo + write: + - $HOME/.foo + - $HOME/.foobar +---- + +Assuming that the current version is `1.2.3`, and a distribution named `app`, the above configuration will generate +a `snapcraft.yaml` file `out/jreleaser/snap/prepare`, which may be published to `app-snap` + +[source,yaml] +.snapcraft.yaml +---- +name: app +base: core18 +version: 1.2.3 +license: Apache-2.0 +grade: stable +type: app +confinement: strict +summary: Sample app +description: Sample app + +apps: + app: + command: bin/app + environment: + JAVA_HOME: $SNAP/usr/lib/jvm/java + +parts: + app: + plugin: dump + source: https://github.com/duke/app/releases/download/v1.2.3/app-1.2.3.tar.gz + source-checksum: sha256/8e74020ca5e7d01d25c34cf1bd53adcf78c77adf7b53530ae5e0baeb841cb43e + stage-packages: + - openjdk-8-jdk + organize: + usr/lib/jvm/java-8-openjdk*: usr/lib/jvm/java +---- + + diff --git a/docs/modules/configuration/pages/project.adoc b/docs/modules/configuration/pages/project.adoc new file mode 100644 index 0000000..4f33e85 --- /dev/null +++ b/docs/modules/configuration/pages/project.adoc @@ -0,0 +1,82 @@ += Project + +Defines general information about the project. + +[source,yaml] +[subs="+macros"] +---- +project: + # The name of the project. + # [required] + name: app + + # The version to be released. + # May define a JRELEASER_PROJECT_VERSION environment variable instead. + # [required] + version: 1.0.0 + + # A short description (60 chars max). + # [required] + description: My awesome app + + # A more thorough explanation of the project's capabilities. + # May use markdown syntax. + # If left unspecified, will use the value of `description`. + # [optional] + longDescription: | + My Awesome app is the bees knees + + # The project's website. + # [required] + website: pass:[https://acme.com/app] + + # A list of author names. + # [required] + authors: + - Duke + + # A list of tags. + # [optional] + tags: + - cli + - awesome + + # The project's license. + # It's recommended to use a valid SPDX identifier if the project is Open Source. + # See link:https://spdx.org/licenses[]. + # [required] + license: Apache-2.0 + + # Additional properties used when evaluating templates. + # [optional] + extraProperties: + # Key will be capitalized and prefixed with `project`, i.e, `projectFoo`. + foo: bar + + # [required] + java: + # Maven coordinates: groupId. + # Inherited by distributions if they do not define a value for it. + # [required] + groupId: com.acme + + # Maven coordinates: artifactId. + # If undefined, will use ${project.name}. + # Inherited by distributions if they do not define a value for it. + # [required] + artifactId: app + + # The minimum Java version required by consumers to run the application. + # [required] + version: 8 + + # The application's entry point. + # [optional] + mainClass: com.acme.Main + + # Identifies the project as being member of a multi-project build. + # Defaults to `false`. + # [optional] + multiProject : false +---- + diff --git a/docs/modules/configuration/pages/release/github.adoc b/docs/modules/configuration/pages/release/github.adoc new file mode 100644 index 0000000..4bc328f --- /dev/null +++ b/docs/modules/configuration/pages/release/github.adoc @@ -0,0 +1,140 @@ += Github + +[source,yaml] +[subs="+macros"] +---- +# [required] +release: + # Repo in which the release will be created. + # [required] + github: + # Disables or enables publication to GitHub. + # defaults to `true`. + enabled: true + + # The user or organization that owns the repository. + # [required] + owner: duke + + # The name of the repository. + # If unspecified, will use ${project.name}. + # [optional] + name: app + + # The GitHub host url. + # Defaults to `github.com`. + # [required] + host: github.com + + # Username used for authoring commits. Must have write access to the repository. + # [required] + username: duke + + # Password or OAuth token with write access to the repository. + # If left unspecified, the JRELEASER_GITHUB_TOKEN environment variable must be defined. + # [required] + token: 1n$3cUrEP@s$w0rd + + # The tag associated with the release. + # If left unspecified, will use `v${project.version}`. + # [optional] + tagName: v1.0.0 + + # The name of the release. + # If left unspecified, will use `Release ${tagName}`. + # [optional] + releaseName: Release v1.0.0 + + # Drops and creates an existing release with matching tag. + # Defaults to `false`. + # [optional] + overwrite: true + + # Appends artifacts to an existing release with matching tag, + # useful if `overwrite` is set to `false`. + # Defaults to `false`. + # [optional] + allowUploadToExisting: true + + # The GitHub API endpoint to use. + # Update it if using GitHub Enterprise. + # Defaults to `pass:[https://api.github.com]`. + # [optional] + apiEndpoint: pass:[https://api.github.com] + + # Git author used to commit to the repository. + # [optional] + commitAuthor: + # Name used when authoring commits. + # Defaults to `jreleaser-bot`. + # [optional] + name: jreleaser-bot + + # E-mail used when authoring commits. + # Defaults to `pass:[jreleaser-bot@jreleaser.org]`. + # [optional] + email: pass:[jreleaser-bot@jreleaser.org] + + # Signs commits with the configured credentials. + # The xref:configuration:signing.adoc[] section must be configured as well. + # Defaults to `false`. + # [optional] + sign: false + + # Changelog customization. + # [optional] + changelog: + # Disables or enables the changelog. + # defaults to `true`. + # [optional] + enabled: true + + # Sorts commits in ascending (oldest first) or descending (newer first). + # Valid values are: `ASC`, `DESC`. + # Defaults to `DESC`. + # [optional] + sort: DESC + + # Path to an external file that contains the changelog, read as is. + # May be a relative path to the configuration file or an absolute path. + # If unspecified, JReleaser will automatically calculate the changelog. + # [optional] + external: path/to/changelog.md + + # Create explicit markdown links for commit hashes. + # Defaults to `false`. + # [optional] + links: false + + # The target branch to use. + # Defaults to `main`. + # [optional] + targetCommitish: main + + # Marks the release as a draft. + # Defaults to `false`. + # [optional] + draft: false + + # Marks the release as prerelease. + # Defaults to `false`. + # [optional] + prerelease: false + + # The following properties define [optional] URL formats. + # Defaults are shown. + # Review the available xref:configuration:templates.adoc[]. + + repoUrlFormat: pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}] + + commitUrlFormat: pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}/commits] + + downloadUrlFormat: pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/download/{{tagName}}/{{artifactFileName}}] + + releaseNotesUrlFormat: pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/tag/{{tagName}}] + + latestReleaseUrlFormat: pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}/releases/latest] + + issueTrackerUrlFormat: pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}/issues] +---- + diff --git a/docs/modules/configuration/pages/release/index.adoc b/docs/modules/configuration/pages/release/index.adoc new file mode 100644 index 0000000..d99bfe9 --- /dev/null +++ b/docs/modules/configuration/pages/release/index.adoc @@ -0,0 +1,5 @@ += Release + +JReleaser can create and tag a GitHub release, upload all files and generate the changelog based on the new commits since +the previous tag. + diff --git a/docs/modules/configuration/pages/signing.adoc b/docs/modules/configuration/pages/signing.adoc new file mode 100644 index 0000000..828aafd --- /dev/null +++ b/docs/modules/configuration/pages/signing.adoc @@ -0,0 +1,40 @@ += Signing + +Signing ensures that the artifacts have been generated by yourself and your users can verify that by comparing the +generated signature with your public signing key. + +JReleaser can sign all files, including distribution archives and any extra files attached to the project. This section +must be configured if you intent to sign commits as well. + +Use the following options to customize how files may be signed: + +[source,yaml] +[subs="+macros"] +---- +# [optional] +signing: + # Enables or disables file signing. + # Defaults to `false`. + enabled: true + + # Generates an armored signature. + # Defaults to `true`. + armored: true + + # The public GPG (ascii armored) used to sign files and commits. + # If left unspecified, the JRELEASER_GPG_PUBLIC_KEY environment variable must be defined. + # [required] + publicKey: + + # The private GPG (ascii armored) used to sign files and commits. + # If left unspecified, the JRELEASER_GPG_SECRET_KEY environment variable must be defined. + # [required] + secretKey: + + # The passphrase required to read secret keys. + # If left unspecified, the JRELEASER_GPG_PASSPHRASE environment variable must be defined. + # [required] + passphrase: My$3cR3tP@a$sw0rD +---- + +WARNING: Prefer the use of environment variables if the configuration is stored at a public repository. diff --git a/docs/modules/configuration/pages/templates.adoc b/docs/modules/configuration/pages/templates.adoc new file mode 100644 index 0000000..54c30f8 --- /dev/null +++ b/docs/modules/configuration/pages/templates.adoc @@ -0,0 +1,303 @@ += Templates + +Several fields in the JReleaser config file support templating. JReleaser makes use of the +link:https://mustache.github.io/[Mustache] format for its templating support. Packagers rely on input files that +also support templates. A template name can be used as `{{ name }}` + +The following is a list of pre-defined template names: + +.Project + +The following names are related to xref:configuration:project.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| projectName | the project name +| projectNameCapitalized | the project name, capitalized, hyphens replaced by spaces. +| projectVersion | the project version +| projectDescription | the project description +| projectLongDescription | the project long description +| projectWebsite | link to the project website +| projectLicense | the project license, typically an SPDX identifier +| projectAuthorsBySpace | space separated list of author names +| projectAuthorsByComma | commma separated list of author names +| projectTagsBySpace | space separate list of project tags +| projectTagsByComma | comma separate list of project tags +| projectJavaGroupId | the project groupId (Maven coordinates) +| projectJavaArtifactId | the project artifactId (Maven coordinates) +| projectJavaVersion | the project Java version +| projectMainClass | the main class launched by the executable script launcher +|=== + +Additionally, every key/value from `project.extraProperties` is mapped with `project` as key prefix and the capitalized +key, such that + +[source,yaml] +---- +project: + extraProperties: + # Key will be capitalized and prefixed with `project`, i.e, `projectFoo`. + foo: bar +---- + +.Release + +The following names are related to xref:configuration:release/index.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| repoHost | the Git host, i.e. "github.com" +| repoOwner | the owner of the Git repository +| repoName | the name of the Git repository +| repoBranch | the branch on which the release is made +| tagName | the tag being release, defaults to `v{{projectVersion}}` +| releaseName | the release name, defaults to `Release {{tagName}}` +| repoCanonicalName | the canonical name of the repository, `{{repoOwner}}/{{repoName}}` +| repoUrl | the repository URL, `pass:[https://{{repoHost}}/{{repoOwner}}/{{repoName}}]` +| commitsUrl | the URL to find commits +| releaseNotesUrl | the URL pointing to the release +| latestReleaseUrl | the URL pointing to latest release +| issueTrackerUrl | the URL of the issue tracker +| reverseRepoHost | reversed Git host, i.e. "com.github" +|=== + +.Distribution + +The following names are related to xref:configuration:distributions.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| distributionName | the name of the distribution +| distributionExecutable | the name of the executable script launcher +| distributionTagsBySpace | space separate list of distribution tags +| distributionTagsByComma | comma separate list of distribution tags +| distributionJavaGroupId | the distribution groupId (Maven coordinates) +| distributionJavaArtifactId | the distribution artifactId (Maven coordinates) +| distributionJavaVersion | the distribution Java version +| distributionMainClass | the main class launched by the executable script launcher +|=== + +Additionally, every key/value from `distribution..extraProperties` is mapped with `distribution` as key prefix +and the capitalized key, such that + +[source,yaml] +---- +distributions: + theName: + extraProperties: + # Key will be capitalized and prefixed with `distribution`, i.e, `distributionFoo`. + foo: bar +---- + +.Artifact + +The following names identify an artifact without explicit `platform` + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| artifactUrl | the URL required to download the artifact +| artifactSha256 | the SHA256 checksum of the artifact's file +| artifactFileName | the name of the artifact file +|=== + +The following names match the first artifact in a distribution + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| distributionUrl | the URL required to download the artifact +| distributionSha256 | the SHA256 checksum of the artifact's file +| distributionFileName | the name of the artifact file +|=== + +Additional names become available when the artifact defines a `platform` + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| artifact{{CapitalizedPlatform}}Url | the URL required to download the artifact +| artifact{{CapitalizedPlatform}}Sha256 | the SHA256 checksum of the artifact's file +| artifact{{CapitalizedPlatform}}FileName | the name of the artifact file +|=== + +Thus, for artifacts defined as + +[source,yaml] +---- +distributions: + app: + artifacts: + - path: path/to/{{distributionName}}-{{projectVersion}}.zip + - path: path/to/{{distributionName}}-{{projectVersion}}-mac.zip + platform: osx +---- + +The following names will be calculated: + +*1st artifact* + +* artifactUrl +* artifactSha256 +* artifactFileName +* distributionUrl +* distributionSha256 +* distributionFileName + +*Platform specific artifact* + +* artifactOsxUrl +* artifactOsxSha256 +* artifactOsxFileName + +.Brew + +The following names are related to xref:configuration:packagers/homebrew.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| brewDependencies | a map of key/value pairs +|=== + +Additionally, every key/value from `brew.extraProperties` is mapped with `brew` as key prefix and the capitalized +key, such that + +[source,yaml] +---- +packagers: + brew: + extraProperties: + # Key will be capitalized and prefixed with `brew`, i.e, `brewFoo`. + foo: bar +---- + +.Chocolatey + +The following names are related to xref:configuration:packagers/chocolatey.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| chocolateyUsername | the name of the Chocolatey username +|=== + +Additionally, every key/value from `chocolatey.extraProperties` is mapped with `chocolatey` as key prefix and the capitalized +key, such that + +[source,yaml] +---- +packagers: + chocolatey: + extraProperties: + # Key will be capitalized and prefixed with `chocolatey`, i.e, `chocolateyFoo`. + foo: bar +---- + +.Jbang + +The following names are related to xref:configuration:packagers/jbang.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| jbangAliasName | the name of the jbang alias, `{{distributionName}}` or `{{distributionName}}-snapshot` +| jbangAliasClassName | the name of the Jbang executable, `{{distributionName}}` or `{{distributionName}}_snapshot` +| jbangDistributionGA a| calculated Maven coordinates for link:https://jitpack.io[], + +* single: `{{reverseRepoHost}}.{{repoOwner}}:{{distributionArtifactId}` + +* multi: `{{reverseRepoHost}}.{{repoOwner}}.{{repoName}}:{{distributionArtifactId}` +|=== + +Additionally, every key/value from `jbang.extraProperties` is mapped with `jbang` as key prefix and the capitalized +key, such that + +[source,yaml] +---- +packagers: + jbang: + extraProperties: + # Key will be capitalized and prefixed with `jbang`, i.e, `jbangFoo`. + foo: bar +---- + +.Scoop + +The following names are related to xref:configuration:packagers/scoop.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| scoopCheckverUrl | the URL used to check for a release version +| scoopAutoupdateUrl | the URL pattern used to update the package +|=== + +Additionally, every key/value from `scoop.extraProperties` is mapped with `scoop` as key prefix and the capitalized +key, such that + +[source,yaml] +---- +packagers: + scoop: + extraProperties: + # Key will be capitalized and prefixed with `scoop`, i.e, `scoopFoo`. + foo: bar +---- + +.Snap + +The following names are related to xref:configuration:packagers/snap.adoc[] + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| snapBase | the snap base +| snapGrade | the snap grade +| snapConfinement | the snap confinement +| snapHasPlugs | a boolean, when there snap defines plugs +| snapPlugs | a list of `Plugs` +| snapHasSlots | a boolean, when the snap defines slots +| snapSlots | a list of `Slots` +| snapHasLocalPlugs | a boolean, when the snap defines plug names +| snapLocalPlugs | a list of plug names +| snapHasLocalSlots | a boolean, when the snap defines slot names +| snapLocalSlots | a list of slot names +|=== + +A `Plug` defines the following fields + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| name | the plug's name +| attributes | a map of key/value attributes +|=== + +A `Slot` defines the following fields + +[%header, cols="<2,<5", width="100%"] +|=== +| Key | Description +| name | the slot's name +| attributes | a map of key/value attributes +| reads | a list of read names +| writes | a list of write names +| hasReads | a boolean, when the slot defines reads +| hasWrites | a boolean, when the slot defines writes +|=== + +Additionally, every key/value from `snap.extraProperties` is mapped with `snap` as key prefix and the capitalized +key, such that + +[source,yaml] +---- +packagers: + snap: + extraProperties: + # Key will be capitalized and prefixed with `snap`, i.e, `snapFoo`. + foo: bar +---- + diff --git a/docs/modules/tools/nav.adoc b/docs/modules/tools/nav.adoc new file mode 100644 index 0000000..082b6e5 --- /dev/null +++ b/docs/modules/tools/nav.adoc @@ -0,0 +1,6 @@ +.Tools +* xref:cli.adoc[] +* xref:maven.adoc[] +* xref:gradle.adoc[] +* xref:ant.adoc[] +* xref:tool-provider.adoc[] diff --git a/docs/modules/tools/pages/ant.adoc b/docs/modules/tools/pages/ant.adoc new file mode 100644 index 0000000..aa0a171 --- /dev/null +++ b/docs/modules/tools/pages/ant.adoc @@ -0,0 +1,3 @@ += JReleaser Ant Tasks + + diff --git a/docs/modules/tools/pages/cli.adoc b/docs/modules/tools/pages/cli.adoc new file mode 100644 index 0000000..9c9f8d4 --- /dev/null +++ b/docs/modules/tools/pages/cli.adoc @@ -0,0 +1,2 @@ += JReleaser CLI + diff --git a/docs/modules/tools/pages/gradle.adoc b/docs/modules/tools/pages/gradle.adoc new file mode 100644 index 0000000..7c6140e --- /dev/null +++ b/docs/modules/tools/pages/gradle.adoc @@ -0,0 +1,2 @@ += JReleaser Gradle Plugin + diff --git a/docs/modules/tools/pages/maven.adoc b/docs/modules/tools/pages/maven.adoc new file mode 100644 index 0000000..d20145e --- /dev/null +++ b/docs/modules/tools/pages/maven.adoc @@ -0,0 +1,2 @@ += JReleaser Maven Plugin + diff --git a/docs/modules/tools/pages/tool-provider.adoc b/docs/modules/tools/pages/tool-provider.adoc new file mode 100644 index 0000000..ddd938d --- /dev/null +++ b/docs/modules/tools/pages/tool-provider.adoc @@ -0,0 +1,2 @@ += JReleaser Tool Provider +