Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .claude/skills/deploy-to-maven-central/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
name: deploy-to-maven-central
description: Deploys the library to OSSRH staging and creates a pre-release, but publishing must be done manually via the Sonatype web UI.
disable-model-invocation: true
allowed-tools: Bash(*)
---

# Deploy to Maven Central (OSSRH Staging)

Deploy both `auth` and `store` flavours of the Android auth library to the OSSRH staging repository, then upload the staged deployment for publishing.

## Steps

### 1. Validate `local.properties`

Check that the file `local.properties` in the project root exists and contains all of the following keys:

- `signing.keyId`
- `signing.password`
- `signing.secretKeyRingFile`
- `ossrhUsername`
- `ossrhPassword`

If the file is missing or any key is absent, stop and tell the user:

> `local.properties` must contain the following properties:
>
> ```
> signing.keyId=<gpg signing key>
> signing.password=<gpg signing password>
> signing.secretKeyRingFile=<gpg keyring>
> ossrhUsername=<ossrhUsername>
> ossrhPassword=<ossrhPassword>
> ```

Extract the values of `ossrhUsername` and `ossrhPassword` from `local.properties` for use in later steps. Store them in shell variables `OSSRH_USER` and `OSSRH_PASS`.

### 2. Publish the `auth` flavour

Run Gradle to assemble and publish the **auth** (regular) flavour:

```bash
./gradlew :auth-lib:assembleRelease :auth-lib:publishAuthReleasePublicationToOssrh-staging-apiRepository
```

Wait for this to succeed before continuing.

### 3. Publish the `store` flavour

Run Gradle to assemble and publish the **store** flavour:

```bash
./gradlew :auth-lib:assembleRelease :auth-lib:publishStoreReleasePublicationToOssrh-staging-apiRepository
```

Wait for this to succeed before continuing.

### 4. Generate a base64 auth token

Compute a base64-encoded token from the credentials for the OSSRH staging API:

```bash
TOKEN=$(printf "$OSSRH_USER:$OSSRH_PASS" | base64)
```

### 5. Fetch the staging repository list

Call the OSSRH staging API to get the list of repositories:

```bash
curl -s --fail \
-H "Authorization: Bearer $TOKEN" \
https://ossrh-staging-api.central.sonatype.com/manual/search/repositories
```

### 6. Extract the repository key

Parse the JSON response to extract the repository key. It is the `key` field of the first (or only) entry in the `repositories` array. Save this as `REPO_KEY`.

### 7. Upload the repository

POST to the upload endpoint to promote the staged repository:

```bash
curl -s --fail -X POST \
-H "Authorization: Bearer $TOKEN" \
"https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$REPO_KEY"
```

### 8. Report result

If all steps succeeded, tell the user:

> Deployment uploaded successfully. To complete publishing, log in to the [Sonatype OSSRH portal](https://central.sonatype.com) and manually release the staged repository.

If any step failed, report the error and stop.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Change Log
==========

## Version 4.0.1
- Fix: Ensure auth progress is preserved across configuration changes, preventing cases where a headless activity remains open and blocks user input.

## Version 4.0.0
- **Breaking Change**: Added new `AuthorizationResponse.Type.CANCELLED` to differentiate user-initiated cancellations from technical errors.
- User cancellations (browser closed, back button pressed) now return `Type.CANCELLED` with `RESULT_CANCELED`
Expand Down
2 changes: 1 addition & 1 deletion auth-lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ plugins {
}

group = "com.spotify.android"
version = "4.0.0"
version = "4.0.1"

val archivesBaseName = "auth"

Expand Down