Skip to content

Commit aefc8c5

Browse files
Merge pull request #103 from antonholmberg/update-docs
Update docs and generate documentation with github actions
2 parents 020582d + acf504f commit aefc8c5

File tree

149 files changed

+161
-99681
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+161
-99681
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Publish Javadoc
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
publish-javadoc:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: 'temurin'
26+
java-version: '17'
27+
cache: 'gradle'
28+
29+
- name: Setup Android SDK
30+
uses: android-actions/setup-android@v3
31+
32+
- name: Grant execute permission for gradlew
33+
run: chmod +x gradlew
34+
35+
- name: Generate Auth Javadoc
36+
run: ./gradlew auth-lib:authReleaseJavadoc
37+
38+
- name: Generate Store Javadoc
39+
run: ./gradlew auth-lib:storeReleaseJavadoc
40+
41+
- name: Prepare gh-pages directory structure
42+
run: |
43+
mkdir -p gh-pages-temp/auth-lib/docs
44+
mkdir -p gh-pages-temp/auth-lib/docs-store
45+
cp -r docs/* gh-pages-temp/auth-lib/docs/ || echo "Auth docs generated"
46+
cp -r docs-store/* gh-pages-temp/auth-lib/docs-store/ || echo "Store docs generated"
47+
48+
- name: Create index page
49+
run: |
50+
cat > gh-pages-temp/index.html << 'EOF'
51+
<!DOCTYPE html>
52+
<html>
53+
<head>
54+
<title>Spotify Android Auth SDK Documentation</title>
55+
<meta charset="UTF-8">
56+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
57+
<style>
58+
body {
59+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
60+
max-width: 800px;
61+
margin: 50px auto;
62+
padding: 20px;
63+
line-height: 1.6;
64+
}
65+
h1 {
66+
color: #1DB954;
67+
border-bottom: 2px solid #1DB954;
68+
padding-bottom: 10px;
69+
}
70+
.flavor {
71+
margin: 20px 0;
72+
padding: 20px;
73+
border: 1px solid #ddd;
74+
border-radius: 8px;
75+
background-color: #f9f9f9;
76+
}
77+
.flavor h2 {
78+
margin-top: 0;
79+
color: #333;
80+
}
81+
.flavor p {
82+
color: #666;
83+
margin: 10px 0;
84+
}
85+
a {
86+
color: #1DB954;
87+
text-decoration: none;
88+
font-weight: 500;
89+
}
90+
a:hover {
91+
text-decoration: underline;
92+
}
93+
.footer {
94+
margin-top: 40px;
95+
padding-top: 20px;
96+
border-top: 1px solid #ddd;
97+
text-align: center;
98+
color: #999;
99+
font-size: 0.9em;
100+
}
101+
</style>
102+
</head>
103+
<body>
104+
<h1>Spotify Android Auth SDK Documentation</h1>
105+
106+
<div class="flavor">
107+
<h2>Auth Flavor</h2>
108+
<p>Standard authentication flavor - opens web browser for login</p>
109+
<a href="auth-lib/docs/index.html">View Auth Javadoc →</a>
110+
</div>
111+
112+
<div class="flavor">
113+
<h2>Store Flavor</h2>
114+
<p>Play Store fallback flavor - redirects to Play Store if Spotify app unavailable</p>
115+
<a href="auth-lib/docs-store/index.html">View Store Javadoc →</a>
116+
</div>
117+
118+
<div class="footer">
119+
<p>Generated from <a href="https://github.com/spotify/android-auth">spotify/android-auth</a></p>
120+
</div>
121+
</body>
122+
</html>
123+
EOF
124+
125+
- name: Deploy to GitHub Pages
126+
uses: peaceiris/actions-gh-pages@v3
127+
with:
128+
github_token: ${{ secrets.GITHUB_TOKEN }}
129+
publish_dir: ./gh-pages-temp
130+
publish_branch: gh-pages
131+
user_name: 'github-actions[bot]'
132+
user_email: 'github-actions[bot]@users.noreply.github.com'
133+
commit_message: 'Update javadoc from ${{ github.sha }}'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
.idea/
55
.DS_Store
66
build/
7+
doc/
8+
doc-store/

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/com.spotify.android/auth.svg)](https://search.maven.org/search?q=g:com.spotify.android)
44

5-
# This repository is now a part of [spotify/android-sdk](https://github.com/spotify/android-sdk). Please post new issues there!
6-
7-
This library is responsible for authenticating the user and fetching the authorization code/access token
8-
that can subsequently be used to play music or in requests to the [Spotify Web API](https://developer.spotify.com/web-api/).
9-
105
# Breaking changes in Spotify Auth library version 2.0.0
116

127
In this version we replaced use of WebView with [Custom Tabs](https://developer.chrome.com/docs/android/custom-tabs/) since Google and Facebook Login no longer support WebViews for authenticating users.
@@ -39,8 +34,24 @@ Below is an example of how this looks for [the auth sample project](auth-sample)
3934
}
4035
```
4136

37+
Since Spotify Auth library version 3.0.0 you also need to provide the path pattern of your redirect URI
38+
39+
```gradle
40+
defaultConfig {
41+
manifestPlaceholders = [
42+
redirectSchemeName: "your-redirect-scheme",
43+
redirectHostName: "your-redirect-host",
44+
redirectPathPattern: "your/redirect/path/pattern" // New mandatory field
45+
]
46+
...
47+
}
48+
```
49+
50+
If you want to retain the previous behavior (accepting any path), use .* as the path pattern.
51+
For more details, see the [Google documentation](https://developer.android.com/guide/topics/manifest/data-element#path).
52+
4253
To learn more see the [Authentication Guide](https://developer.spotify.com/technologies/spotify-android-sdk/android-sdk-authentication-guide/)
43-
and the [API reference](https://spotify.github.io/android-sdk/auth-lib/docs/index.html).
54+
and the [API reference](https://spotify.github.io/android-auth/auth-lib/docs/index.html).
4455

4556
# Flavors
4657

@@ -49,6 +60,12 @@ their behaviour if the Spotify application cannot be used to login:
4960
* `auth` - Opens the web browser to login to Spotify
5061
* `store` - Redirects to the Android Play store to download the Spotify application
5162

63+
# Documentation
64+
65+
Complete API documentation is available for both library flavors:
66+
* [Auth Flavor Javadoc](https://spotify.github.io/android-auth/auth-lib/docs/index.html) - Opens web browser for login
67+
* [Store Flavor Javadoc](https://spotify.github.io/android-auth/auth-lib/docs-store/index.html) - Play Store fallback variant
68+
5269
# Sample Code
5370

5471
Checkout [the sample project](auth-sample).

auth-lib/build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,9 @@ def getSigningVariables() {
146146
}
147147

148148
/*
149-
Deployment to OSSRH repository
150-
1. run: ./gradlew :auth-lib:assembleRelease and then ./gradlew :auth-lib:publishAuthReleasePublicationToMavenRepository
151-
or ./gradlew :auth-lib:publishStoreReleasePublicationToMavenRepository depending on
152-
which flavor of the auth library you want to release.
153-
2. login to https://s01.oss.sonatype.org/ (you need to have access to auth lib OSSRH repository)
154-
3. if everything looks correctly, close and then release the staging repository.
155-
More info here: https://central.sonatype.org/publish/release/
149+
* Publishing is done through ossrh and can onky be done by people with access.
150+
* reach out to the foss channel to get access.
151+
* https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/
156152
*/
157153
afterEvaluate {
158154
publishing {

0 commit comments

Comments
 (0)