////
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
////

// ██     ██  █████  ██████  ███    ██ ██ ███    ██  ██████  ██
// ██     ██ ██   ██ ██   ██ ████   ██ ██ ████   ██ ██       ██
// ██  █  ██ ███████ ██████  ██ ██  ██ ██ ██ ██  ██ ██   ███ ██
// ██ ███ ██ ██   ██ ██   ██ ██  ██ ██ ██ ██  ██ ██ ██    ██
//  ███ ███  ██   ██ ██   ██ ██   ████ ██ ██   ████  ██████  ██
//
// Below instructions are shared by all Maven-based Apache Logging Services projects.
// Be extremely cautious while making changes!

// Configuration ///////////////////////////////////////////////////////////////

// Name of the GitHub repository; `logging-parent`, `logging-log4j2`, `logging-log4j-tools`, etc.
:repository-name: logging-log4j-kotlin

// Name of the project; `logging-parent`, `log4j`, `log4j-tools`
:project-name: log4j-kotlin

// Instructions ////////////////////////////////////////////////////////////////

= Release instructions

[WARNING]
====
In the code examples below, assuming the version to be released is `7.8.0`.
====

== Stage the release

. Create and push the release branch:
+
[source,bash]
----
git fetch -p
git checkout -B release/7.8.0 origin/main
git push origin release/7.8.0
----
. Verify that the associated https://github.com/apache/{repository-name}/actions[GitHub Actions workflow] succeeds:
.. `revision` property in `pom.xml` is updated
.. Changelog is released (i.e., `src/changelog/7.8.0` folder is populated)
.. *Signed artifacts* are uploaded to the _Staging Repositories_ in https://repository.apache.org/[repository.apache.org]
.. *Signed distribution and its checksum* (e.g., `apache-{project-name}-7.8.0-{bin,src}.{zip,.zip.asc,.zip.sha512}`) are uploaded to https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository (along with auxiliary files; email texts, etc.)

+
If not, commit necessary fixes, push, and repeat.

+
[TIP]
====
GitHub Actions workflow is idempotent.
You can iterate on the `release/7.8.0` branch to perfect it.
====
. _Close_ the repository in https://repository.apache.org/[repository.apache.org]

== Vote the release

. Send the vote email uploaded to the https://dist.apache.org/repos/dist/dev/logging/log4j[dist.apache.org/repos/dist/**dev**/logging/log4j] Subversion repository
+
[WARNING]
====
**Fix the cited https://repository.apache.org[repository.apache.org] URL** in the generated email!
It changes after every Nexus deployment.
====
+
[WARNING]
====
Make sure your email is sent in plain text, that is, https://infra.apache.org/contrib-email-tips#nohtml[no HTML]!
If you are using GMail, simply enable the _"Plain text mode"_ while composing your message.
====

. Once the consensus is reached within the set time frame, respond to the first post in the thread as follows:
+
[source]
----
Adding my +1.

With that, the release passes with 3 binding +1 votes from <PMC-member-1>, ..., <PMC-member-N>, and me.
I will continue the release process.
----

== Publish the release

=== In the git repository

. Pull the most recent changes and tags
. Tag the release (e.g., `rel/7.8.0`) and push it
+
[source,bash]
----
git tag -a rel/7.8.0 <COMMIT-ID> -m 7.8.0
git push origin rel/7.8.0
----
+
[IMPORTANT]
====
The ASF infrastructure treats ``rel/``-prefixed git tags special and ensures they are immutable for provenance reasons.
====
. Merge `release/7.8.0` to `main`
. Set the revision property to the next development version (e.g., `7.9.0-SNAPSHOT`) in xref:pom.xml[`pom.xml`]
. Commit changes and push the `main` branch
. Delete the local and remote copies of the `release/7.8.0` branch

=== In the ASF infrastructure

. _Release_ the repository in https://repository.apache.org[repository.apache.org]
. In https://dist.apache.org/repos/dist/release/logging/{project-name}[dist.apache.org/repos/dist] Subversion repository,
.. create the `*release*/logging/{project-name}/7.8.0` folder, and copy the signed sources and their checksum from `*dev*/logging/{project-name}` to there
.. delete the folder from an earlier release in `*release*/logging/{project-name}`
.. commit changes
. Report the release at https://reporter.apache.org/[reporter.apache.org]

=== In GitHub

Once the artifacts are visible in https://central.sonatype.dev/[central.sonatype.dev], https://github.com/apache/{repository-name}/releases/new[create a new release in GitHub]

. Use the `rel/7.8.0` tag
. Copy release notes from the generated emails

== Announce the release

. Send the announcement email uploaded to the https://dist.apache.org/repos/dist/dev/logging/{project-name}[dist.apache.org/repos/dist/**dev**/logging/{project-name}] Subversion repository
+
[WARNING]
====
Make sure your email is sent in plain text, that is, https://infra.apache.org/contrib-email-tips#nohtml[no HTML]!
If you are using GMail, simply enable the _"Plain text mode"_ while composing your message.
====
