Skip to content

Commit

Permalink
Document Maven Central; add back GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthetechie committed Aug 15, 2024
1 parent 5b4ce12 commit 47329a6
Show file tree
Hide file tree
Showing 4 changed files with 464 additions and 175 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
env:
STADIA_API_KEY: ${{ secrets.STADIA_API_KEY }}

- name: Stage the package
- name: Gradle Publish
run: ./gradlew publish
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
Expand Down
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,13 @@ your stack (ex: using okhttp), we've written a tutorial on generating code withi
You'll need an access token to install from GitHub packages. See the [GitHub Packages docs](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#authenticating-to-github-packages)
for details.

### Add the repository to build script
### Add Maven Central to your build script

Add the repository to your `repositories` block like so.

Kotlin build script (`build.gradle.kts`):
Add the following to your build script (`build.gradle.kts` or `build.gradle`):

```kotlin
repositories {
mavenCentral()

maven {
url = uri("https://maven.pkg.github.com/stadiamaps/stadiamaps-api-kotlin")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.token") as String? ?: System.getenv("TOKEN")
}
}
}
```

Groovy build script (`build.gradle`):

```groovy
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/stadiamaps/stadiamaps-api-kotlin")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.token") ?: System.getenv("TOKEN")
}
}
}
```

Expand All @@ -62,7 +36,7 @@ dependencies {
val retrofitVersion = "2.9.0"

// API package
implementation("com.stadiamaps:api:1.0.0")
implementation("com.stadiamaps:api:3.2.0")

// Dependencies
implementation("com.squareup.moshi:moshi-kotlin:1.15.1")
Expand All @@ -81,7 +55,7 @@ dependencies {
def retrofitVersion = "2.9.0"
// API package
implementation 'com.stadiamaps:api:1.0.0'
implementation 'com.stadiamaps:api:3.2.0'
// Dependencies
implementation 'com.squareup.moshi:moshi-kotlin:1.15.1'
Expand Down
9 changes: 9 additions & 0 deletions generated-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ sourceSets {

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/stadiamaps/stadiamaps-api-kotlin")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}

maven {
url = stagingDir.asFile.toURI()
}
Expand Down
Loading

0 comments on commit 47329a6

Please sign in to comment.