Skip to content

Commit

Permalink
remove indra. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
portlek authored Jun 8, 2024
1 parent 6c8d832 commit 4a71a74
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 35 deletions.
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" }

0 comments on commit 4a71a74

Please sign in to comment.