Skip to content

Commit

Permalink
Merge pull request #25 from Bram--/dev
Browse files Browse the repository at this point in the history
Published to MavenCentral - update gradle file and README
  • Loading branch information
Bram-- authored Mar 2, 2024
2 parents 9cd98e4 + 070d423 commit 876cd82
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 21 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ jobs:
run: ./gradlew build

- name: Publish package
run: ./gradlew publish
run: ./gradlew publishAllPublicationsToCentralPortal
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Build](https://github.com/Bram--/bggclient/actions/workflows/ci.yml/badge.svg)](https://github.com/Bram--/bggclient/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/Bram--/bggclient/graph/badge.svg?token=FJDN8I5FR1)](https://codecov.io/gh/Bram--/bggclient)
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Build](https://github.com/Bram--/bggclient/actions/workflows/ci.yml/badge.svg)](https://github.com/Bram--/bggclient/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/Bram--/bggclient/graph/badge.svg?token=FJDN8I5FR1)](https://codecov.io/gh/Bram--/bggclient) [![Maven Central](https://img.shields.io/maven-central/v/org.audux.bgg/bggclient.svg)](https://central.sonatype.com/artifact/org.audux.bgg/bggclient)

# Board Game Geek Client/BGGClient

Expand Down Expand Up @@ -35,15 +35,24 @@ A short summary of all available APIs/Endpoints available.

## Usage

TODO: Publish
The library is published on [MavenCentral as bggclient](https://central.sonatype.com/artifact/org.audux.bgg/bggclient) so using it is as simple as adding a single line to Gradle.

##### Gradle

TODO: Publish
```kotlin
implementation("org.audux.bgg:bggclient:0.5.1")
```

##### Maven

TODO: Publish
```xml
<dependency>
<groupId>org.audux.bgg</groupId>
<artifactId>bggclient</artifactId>
<version>0.5.0</version>
</dependency>
```


## Examples

Expand Down
34 changes: 23 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ plugins {
jacoco
`java-library`
`maven-publish`
signing
alias(libs.plugins.org.jetbrains.kotlin.jvm)
alias(libs.plugins.ktfmt.gradle)
id("com.gradleup.nmcp").version("0.0.4")
}

java {
Expand All @@ -13,14 +15,15 @@ java {

publishing {
publications {
create<MavenPublication>("maven") {
create<MavenPublication>("mavenJava") {
groupId = "org.audux.bgg"
artifactId = "bggclient"
version = "0.5.0"
version = "0.5.1"

pom {
name = "Unofficial JVM BGG client"
description = "Wrapper around the Board Game Geek's XML1 and XML2 APIs"
description =
"Library to fetch data from the Board game geek (XML) APIs. Usable in Java and Kotlin on the JVM or Android."
url = "https://github.com/Bram--/bggclient"
licenses {
license {
Expand All @@ -45,15 +48,24 @@ publishing {
from(components["java"])
}
}
}

repositories {
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
nmcp {
publish("mavenJava") {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
publicationType = "AUTOMATIC"
}
}

signing {
if (project.gradle.startParameter.taskNames.contains("publishAllPublicationsToCentralPortal")) {
afterEvaluate {
useInMemoryPgpKeys(
System.getenv("GPG_SIGNING_KEY"),
System.getenv("GPG_SIGNING_PASSWORD")
)
sign(publishing.publications["mavenJava"])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
implementation("io.coil-kt:coil-compose:2.5.0")
implementation("org.audux.bgg:bggclient:0.5.0")
implementation("org.audux.bgg:bggclient:0.5.1")

testImplementation("junit:junit:4.13.2")

Expand Down
2 changes: 1 addition & 1 deletion examples/java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

dependencies {
implementation("org.audux.bgg:bggclient:0.5.0")
implementation("org.audux.bgg:bggclient:0.5.1")

testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
Expand Down
2 changes: 1 addition & 1 deletion examples/paginate/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ application {
}

dependencies {
implementation("org.audux.bgg:bggclient:0.5.0")
implementation("org.audux.bgg:bggclient:0.5.1")

testImplementation("org.jetbrains.kotlin:kotlin-test")
}
Expand Down

0 comments on commit 876cd82

Please sign in to comment.