Skip to content
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

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

aalmiray
Copy link
Contributor

@aalmiray aalmiray commented Dec 16, 2021

This guide shows how JReleaser may be used to create releases for Quarkus CLI applications built as native executables with GraalVM Native Image.

Copy link
Member

@gsmet gsmet left a 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.

Comment on lines 11 to 15
:toc: macro
:toclevels: 4
:doctype: book
:icons: font
:docinfo1:
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Copy link
Contributor Author

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`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It will also configure the picocli extension in the `pom.xml`
It will also configure the picocli extension in the `pom.xml`:

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Copy link
Contributor Author

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

@aalmiray aalmiray Dec 16, 2021

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.

@aalmiray
Copy link
Contributor Author

aalmiray commented Dec 16, 2021

Applied all suggestions. Squashed and force pushed.

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+]
Copy link
Member

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.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks!

@gsmet gsmet added triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport? labels Dec 16, 2021
@geoand geoand merged commit c6b4c59 into quarkusio:main Dec 16, 2021
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Dec 16, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 16, 2021
@aalmiray aalmiray deleted the guide-jreleaser branch December 16, 2021 16:57
@aalmiray
Copy link
Contributor Author

@gsmet thank you for the reviews!
@geoand thank you for merging!

Is there anything else I have to do from my side to get the guide published on the site?

@geoand
Copy link
Contributor

geoand commented Dec 16, 2021

Thanks for your work on this!

Is there anything else I have to do from my side to get the guide published on the site?

It will become available when 2.6.0.Final is released, which should be soon :)

gastaldi added a commit to gastaldi/quarkus that referenced this pull request Dec 16, 2021
@gsmet gsmet modified the milestones: 2.7 - main, 2.6.1.Final Dec 22, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this pull request Dec 22, 2021
Follow up from quarkusio#22284

(cherry picked from commit 10f5218)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants