Skip to content

Commit

Permalink
release 0.1.1
Browse files Browse the repository at this point in the history
mark java-uuid-generator as internal dependency
  • Loading branch information
fxlae committed Apr 13, 2024
1 parent 1f2d0a3 commit 59d6b26
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 15 deletions.
7 changes: 0 additions & 7 deletions .circleci/config.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/build-on-push.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).

Expand All @@ -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
<dependency>
<groupId>de.fxlae</groupId>
<artifactId>typeid-java</artifactId>
<version>0.1.0</version>
</dependency>
```

Gradle:

```kotlin
implementation("de.fxlae:typeid-java:0.1.0")
```

## Requirements
- Java 8 or higher

Expand Down Expand Up @@ -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
```
13 changes: 10 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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"])
}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 59d6b26

Please sign in to comment.