Skip to content

Commit

Permalink
update: jreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
gc-garcol committed Nov 22, 2024
1 parent 31a0929 commit 225dacc
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 77 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ jobs:
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Build with Gradle
run: ./gradlew :lib-core:build
run: ./gradlew build -x test

# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish to GitHub Packages and Stage all artifacts to a local directory (for jreleaser)
run: ./gradlew :lib-core:publish
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

# For Jreleaser
- name: Publish to Maven Central
run: ./gradlew jreleaserFullRelease
env:
JRELEASER_PROJECT_JAVA_GROUP_ID: ${{ secrets.JRELEASER_PROJECT_JAVA_GROUP_ID }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.JRELEASER_MAVENCENTRAL_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
Expand Down
4 changes: 0 additions & 4 deletions .jreleaser/config.properties

This file was deleted.

15 changes: 0 additions & 15 deletions .jreleaser/config.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,55 @@ plugins {
id("org.jreleaser") version "1.15.0"
}

group = "io.github.gc-garcol"
version = "0.0.5"

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "io.github.gc-garcol"
artifactId = "cafe-ringbuffer"

from(components["java"])

pom {
name.set("cafe-ringbuffer")
description.set("cafe-ringbuffer")
url.set("https://github.com/gc-garcol/cafe-ringbuffer")
inceptionYear.set("2024")
licenses {
license {
name.set("Apache-2.0")
url.set("https://spdx.org/licenses/Apache-2.0.html")
}
}
developers {
developer {
id.set("gc-garcol")
name.set("cafe")
}
}
scm {
connection.set("scm:git:https://github.com/gc-garcol/cafe-ringbuffer.git")
developerConnection.set("scm:git:ssh://github.com/gc-garcol/cafe-ringbuffer.git")
url.set("https://github.com/gc-garcol/cafe-ringbuffer/tree/main")
}
}
}
}

repositories {
maven {
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
}
}
}

jreleaser {
signing {
active = Active.ALWAYS
Expand Down
55 changes: 0 additions & 55 deletions lib-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,58 +29,3 @@ tasks.test {
jvmArgs("--add-opens", "java.base/java.nio=ALL-UNNAMED")
useJUnitPlatform()
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "io.github.gc-garcol"
artifactId = "cafe-ringbuffer"

from(components["java"])

pom {
name.set("cafe-ringbuffer")
description.set("cafe-ringbuffer")
url.set("https://github.com/gc-garcol/cafe-ringbuffer")
inceptionYear.set("2024")
licenses {
license {
name.set("Apache-2.0")
url.set("https://spdx.org/licenses/Apache-2.0.html")
}
}
developers {
developer {
id.set("gc-garcol")
name.set("cafe")
}
}
scm {
connection.set("scm:git:https://github.com/gc-garcol/cafe-ringbuffer.git")
developerConnection.set("scm:git:ssh://github.com/gc-garcol/cafe-ringbuffer.git")
url.set("https://github.com/gc-garcol/cafe-ringbuffer/tree/main")
}
}
}
}

repositories {
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/gc-garcol/cafe-ringbuffer")
// credentials {
// username = System.getenv("GITHUB_ACTOR")
// password = System.getenv("GITHUB_TOKEN")
// }
// }

maven {
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
}
}
}

0 comments on commit 225dacc

Please sign in to comment.