Skip to content

Commit

Permalink
release: 0.43.1 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat authored Mar 31, 2024
1 parent 938355f commit be6be71
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 58 deletions.
48 changes: 35 additions & 13 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ on:
- created

env:
JAVA_VERSION: '17'
JAVA_VERSION: '21'
JAVA_DISTRIBUTION: 'microsoft'

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
Expand All @@ -32,16 +32,16 @@ jobs:
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Build
run: ./gradlew build
- name: Persist JAR Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: libs
path: build/libs/*.jar
Expand All @@ -61,13 +61,13 @@ jobs:
]
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download JAR Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: libs
path: android_test/app/libs/
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
Expand All @@ -84,22 +84,44 @@ jobs:
arch: x86_64
profile: 'pixel_2'
deploy:
deploy-gh-releases:
needs: [ android-test ]
permissions:
contents: write
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download JAR Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: libs
path: libs
- name: Upload artifacts to GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
libs/*.jar
deploy-maven-central:
needs: [ android-test ]
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToCentralPortal
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.43.1
* Bump `java-stellar-sdk` from 0.43.0 to 0.43.1. ([#4](https://github.com/lightsail-network/java-stellar-sdk-android-spi/pull/4))
* Publish the publication to Maven Central. ([#4](https://github.com/lightsail-network/java-stellar-sdk-android-spi/pull/4))
* Build the project with JDK 21. ([#4](https://github.com/lightsail-network/java-stellar-sdk-android-spi/pull/4))

## 0.43.0
* Bump `java-stellar-sdk` from 0.42.0 to 0.43.0

Expand Down
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
# java-stellar-sdk-android-spi

[![Test and Deploy](https://github.com/stellar/java-stellar-sdk-android-spi/actions/workflows/test-deploy.yml/badge.svg?branch=main)](https://github.com/stellar/java-stellar-sdk-android-spi/actions/workflows/test-deploy.yml)
[![](https://jitpack.io/v/stellar/java-stellar-sdk-android-spi.svg)](https://jitpack.io/#stellar/java-stellar-sdk-android-spi)
[![Test and Deploy](https://github.com/lightsail-network/java-stellar-sdk-android-spi/actions/workflows/test-deploy.yml/badge.svg?branch=main)](https://github.com/lightsail-network/java-stellar-sdk-android-spi/actions/workflows/test-deploy.yml)
[![Maven Central Version](https://img.shields.io/maven-central/v/network.lightsail/stellar-sdk-android-spi)](https://central.sonatype.com/artifact/network.lightsail/stellar-sdk-android-spi)

The goal of this library is to enable users to conveniently integrate the Java Stellar SDK into lower versions of the Android platform. In this context, lower versions refer to Android API level 23 to 27. If your minSdk is set to 28 or higher, you do not need to include this library.
The goal of this library is to enable users to conveniently integrate the Java Stellar SDK into lower versions of the
Android platform. In this context, lower versions refer to Android API level 23 to 27. If your minSdk is set to 28 or
higher, you do not need to include this library.

## Installation

### Maven

Use [jitpack.io](https://jitpack.io)'s Maven repository:
### Apache Maven

```xml
<dependency>
<groupId>network.lightsail</groupId>
<artifactId>stellar-sdk-android-spi</artifactId>
<version>0.43.1</version>
</dependency>
```
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.github.stellar:java-stellar-sdk:{version}'
implementation 'com.github.stellar:java-stellar-sdk-android-spi:{version}'
}

### Gradle

```groovy
implementation 'network.lightsail:stellar-sdk-android-spi:0.43.1'
```

The versions of `java-stellar-sdk` and `java-stellar-sdk-android-spi` should be maintained at the same version.

The list of versions to install can be found in the [Releases](https://github.com/stellar/java-stellar-sdk-android-spi/releases) section. More information can be found in [jitpack.io docs](https://jitpack.io/docs/).
You can find instructions on how to install this dependency using alternative package
managers [here](https://central.sonatype.com/artifact/network.lightsail/stellar-sdk-android-spi).

### JAR

Download the latest jar from the GitHub repo's [releases tab](https://github.com/stellar/java-stellar-sdk-android-spi/releases). Add the `jar` package to your project according to how your environment is set up.
Download the latest jar from the GitHub
repo's [releases tab](https://github.com/lightsail-network/java-stellar-sdk-android-spi/releases). Add the `jar` package
to your project according to how your environment is set up.
5 changes: 2 additions & 3 deletions android_test/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ dependencies {
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation(files("libs/stellar-sdk-android-spi.jar"))
implementation("com.github.stellar:java-stellar-sdk:0.43.0")

implementation(files("libs/stellar-sdk-android-spi-0.43.1.jar"))
implementation("network.lightsail:stellar-sdk:0.43.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
1 change: 0 additions & 1 deletion android_test/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}

Expand Down
75 changes: 53 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
plugins {
id("java")
id("java-library")
id("signing")
id("maven-publish")
id("project-report")
id("com.diffplug.spotless") version "6.21.0"
id("com.github.ben-manes.versions") version "0.48.0"
id("com.gradleup.nmcp") version "0.0.4"
}

group = "stellar"
version = "0.43.0"
group = "network.lightsail"
version = "0.43.1"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}

spotless {
Expand All @@ -25,22 +28,13 @@ spotless {

repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}

dependencies {
implementation("com.github.stellar:java-stellar-sdk:0.43.0")
implementation("network.lightsail:stellar-sdk:0.43.1")
}

tasks {
jar {
manifest {
attributes["Implementation-Title"] = "stellar-sdk-android-spi"
attributes["Implementation-Version"] = version
}
archiveFileName = "stellar-sdk-android-spi.jar"
}

register<Copy>("updateGitHook") {
from("scripts/pre-commit.sh") { rename { it.removeSuffix(".sh") } }
into(".git/hooks")
Expand All @@ -58,31 +52,68 @@ tasks {
}
}

artifacts {
archives(tasks.jar)
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "stellar-sdk-android-spi"
from(components["java"])
pom {
name.set("java-stellar-sdk-android-spi")
name.set("stellar-sdk-android-spi")
description.set("Java Stellar SDK Android SPI implementation")
url.set("https://github.com/stellar/java-stellar-sdk-android-spi")
url.set("https://github.com/lightsail-network/java-stellar-sdk-android-spi")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/stellar/java-stellar-sdk-android-spi/blob/master/LICENSE")
url.set("https://github.com/lightsail-network/java-stellar-sdk-android-spi/blob/main/LICENSE")
distribution.set("https://github.com/lightsail-network/java-stellar-sdk-android-spi/blob/main/LICENSE")
}
}
developers {
developer {
id.set("stellar")
name.set("Stellar Development Foundation")
id.set("overcat")
name.set("Jun Luo")
url.set("https://github.com/overcat")
}
organization {
name.set("Lightsail Network")
url.set("https://github.com/lightsail-network")
}
}
scm {
url.set("https://github.com/lightsail-network/java-stellar-sdk-android-spi")
connection.set("scm:git:https://github.com/lightsail-network/java-stellar-sdk-android-spi.git")
developerConnection.set("scm:git:ssh://git@github.com/lightsail-network/java-stellar-sdk-android-spi.git")
}
}
}
}
}

signing {
val publishCommand = "publishAllPublicationsToCentralPortal"
isRequired = gradle.startParameter.taskNames.contains(publishCommand)
println("Need to sign? $isRequired")
// https://docs.gradle.org/current/userguide/signing_plugin.html#using_in_memory_ascii_armored_openpgp_subkeys
// export SIGNING_KEY=$(gpg2 --export-secret-keys --armor {SIGNING_KEY_ID} | grep -v '\-\-' | grep -v '^=.' | tr -d '\n')
val signingKey = System.getenv("SIGNING_KEY")
val signingKeyId = System.getenv("SIGNING_KEY_ID")
val signingPassword = System.getenv("SIGNING_PASSWORD")
if (isRequired && (signingKey == null || signingKeyId == null || signingPassword == null)) {
throw IllegalStateException("Please set the SIGNING_KEY, SIGNING_KEY_ID, and SIGNING_PASSWORD environment variables.")
}
println("Signing Key ID: $signingKeyId")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications["mavenJava"])
}

nmcp {
// https://github.com/GradleUp/nmcp
publishAllProjectsProbablyBreakingProjectIsolation {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
// publish manually from the portal
publicationType = "USER_MANAGED"
// or if you want to publish automatically
// publicationType = "AUTOMATIC"
}
}
4 changes: 2 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
before_install:
- sdk install java 17.0.8.1-ms
- sdk use java 17.0.8.1-ms
- sdk install java 21.0.2-ms
- sdk use java 21.0.2-ms

2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rootProject.name = "java-stellar-sdk-android-spi"
rootProject.name = "stellar-sdk-android-spi"

0 comments on commit be6be71

Please sign in to comment.