-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,490 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name-template: "$RESOLVED_VERSION" | ||
tag-template: "$RESOLVED_VERSION" | ||
prerelease: true | ||
template: | | ||
# What's Changed | ||
$CHANGES | ||
categories: | ||
- title: "Breaking" | ||
label: "breaking" | ||
- title: "New" | ||
label: "enhancement" | ||
- title: "Bug Fixes" | ||
label: "bug" | ||
- title: "Maintenance" | ||
label: "maintenance" | ||
- title: "Documentation" | ||
label: "documentation" | ||
- title: "Dependency Updates" | ||
label: "dependencies" | ||
version-resolver: | ||
major: | ||
labels: | ||
- "breaking" | ||
minor: | ||
labels: | ||
- "enhancement" | ||
patch: | ||
labels: | ||
- "bug" | ||
- "maintenance" | ||
- "documentation" | ||
- "dependencies" | ||
- "security" | ||
exclude-labels: | ||
- "skip-changelog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: "Build" | ||
"on": | ||
pull_request: | ||
branches: | ||
- "master" | ||
jobs: | ||
build: | ||
name: "Build" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/setup-java@v4" | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/caches" | ||
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/wrapper" | ||
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradlew- | ||
- run: | | ||
chmod +x gradlew | ||
./gradlew build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: "Update Changelog" | ||
"on": | ||
push: | ||
branches: | ||
- "master" | ||
jobs: | ||
changelog: | ||
name: "Update Changelog" | ||
runs-on: "ubuntu-latest" | ||
if: "${{ !contains(github.event.head_commit.message, 'skip-snapshot') }}" | ||
steps: | ||
- uses: "release-drafter/release-drafter@master" | ||
id: "release" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
name: "Release" | ||
"on": | ||
release: | ||
types: | ||
- "released" | ||
jobs: | ||
build: | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/setup-java@v4" | ||
with: | ||
distribution: "adopt" | ||
java-version: "11" | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/caches" | ||
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: "~/.gradle/wrapper" | ||
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}" | ||
restore-keys: | | ||
${{ runner.os }}-gradlew- | ||
- run: | | ||
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1 | ||
chmod +x gradlew | ||
./gradlew -Psign-required=true publish -Pversion="${{ github.event.release.tag_name }}" -PmavenCentralUsername="${{ secrets.MAVEN_CENTRAL_USERNAME }}" -PmavenCentralPassword="${{ secrets.MAVEN_CENTRAL_PASSWORD }}" -PsigningInMemoryKey="${{ secrets.GPG_PRIVATE_KEY_ARMORED }}" -PsigningInMemoryKeyPassword="${{ secrets.GPG_PASSPHRASE }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,11 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
replay_pid* | ||
.idea/ | ||
target/ | ||
.gradle/ | ||
build/ | ||
*.iml | ||
*.project | ||
*.classpath | ||
.settings/ | ||
**/bin/ | ||
.vscode/ | ||
.kotlin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,32 @@ | ||
# lock | ||
Simplified lock mechanism using Redis. | ||
[![Maven Central Version](https://img.shields.io/maven-central/v/net.infumia/lock)](https://central.sonatype.com/artifact/net.infumia/lock) | ||
## How to Use (Developers) | ||
### Gradle | ||
```groovy | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
// Base module | ||
implementation "net.infumia:lock:VERSION" | ||
// Pub/Sub using Redis (Optional) | ||
implementation "net.infumia:lock-redis:VERSION" | ||
// Required, https://mvnrepository.com/artifact/io.lettuce/lettuce-core/ | ||
implementation "io.lettuce:lettuce-core:6.3.2.RELEASE" | ||
// Kotlin extensions (Optional) | ||
implementation "net.infumia:lock-kotlin:VERSION" | ||
// Kotlin coroutines (Optional) | ||
implementation "net.infumia:lock-kotlin-coroutines:VERSION" | ||
// Required, https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-coroutines-core/ | ||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1" | ||
} | ||
``` | ||
### Code | ||
```kotlin | ||
fun main() { | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import net.infumia.gradle.spotless | ||
|
||
plugins { java } | ||
|
||
subprojects { apply<JavaPlugin>() } | ||
|
||
spotless() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
plugins { `kotlin-dsl` } | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.nexus.plugin) | ||
implementation(libs.kotlin.plugin) | ||
implementation(libs.dokka.plugin) | ||
implementation(libs.spotless.plugin) | ||
} | ||
|
||
kotlin { jvmToolchain(11) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
plugins { id("org.gradle.toolchains.foojay-resolver-convention") } | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.infumia.gradle | ||
|
||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPlugin | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.api.tasks.bundling.Jar | ||
import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
import org.gradle.kotlin.dsl.* | ||
import org.jetbrains.dokka.gradle.DokkaPlugin | ||
|
||
fun Project.applyCommon(javaVersion: Int = 8, sources: Boolean = true, javadoc: Boolean = true) { | ||
apply<JavaPlugin>() | ||
|
||
if (name.contains("kotlin")) { | ||
apply<DokkaPlugin>() | ||
apply(plugin = "org.jetbrains.kotlin.jvm") | ||
} | ||
|
||
repositories.mavenCentral() | ||
|
||
extensions.configure<JavaPluginExtension> { | ||
toolchain { languageVersion = JavaLanguageVersion.of(javaVersion) } | ||
} | ||
|
||
if (javadoc) { | ||
val javadocJar by | ||
tasks.creating(Jar::class) { | ||
dependsOn("javadoc") | ||
archiveClassifier.set("javadoc") | ||
from(javadoc) | ||
} | ||
} | ||
|
||
if (sources) { | ||
val sourceSets = extensions.getByType<JavaPluginExtension>().sourceSets | ||
val sourcesJar by | ||
tasks.creating(Jar::class) { | ||
dependsOn("classes") | ||
archiveClassifier.set("sources") | ||
from(sourceSets["main"].allSource) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package net.infumia.gradle | ||
|
||
import com.vanniktech.maven.publish.MavenPublishBaseExtension | ||
import com.vanniktech.maven.publish.MavenPublishPlugin | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.* | ||
|
||
fun Project.publish( | ||
moduleName: String? = null, | ||
javaVersion: Int = 8, | ||
sources: Boolean = true, | ||
javadoc: Boolean = true | ||
) { | ||
applyCommon(javaVersion, sources, javadoc) | ||
apply<MavenPublishPlugin>() | ||
|
||
val projectName = "lock${if (moduleName == null) "" else "-$moduleName"}" | ||
val signRequired = project.hasProperty("sign-required") | ||
|
||
extensions.configure<MavenPublishBaseExtension> { | ||
coordinates(project.group.toString(), projectName, project.version.toString()) | ||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true) | ||
if (signRequired) { | ||
signAllPublications() | ||
} | ||
|
||
pom { | ||
name.set(projectName) | ||
description.set("") | ||
url.set("https://github.com/Infumia/lock") | ||
licenses { | ||
license { | ||
name.set("MIT License") | ||
url.set("https://mit-license.org/license.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("portlek") | ||
name.set("Hasan Demirtaş") | ||
email.set("[email protected]") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/infumia/lock.git") | ||
developerConnection.set("scm:git:ssh://github.com/infumia/lock.git") | ||
url.set("https://github.com/infumia/lock/") | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.