From 59d6b26d3d540494cda48488bd4451e1443ba678 Mon Sep 17 00:00:00 2001 From: fxlae Date: Sun, 2 Jul 2023 14:50:38 +0200 Subject: [PATCH] release 0.1.1 mark java-uuid-generator as internal dependency --- .circleci/config.yml | 7 ------- .github/workflows/build-on-push.yml | 16 +++++++++++++++ .github/workflows/publish-on-release.yml | 23 +++++++++++++++++++++ README.md | 26 ++++++++++++++++++++---- build.gradle.kts | 13 +++++++++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 72 insertions(+), 15 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build-on-push.yml create mode 100644 .github/workflows/publish-on-release.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5dfc74f..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: '2.1' -orbs: - gradle: circleci/gradle@3.0.0 -workflows: - checkout-build-test: - jobs: - - gradle/test diff --git a/.github/workflows/build-on-push.yml b/.github/workflows/build-on-push.yml new file mode 100644 index 0000000..9abc0f8 --- /dev/null +++ b/.github/workflows/build-on-push.yml @@ -0,0 +1,16 @@ +name: Build +on: + push: +jobs: + build-gradle-project: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - uses: gradle/gradle-build-action@v2.5.1 + with: + gradle-version: wrapper + arguments: build diff --git a/.github/workflows/publish-on-release.yml b/.github/workflows/publish-on-release.yml new file mode 100644 index 0000000..bc7caa3 --- /dev/null +++ b/.github/workflows/publish-on-release.yml @@ -0,0 +1,23 @@ +name: Publish +on: + workflow_dispatch +# release: +# types: [created] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - uses: gradle/gradle-build-action@v2.5.1 + with: + gradle-version: wrapper + arguments: build publishAllPublicationsToOSSRHRepository + env: + ORG_GRADLE_PROJECT_OSSRHUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_OSSRHPassword: ${{ secrets.OSSRH_TOKEN }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} \ No newline at end of file diff --git a/README.md b/README.md index 1cb1124..f3c1dd4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # typeid-java -[![CircleCI](https://circleci.com/gh/fxlae/typeid-java.svg?style=shield)](https://circleci.com/gh/fxlae/typeid-java) +![example workflow](https://github.com/fxlae/typeid-java/actions/workflows/build-on-push.yml/badge.svg) ## A Java implementation of [TypeID](https://github.com/jetpack-io/typeid). @@ -9,6 +9,24 @@ UUIDv7 standard. They provide a ton of nice properties that make them a great ch as the primary identifiers for your data in a database, APIs, and distributed systems. Read more about TypeIDs in their [spec](https://github.com/jetpack-io/typeid). +## Installation + +Maven: + +```xml + + de.fxlae + typeid-java + 0.1.0 + +``` + +Gradle: + +```kotlin +implementation("de.fxlae:typeid-java:0.1.0") +``` + ## Requirements - Java 8 or higher @@ -36,13 +54,13 @@ typeId.getUuid(); // v4, java.util.UUID(9c8ec0e7-020b-4caf-87c0-38fb6c0ebbe2) Obtain an instance of `TypeID` from a text string (any UUID version): ```java -TypeId typeId = TypeId.parse("01h455vb4pex5vsknk084sn02q") -TypeId typeId = TypeId.parse("someprefix_01h455vb4pex5vsknk084sn02q") +TypeId typeId = TypeId.parse("01h455vb4pex5vsknk084sn02q"); +TypeId typeId = TypeId.parse("someprefix_01h455vb4pex5vsknk084sn02q"); ``` ## Building From Source ```console foo@bar:~$ git clone https://github.com/fxlae/typeid-java.git foo@bar:~$ cd typeid-java -foo@bar:~/typeid-java$ ./gradlew assemble +foo@bar:~/typeid-java$ ./gradlew build ``` \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index b01dcaa..5732a1f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,14 +5,14 @@ plugins { } group = "de.fxlae" -version = "0.1.0" +version = "0.1.1-SNAPSHOT" repositories { mavenCentral() } dependencies { - api("com.fasterxml.uuid:java-uuid-generator:4.2.0") + implementation("com.fasterxml.uuid:java-uuid-generator:4.2.0") testImplementation(platform("org.junit:junit-bom:5.9.1")) testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.2") @@ -84,12 +84,19 @@ publishing { } repositories { maven { - url = uri(layout.buildDirectory.dir("repos/releases")) + name = "OSSRH" + val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") + url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl + credentials(PasswordCredentials::class) } } } signing { + val signingKey: String? by project + val signingPassword: String? by project + useInMemoryPgpKeys(signingKey, signingPassword) sign(publishing.publications["mavenJava"]) } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7d6e626..ad20ae9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Jun 30 20:28:51 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists