[[ReleaseGuide-ReleaseGuide]]
= Apache Camel Quarkus release process
:page-aliases: release-guide.adoc

The process is _mutatis mutandis_ the same as for the main Apache Camel repository - see the
xref:latest@manual::release-guide.adoc[Release guide] page of the Camel documentation.

Here, just a sketch of the repeating part, after you have performed the initial setup following the
xref:latest@manual::release-guide.adoc[Camel Release guide].

== Pre release tasks

* Check for an updated release of the https://github.com/amqphub/quarkus-qpid-jms[Quarkus Qpid JMS Extension] that aligns with the Quarkus version that Camel Quarkus is using. If one is available, update the `quarkus-qpid-jms.version` property in the project root `pom.xml`.

* Close the GitHub release https://github.com/apache/camel-quarkus/milestones[milestone] and assign any remaining issues that aren't covered by the release to the next milestone

== Create a release branch

[source,shell]
----
$ export VERSION=... # the version you are releasing, e.g. 0.1.0
$ export NEXT_VERSION=... # the next development iteration, e.g. 0.1.1-SNAPSHOT
$ git fetch upstream # upstream is git@github.com:apache/camel-quarkus.git
$ git checkout master # master is the branch from which you want to release
$ git reset --hard upstream/master # make sure you are in sync with upstream
$ git checkout -b release/$VERSION
----

== `release:prepare` and `release:perform`

With Camel Quarkus, adding `-Prelease` to `release:prepare` and `release:perform` is not necessary,
because all necessary profiles are set in the configuration of the `maven-release-plugin`.

The Maven command to release is as follows:

[source,shell]
----
$ mvn clean release:clean release:prepare -DreleaseVersion=$VERSION -DdevelopmentVersion=$NEXT_VERSION -B release:perform
----

In case `release:prepare` is successful but an issue occurs during `release:perform`, it could be worth trying to resume from the failing artifact.
For instance, would an issue occurs while performing the release of `camel-quarkus-openapi-java`, a resume attempt could be triggered as below:

[source,shell]
----
$ mvn -DskipTests -Denforcer.skip -Dquarkus.build.skip -Dformatter.skip -Dimpsort.skip deploy -Papache-release -rf :camel-quarkus-openapi-java
----

== Next version in Camel Quarkus master branch

If there are no substantial commits in the release branch, which need to get merged/cherry-picked to `master`, you can
perform this step right after creating the release branch. Otherwise, e.g. if there is a Camel upgrade in the release
branch which is not available on Maven Central yet, it is better to perform this step after the new Camel release is
available on the Central and after all relevant commits were merged/cherry-picked to `master`.

While in the release branch we set the `$NEXT_VERSION` to the next micro SNAPSHOT (e.g. when releasing `0.1.0`,
`$NEXT_VERSION` would be `0.1.1-SNAPSHOT`), in `master`, we typically set the next version to the next minor
SNAPSHOT (the next minor SNAPSHOT of `0.1.0` is `0.2.0-SNAPSHOT`).

[source,shell]
----
$ NEXT_RELEASE=... # e.g. 0.2.0
$ NEXT_SNAPSHOT="${NEXT_RELEASE}-SNAPSHOT"
$ git checkout "master"
$ git reset upstream/master
$ mvn versions:set -DnewVersion=$NEXT_SNAPSHOT
$ sed -i "s|<camel-quarkus.version>[^<]*</camel-quarkus.version>|<camel-quarkus.version>$NEXT_SNAPSHOT</camel-quarkus.version>|" poms/bom/pom.xml poms/bom-test/pom.xml
$ sed -i "s|<camel.quarkus.jvmSince>[^<]*</camel.quarkus.jvmSince>|<camel.quarkus.jvmSince>$NEXT_RELEASE</camel.quarkus.jvmSince>|" tooling/create-extension-templates/runtime-pom.xml
$ sed -i "s|<camel.quarkus.nativeSince>[^<]*</camel.quarkus.nativeSince>|<camel.quarkus.nativeSince>$NEXT_RELEASE</camel.quarkus.nativeSince>|" tooling/create-extension-templates/runtime-pom.xml
$ git add -A
$ git commit -m "Next is $NEXT_RELEASE"
# Send a pull request
----

== Update the Apache Camel Quarkus distribution subversion repository

Once the staging repository has been released, the Apache Camel Quarkus distribution subversion repository should be updated as sketched below.

First, checkout the Apache Camel Quarkus distribution subversion repository:
[source,shell]
----
$ svn co 'https://dist.apache.org/repos/dist/release/camel' camel-releases-dist
----
Add your public key to the file named `KEYS` if not already done.

Assemble the Apache Camel Quarkus distribution:
[source,shell]
----
$ mkdir -p "camel-quarkus/$VERSION"
$ cd "camel-quarkus/$VERSION"
$ export URL='https://repository.apache.org/content/repositories/releases/org/apache/camel/quarkus/camel-quarkus'
$ wget -O "apache-camel-quarkus-$VERSION-src.zip" "$URL/$VERSION/camel-quarkus-$VERSION-src.zip"
$ wget -O "apache-camel-quarkus-$VERSION-src.zip.asc" "$URL/$VERSION/camel-quarkus-$VERSION-src.zip.asc"
$ sha512sum "apache-camel-quarkus-$VERSION-src.zip" > "apache-camel-quarkus-$VERSION-src.zip.sha512"
----
Ensure that only the latest release from each maintained branches is present.
Typically, when releasing e.g. 1.4.0, you may need to delete e.g. 1.3.0:

[source,shell]
----
$ cd .. && ls
$ rm -fr 1.3.0
----
Review the changes:
[source,shell]
----
$ svn diff
----
Commit the changes:
[source,shell]
----
$ svn commit -m "Apache Camel Quarkus $VERSION released artifacts."
----

== Further steps

In addition to the above, the following is needed:

* After releasing the staging repository on https://repository.apache.org[https://repository.apache.org], update the
value of `camel-quarkus-last-release` attribute in https://github.com/apache/camel-quarkus/blob/master/docs/antora.yml#L25[docs/antora.yml]
https://github.com/apache/camel-quarkus/blob/master/docs/antora.yml#L25[antora.yml component descriptor].
* When writing the release announcement blog post, do not forget to add the release note section in https://github.com/apache/camel-website/tree/master/content/releases/q
* https://github.com/apache/camel-quarkus/issues/new[Create a ticket] asking a https://projects.apache.org/committee.html?camel[PMC member] to update the https://reporter.apache.org/addrelease.html?camel[Apache Committee Report Helper]. The ticket title could be as follow.
  Release: The Apache Committee Report Helper should be updated by a PMC member as camel-quarkus-X.Y.Z has been released on YYYY-MM-DD.
* Check the state of `camel-quarkus-master` branch in the
  https://github.com/apache/camel-quarkus-examples[Examples repository]. If the version properties are in sync with
  new Camel Quarkus release and if the tests are passing, merge `camel-quarkus-master` to `master`.
