<commit_before>= Publishing Release

:Author: LMAX Development Team
:Email:
:Date: {docdata}

== Prerequisites

1. All tests should be completing successfully in CI and locally
2. The changelog is updated with relevant information
3. `build.gradle` has been updated with the version information for the proposed release, and pushed to GitHub
4. Create a new release via GitHub UI, this should tag the commit

== GPG Key

To sign the artifact, a requirement for public release, you must have a signing GPG key set up.

=== Creating a new GPG signing key

If you already have a GPG signing key, you can skip to the next section.

- If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair:
+
--
[source,shell script]
----
$ gpg --full-generate-key
----
  - At the prompt, specify the kind of key you want, or press Enter to accept the default RSA and RSA.
  - Enter the desired key size. Your key must be at least 4096 bits.
  - Enter the length of time the key should be valid. Press Enter to specify the default selection, indicating that the key doesn't expire.
  - At the prompt, specify the kind of key you want, or press Enter to accept the default RSA and RSA
  - At the prompt, specify the kind of key you want, or press Enter to accept the default RSA and RSA
--

 - If you are not on version 2.1.17 or greater, the `gpg --full-generate-key` command doesn't work:
+
--
[source,shell script]
----
$ gpg --default-new-key-algo rsa4096 --gen-key
----
--

 - Verify that your selections are correct.
 - Enter your user ID information.
 - Type a secure passphrase.
 - (is using gpg >= 2.1) Export the keyring to a gpg file
+
--
[source,shell script]
----
gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
----
--

=== Adding signing options for gradle

 - `signing.keyId` is the last 8 characters of the public key id for the signing key, in this example, `9F712BEC`.
 - `signing.password` is the passphrase for your keyring
 - `signing.secretKeyRingFile` is the absolute path to the secret key ring file containing your private key

[source,shell script]
----
$ gpg --list-secret-keys --keyid-format SHORT
/home/dev/.gnupg/pubring.kbx
-----------------------------
sec   rsa4096/9F712BEC 2021-04-13 [SC]
      6B76BC6777E78FB33B2C2D0A3A7EE8C49F712BEC
uid         [ultimate] LMAX Coder (LMAX Developer) <<EMAIL>>
ssb   rsa4096/A97D3F8A 2021-04-13 [E]

$ cat gradle.properties
signing.keyId=9F712BEC
signing.password=<<PASSWORD> your private key>
signing.secretKeyRingFile=/home/dev/.gnupg/secring.gpg
----

See: https://docs.gradle.org/current/userguide/signing_plugin.html

=== Publish your public key

You need to publish your public key so that sonatype can verify who signed the release artifacts.

----
gpg --keyserver https://keyserver.ubuntu.com/ --send-keys 9F712BEC
----

Note: Other `keyservers` are available

== Release process

1. Clean any existing build data
+
--
[source,shell script]
----
$ ./gradlew clean
----
--
2. Add `gradle.properties` file in the root of the disruptor project with the following content
+
--
[source,shell script]
----<commit_msg>Tidy up publishing release documentation<commit_after>= Publishing Release

:Author: LMAX Development Team
:Email:
:Date: {docdata}

== Prerequisites

1. All tests should be completing successfully in CI and locally
2. The changelog is updated with relevant information
3. `build.gradle` has been updated with the version information for the proposed release, and pushed to GitHub
4. Create a new release via GitHub UI, this should tag the commit

== GPG Key

To sign the artifact, a requirement for public release, you must have a signing GPG key set up.

=== Creating a new GPG signing key

If you already have a GPG signing key, you can skip to the next section.

- If you are on version 2.1.17 or greater, run the command below to generate a GPG key pair:
+
--
[source,shell script]
----
$ gpg --full-generate-key
----
  - At the prompt, specify the kind of key you want, or press Enter to accept the default `RSA and RSA`.
  - Enter the desired key size. Your key must be at least 4096 bits.
  - Enter the length of time the key should be valid. Press Enter to specify the default selection, indicating that the key doesn't expire.
--

 - If you are not on version 2.1.17 or greater, the `gpg --full-generate-key` command doesn't work. Use the following command instead:
+
--
[source,shell script]
----
$ gpg --default-new-key-algo rsa4096 --gen-key
----
--

 - Verify that your selections are correct.
 - Enter your user ID information.
 - Type a secure passphrase.
 - (is using gpg >= 2.1) Export the keyring to a gpg file
+
--
[source,shell script]
----
gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
----
--

=== Adding signing options for gradle

 - `signing.keyId` is the last 8 characters of the public key id for the signing key, in this example, `9F712BEC`.
 - `signing.password` is the passphrase for your keyring
 - `signing.secretKeyRingFile` is the absolute path to the secret key ring file containing your private key

[source,shell script]
----
$ gpg --list-secret-keys --keyid-format SHORT
/home/dev/.gnupg/pubring.kbx
-----------------------------
sec   rsa4096/2657EDD1 2021-12-31 [SC]
      EA38CE5CFD74BBB831611491F9CE691A2657EDD1
uid         [ultimate] LMAX Coders (LMAX Dev Team) <<EMAIL>>
ssb   rsa4096/F4831415 2021-12-31 [E]


$ cat gradle.properties
signing.keyId=2657EDD1
signing.password=<<PASSWORD> used to protect your private key>
signing.secretKeyRingFile=/home/dev/.gnupg/secring.gpg
----

See: https://docs.gradle.org/current/userguide/signing_plugin.html

=== Publish your public key

You need to publish your public key so that sonatype can verify who signed the release artifacts.

----
gpg --keyserver https://keyserver.ubuntu.com/ --send-keys 2657EDD1
----

Note: Other `keyservers` are available

== Release process

1. Clean any existing build data
+
--
[source,shell script]
----
$ ./gradlew clean
----
--
2. Add `gradle.properties` file in the root of the disruptor project with the following content
+
--
[source,shell script]
----
{'fraction_non_alphanumeric': 0.10949738903394256, 'fraction_numerical': 0.030842036553524806, 'mean_word_length': 3.2327348066298343, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3019179', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1868, 'n_words': 797}