Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove indra. #3

Merged
merged 4 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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: '8'

- 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-

- uses: crazy-max/[email protected]
with:
gpg_private_key: "${{ secrets.GPG_PRIVATE_KEY }}"
passphrase: "${{ secrets.GPG_PASSPHRASE }}"

- run: |
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
chmod +x gradlew
./gradlew -Psign-required=true publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion="${{ github.event.release.tag_name }}" -Psigning.gnupg.keyName="${{ secrets.GPG_SECRET_KEY_ID }}" -Psigning.gnupg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -PsonatypeUsername="${{ secrets.SONATYPE_USERNAME }}" -PsonatypePassword="${{ secrets.SONATYPE_PASSWORD }}"
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
- run: |
[[ "${{ steps.release.outputs.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
chmod +x gradlew
./gradlew -Psign-required=true publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion="${{ steps.release.outputs.tag_name }}-SNAPSHOT" -PinfumiaSigningKey="${{ secrets.GPG_SECRET_KEY_ID }}" -PinfumiaSigningPassword="${{ secrets.GPG_PASSPHRASE }}" -PsonatypeUsername="${{ secrets.SONATYPE_USERNAME }}" -PsonatypePassword="${{ secrets.SONATYPE_PASSWORD }}"
./gradlew -Psign-required=true publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion="${{ steps.release.outputs.tag_name }}-SNAPSHOT" -Psigning.gnupg.keyName="${{ secrets.GPG_SECRET_KEY_ID }}" -Psigning.gnupg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -PsonatypeUsername="${{ secrets.SONATYPE_USERNAME }}" -PsonatypePassword="${{ secrets.SONATYPE_PASSWORD }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build/
.settings/
**/bin/
.vscode/
.kotlin/
35 changes: 29 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
java
alias(libs.plugins.indra.publishing.sonatype)
`maven-publish`
alias(libs.plugins.nexus)
}

repositories.mavenCentral()
Expand All @@ -17,13 +18,35 @@ subprojects {
}

tasks {
compileJava {
options.compilerArgs.add("-Xlint:-processing")
options.compilerArgs.add("-Xlint:-options")
compileJava { options.encoding = Charsets.UTF_8.name() }

javadoc {
options.encoding = Charsets.UTF_8.name()
(options as StandardJavadocDocletOptions).tags("todo")
}

val javadocJar by creating(Jar::class) {
dependsOn("javadoc")
archiveClassifier.set("javadoc")
from(javadoc)
}

val sourcesJar by creating(Jar::class) {
dependsOn("classes")
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}

build {
dependsOn(jar)
dependsOn(sourcesJar)
dependsOn(javadocJar)
}
}
}

indraSonatype {
useAlternateSonatypeOSSHost("s01")
nexusPublishing.repositories.sonatype {
val baseUrl = "https://s01.oss.sonatype.org/"
nexusUrl = uri("${baseUrl}service/local/")
snapshotRepositoryUrl = uri("${baseUrl}content/repositories/snapshots/")
}
4 changes: 0 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation(libs.indra)
}
Original file line number Diff line number Diff line change
@@ -1,33 +1,53 @@
plugins {
id("net.kyori.indra")
id("net.kyori.indra.publishing")
signing
`maven-publish`
}

val projectName = project.property("artifact-id") as String
val signRequired = project.hasProperty("sign-required")

indra {
mitLicense()
github("infumia", "pubsub")
configurePublications {
artifactId = projectName
publishing {
publications {
val publication = create<MavenPublication>("maven") {
groupId = project.group.toString()
artifactId = projectName
version = project.version.toString()

pom {
name = projectName
inceptionYear = "2024"
description = "Simplified pubsub library for Redis and various databases."
developers {
developer {
name = "Hasan Demirtaş"
url = "https://github.com/portlek/"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])

pom {
name.set(projectName)
description.set("Simplified pubsub library for Redis and various databases.")
url.set("https://github.com/Infumia/")
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/pubsub.git")
developerConnection.set("scm:git:ssh://github.com/infumia/pubsub.git")
url.set("https://github.com/infumia/pubsub/")
}
}
organization {
name = "Infumia"
url = "https://github.com/infumia/"
}

signing {
isRequired = signRequired
if (isRequired) {
useGpgCmd()
sign(publication)
}
}
}
if (project.hasProperty("sign-required")) {
signWithKeyFromPrefixedProperties("infumia")
}
}
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref =
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinserialization" }
kotlinx-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "kotlinserialization" }

indra = { module = "net.kyori:indra-common", version.ref = "indra" }

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version = "1.9.20" }
indra-publishing-sonatype = { id = "net.kyori.indra.publishing.sonatype", version.ref = "indra" }
nexus = { id = "io.github.gradle-nexus.publish-plugin", version = "2.0.0" }