Skip to content

Commit 6e5f72e

Browse files
committed
Refactored Publishing to Maven Central section in CONTRIBUTING.md, updated
release process steps
1 parent ea23c86 commit 6e5f72e

1 file changed

Lines changed: 50 additions & 34 deletions

File tree

CONTRIBUTING.md

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,47 @@ In the project where you want to use the updated library:
120120
> - The `mavenLocal()` repository should typically be used only during development to avoid conflicts with published versions in remote repositories.
121121
> - Remember to remove `mavenLocal()` and revert the version before committing your changes.
122122
123+
## Publishing to Maven Central
124+
125+
> [!IMPORTANT]
126+
> Publishing to Maven Central should only be done after merging a release PR and creating a release tag.
127+
> Use the [GitHub Actions workflow](https://github.com/ably/ably-chat-kotlin/actions/workflows/release.yaml) to publish releases (see Step 11 in the [Release Process](#release-process)).
128+
> The instructions below are for reference and manual publishing in exceptional circumstances only.
129+
130+
### Prerequisites for Publishing to Maven Central
131+
132+
Ensure you have the following configured in your `~/.gradle/gradle.properties`:
133+
134+
1. Sonatype OSSRH account credentials:
135+
```properties
136+
mavenCentralUsername=user-token-username
137+
mavenCentralPassword=user-token-password
138+
```
139+
2. GPG key for signing artifacts:
140+
141+
- Generate a key pair if you don't have one: `gpg --gen-key`
142+
- Export the secret key to gradle.properties:
143+
```properties
144+
signing.keyId=short-key-id
145+
signing.password=key-password
146+
signing.secretKeyRingFile=/path/to/.gnupg/secring.gpg
147+
```
148+
149+
### Publishing Command
150+
151+
To publish and release to Maven Central, run:
152+
153+
```bash
154+
./gradlew publishAndReleaseToMavenCentral
155+
```
156+
157+
> [!NOTE]
158+
> The CI workflow (`.github/workflows/release.yaml`) uses in-memory signing with environment variables instead of file-based signing:
159+
> - `ORG_GRADLE_PROJECT_signingInMemoryKey` - The GPG private key
160+
> - `ORG_GRADLE_PROJECT_signingInMemoryKeyId` - The GPG key ID
161+
> - `ORG_GRADLE_PROJECT_signingInMemoryKeyPassword` - The GPG key password
162+
163+
123164
## Documentation
124165

125166
The source of truth for documentation for the Ably Chat SDKs can be found on the [Ably Docs repository](https://github.com/ably/docs).
@@ -130,17 +171,14 @@ Any releases must be accompanied by a PR to bump the library install version in
130171

131172
## Validate website docs snippet changes
132173

133-
As part of the [release process](#release-process) (see Step 5), you should validate that the web documentation code snippets are accurate
134-
and up-to-date with the SDK source code. This is done by running the following prompt against a locally cloned copy of the
135-
[ably/docs](https://github.com/ably/docs) repository and this SDK repository.
174+
To validate that the web documentation code snippets are accurate and up-to-date with the SDK source code, run the following prompt against a locally cloned copy of the [ably/docs](https://github.com/ably/docs) repository and this SDK repository.
136175

137176
> [!IMPORTANT]
138177
> This prompt should be run with the most powerful LLM available to you (e.g. Claude Opus, GPT-4, etc.) for the best results.
139178
140-
Replace `{DOCS_PATH}` with the path to your local clone of the [ably/docs](https://github.com/ably/docs) repository, `{SDK_NAME}` with
141-
`ably-chat-kotlin`, and `{SDK_PATH}` with the path to your local clone of this SDK repository.
179+
Replace `{DOCS_PATH}` with the path to your local clone of the [ably/docs](https://github.com/ably/docs) repository, `{SDK_NAME}` with `ably-chat-kotlin`, and `{SDK_PATH}` with the path to your local clone of this SDK repository.
142180

143-
~~~
181+
```text
144182
Verify all `kotlin` and `android` annotated code snippets in `.mdx` files located at `{DOCS_PATH}` against the `{SDK_NAME}` source code repository at `{SDK_PATH}`.
145183
146184
### Verification Steps:
@@ -155,8 +193,8 @@ Verify all `kotlin` and `android` annotated code snippets in `.mdx` files locate
155193
- Namespaces and import requirements
156194
157195
3. **Cross-check each snippet** for the following issues:
158-
- **Syntax errors**: Missing keywords (e.g., `new` for constructors), missing semicolons, incorrect brackets
159-
- **Naming conventions**: Verify casing matches the language conventions (e.g., PascalCase for C# properties, camelCase for JavaScript)
196+
- **Syntax errors**: Incorrect object construction (Kotlin uses `MyClass()` not `new MyClass()`), missing `suspend` modifier, missing `val`/`var` for declarations, incorrect lambda syntax, incorrect null-safety operators (`?.`, `!!`, `?:`)
197+
- **Naming conventions**: Verify casing matches Kotlin conventions (`PascalCase` for classes/objects/enums, `camelCase` for functions/properties/variables, `SCREAMING_SNAKE_CASE` for `const val` constants)
160198
- **API accuracy**: Verify method names, property names, and enum values exist in the SDK
161199
- **Type correctness**: Verify correct types are used (e.g., `ConnectionEvent` vs `ConnectionState`)
162200
- **Namespace/import requirements**: Note any required imports that are missing from examples
@@ -175,7 +213,7 @@ Verify all `kotlin` and `android` annotated code snippets in `.mdx` files locate
175213
176214
### Output Format:
177215
Create/update a markdown report file `chat_kotlin_api_verification_report.md` with all findings.
178-
~~~
216+
```
179217

180218
## Release Process
181219

@@ -198,34 +236,12 @@ This library uses [semantic versioning](http://semver.org/). For each release, t
198236
- Also ensure that the "Full Changelog" link points to the new version tag instead of the `HEAD`.
199237

200238
4. Commit [CHANGELOG](./CHANGELOG.md)
201-
5. Run the [Validate website docs snippet changes](#validate-website-docs-snippet-changes) locally to verify that all `kotlin` and `android` code
202-
snippets in the [web documentation](https://github.com/ably/docs) are accurate and up-to-date with the SDK source code. Review the generated report and fix any issues found.
203-
6. Create a PR on the [website docs](https://github.com/ably/docs), [website snippets](https://github.com/ably/website) and
204-
[voltaire snippets](https://github.com/ably/voltaire/) that updates the SDK version in the setup/installation guide. Additionally, include fixes for any documentation issues identified in Step 5. Even if there are no public API changes, a PR must still be created to update the
205-
SDK version.
239+
5. If you’ve deprecated any public methods or properties, made changes to public interfaces, or are uncertain about the impact of your updates, run the [Validate website docs snippet changes](#validate-website-docs-snippet-changes) task locally. This will verify that the `kotlin` or `android` code snippets in the web documentation (https://github.com/ably/docs) are accurate and aligned with the current SDK source. Review the generated report and address any issues it identifies.
240+
6. Create a PR on the [website docs](https://github.com/ably/docs) that updates the SDK version in the setup/installation guide. Additionally, include fixes for any documentation issues identified in the previous step. Even if there are no public API changes, a PR must still be created to update the SDK version.
206241
7. Make a PR against `main`
207242
8. Once the PR is approved, merge it into `main`
208243
9. Add a tag to the new `main` head commit and push to origin such as `git tag v1.2.4 && git push origin v1.2.4`
209244
10. Visit [https://github.com/ably/ably-chat-kotlin/tags](https://github.com/ably/ably-chat-kotlin/tags) and add release notes for the release including links to the changelog entry.
210245
11. Use the [GitHub action](https://github.com/ably/ably-chat-kotlin/actions/workflows/release.yaml) to publish the release. Run the workflow on the release tag created in Step 9.
211-
12. Merge any [website docs](https://github.com/ably/docs) PRs related to the changes, including the one you created in Step 6.
246+
12. Merge any [website docs](https://github.com/ably/docs) PRs related to the changes created in Step 6.
212247
13. Create the entry on the [Ably Changelog](https://changelog.ably.com/) (via [headwayapp](https://headwayapp.co/))
213-
214-
### Publishing to Maven Central
215-
216-
Ensure you have the following configured in your `~/.gradle/gradle.properties`:
217-
218-
1. Sonatype OSSRH account credentials:
219-
```properties
220-
mavenCentralUsername=user-token-username
221-
mavenCentralPassword=user-token-password
222-
```
223-
2. GPG key for signing artifacts:
224-
225-
- Generate a key pair if you don't have one: `gpg --gen-key`
226-
- Export the secret key to gradle.properties:
227-
```properties
228-
signing.keyId=short-key-id
229-
signing.password=key-password
230-
signing.secretKeyRingFile=/path/to/.gnupg/secring.gpg
231-
```

0 commit comments

Comments
 (0)