-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jreleaser guide for native executables #22284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks a lot for taking the time to write this! I spotted a couple of minor things, see inline.
:toc: macro | ||
:toclevels: 4 | ||
:doctype: book | ||
:icons: font | ||
:docinfo1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove all this? It's managed automatically in the website and I don't want it to conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I used getting-started.adoc
as a starting point which also defines these attributes btw ;-)
|
||
== Bootstrapping the project | ||
|
||
First, we need a project that defining a CLI application. We recommend using the xref:picocli.adoc[PicoCLI] extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, we need a project that defining a CLI application. We recommend using the xref:picocli.adoc[PicoCLI] extension. | |
First, we need a project that defines a CLI application. We recommend using the xref:picocli.adoc[PicoCLI] extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
cd app | ||
---- | ||
|
||
This command initializes the file structure and the minimum set of required files in the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command initializes the file structure and the minimum set of required files in the project | |
This command initializes the file structure and the minimum set of required files in the project: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
└── application.properties | ||
---- | ||
|
||
It will also configure the picocli extension in the `pom.xml` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will also configure the picocli extension in the `pom.xml` | |
It will also configure the picocli extension in the `pom.xml`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
Store the newly created token at a safe place for future reference. Next, you have the choice of configuring the token | ||
as an environment variable named `JRELEASER_GITHUB_TOKEN` so that the tool can read it. Alternatively you may store | ||
the token at a secure location of your choosing, using a `.yml`, `.toml`, `.json`, or `.properties` file. The default | ||
location is `~/.jreleaser/config[format]`. For example, using the `.yml` format this file could look like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
location is `~/.jreleaser/config[format]`. For example, using the `.yml` format this file could look like | |
location is `~/.jreleaser/config[format]`. For example, using the `.yml` format this file could look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
|
||
== Configuring Homebrew as a packager | ||
|
||
link:https://brew.sh/[Homebrew] is a popular choice among OSX users to install and manage binaries. Homebrew packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link:https://brew.sh/[Homebrew] is a popular choice among OSX users to install and manage binaries. Homebrew packages | |
link:https://brew.sh/[Homebrew] is a popular choice among macOS users to install and manage binaries. Homebrew packages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
are at their core a Ruby file (known as a formula) that's executed on the target environment to install or upgrade a | ||
particular binary. JReleaser can create formulae from binary distributions such as the one we already have configured. | ||
|
||
For this to work we simply have to enable Homebrew in the JReleaser plugin configuration like so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to work we simply have to enable Homebrew in the JReleaser plugin configuration like so | |
For this to work we simply have to enable Homebrew in the JReleaser plugin configuration like so: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
its first release; subsequent release require less tampering with configuration. We can create a git release and the | ||
Homebrew formula with the `jreleaser:full-release` goal but if you still have some doubts on how things may play out then | ||
you can invoke the goal in dry-run mode that is, let JReleaser perform all local operations as needed without affecting | ||
remote resources such as git repositories. This is how it would look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remote resources such as git repositories. This is how it would look like: | |
remote resources such as Git repositories. This is how it would look like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
* Create a Homebrew formula, publishing to pass:[https://gitcom.com/aamiray/homebrew-tap]. | ||
|
||
Of course no remote repository was affected as we can appreciate the `-Djreleaser.dryrun` property was in effect. If you're | ||
so incline inspect the contents of `target/jreleaser/package/app/brew/Formula/app.rb` which defines the Homebrew formula |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so incline inspect the contents of `target/jreleaser/package/app/brew/Formula/app.rb` which defines the Homebrew formula | |
so inclined, inspect the contents of `target/jreleaser/package/app/brew/Formula/app.rb` which defines the Homebrew formula |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied.
-DclassName="org.acme.cli.GreetingCommand" \ | ||
-Dextensions="picocli" | ||
|
||
cd app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should publish the result of your work as a quickstart project in our quickstart repository. I'm not sure it will fly though as I suppose to really work, you would need this thing in a separate project?
Maybe one option would be to put the whole pom file for reference at the end of this guide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly discussed the idea of an extension with @gunnarmorling however as you may see in this doc most changes are build specific and require no compile/runtime extensions. If this is something that's doable with Quarkus' tool support then I'd be happy to discuss how we could proceed.
Good suggestion on showing the full pom file at the end of the guide. I'll add it.
7812a90
to
ebedf69
Compare
Applied all suggestions. Squashed and force pushed. |
ebedf69
to
50d64f1
Compare
50d64f1
to
7dfd03d
Compare
you can invoke the goal in dry-run mode that is, let JReleaser perform all local operations as needed without affecting | ||
remote resources such as Git repositories. This is how it would look like: | ||
|
||
[source,subs=attributes+] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This listing was rendered very weirdly, I removed the macro+
part and force pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks!
Thanks for your work on this!
It will become available when |
Follow up from quarkusio#22284
Follow up from quarkusio#22284 (cherry picked from commit 10f5218)
This guide shows how JReleaser may be used to create releases for Quarkus CLI applications built as native executables with GraalVM Native Image.