Skip to content

Commit d4abf62

Browse files
Merge pull request #110 from antonholmberg/release-4.0.1
Release 4.0.1
2 parents eb390c6 + d9dea2c commit d4abf62

3 files changed

Lines changed: 100 additions & 1 deletion

File tree

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
name: deploy-to-maven-central
3+
description: Deploys the library to OSSRH staging and creates a pre-release, but publishing must be done manually via the Sonatype web UI.
4+
disable-model-invocation: true
5+
allowed-tools: Bash(*)
6+
---
7+
8+
# Deploy to Maven Central (OSSRH Staging)
9+
10+
Deploy both `auth` and `store` flavours of the Android auth library to the OSSRH staging repository, then upload the staged deployment for publishing.
11+
12+
## Steps
13+
14+
### 1. Validate `local.properties`
15+
16+
Check that the file `local.properties` in the project root exists and contains all of the following keys:
17+
18+
- `signing.keyId`
19+
- `signing.password`
20+
- `signing.secretKeyRingFile`
21+
- `ossrhUsername`
22+
- `ossrhPassword`
23+
24+
If the file is missing or any key is absent, stop and tell the user:
25+
26+
> `local.properties` must contain the following properties:
27+
>
28+
> ```
29+
> signing.keyId=<gpg signing key>
30+
> signing.password=<gpg signing password>
31+
> signing.secretKeyRingFile=<gpg keyring>
32+
> ossrhUsername=<ossrhUsername>
33+
> ossrhPassword=<ossrhPassword>
34+
> ```
35+
36+
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`.
37+
38+
### 2. Publish the `auth` flavour
39+
40+
Run Gradle to assemble and publish the **auth** (regular) flavour:
41+
42+
```bash
43+
./gradlew :auth-lib:assembleRelease :auth-lib:publishAuthReleasePublicationToOssrh-staging-apiRepository
44+
```
45+
46+
Wait for this to succeed before continuing.
47+
48+
### 3. Publish the `store` flavour
49+
50+
Run Gradle to assemble and publish the **store** flavour:
51+
52+
```bash
53+
./gradlew :auth-lib:assembleRelease :auth-lib:publishStoreReleasePublicationToOssrh-staging-apiRepository
54+
```
55+
56+
Wait for this to succeed before continuing.
57+
58+
### 4. Generate a base64 auth token
59+
60+
Compute a base64-encoded token from the credentials for the OSSRH staging API:
61+
62+
```bash
63+
TOKEN=$(printf "$OSSRH_USER:$OSSRH_PASS" | base64)
64+
```
65+
66+
### 5. Fetch the staging repository list
67+
68+
Call the OSSRH staging API to get the list of repositories:
69+
70+
```bash
71+
curl -s --fail \
72+
-H "Authorization: Bearer $TOKEN" \
73+
https://ossrh-staging-api.central.sonatype.com/manual/search/repositories
74+
```
75+
76+
### 6. Extract the repository key
77+
78+
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`.
79+
80+
### 7. Upload the repository
81+
82+
POST to the upload endpoint to promote the staged repository:
83+
84+
```bash
85+
curl -s --fail -X POST \
86+
-H "Authorization: Bearer $TOKEN" \
87+
"https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$REPO_KEY"
88+
```
89+
90+
### 8. Report result
91+
92+
If all steps succeeded, tell the user:
93+
94+
> Deployment uploaded successfully. To complete publishing, log in to the [Sonatype OSSRH portal](https://central.sonatype.com) and manually release the staged repository.
95+
96+
If any step failed, report the error and stop.

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Change Log
22
==========
33

4+
## Version 4.0.1
5+
- Fix: Ensure auth progress is preserved across configuration changes, preventing cases where a headless activity remains open and blocks user input.
6+
47
## Version 4.0.0
58
- **Breaking Change**: Added new `AuthorizationResponse.Type.CANCELLED` to differentiate user-initiated cancellations from technical errors.
69
- User cancellations (browser closed, back button pressed) now return `Type.CANCELLED` with `RESULT_CANCELED`

auth-lib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ plugins {
3535
}
3636

3737
group = "com.spotify.android"
38-
version = "4.0.0"
38+
version = "4.0.1"
3939

4040
val archivesBaseName = "auth"
4141

0 commit comments

Comments
 (0)