Skip to content

Commit

Permalink
Publishing attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
tginsberg committed Jul 29, 2024
1 parent 9a57d52 commit 8d69946
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@ jobs:
distribution: 'temurin'
cache: 'gradle'

- name: Build
run: ./gradlew build --no-daemon
- name: Build and Publish
run: ./gradlew build publish --no-daemon
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
SONATYPE_SIGNING_KEY: ${{ secrets.SONATYPE_SIGNING_KEY }}
SONATYPE_SIGNING_PASSPHRASE: ${{ secrets.SONATYPE_SIGNING_PASSPHRASE }}
18 changes: 18 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import java.net.URI

plugins {
id("com.adarshr.test-logger") version "4.0.0"
id("jacoco")
id("java-library")
id("maven-publish")
id("signing")
}

description = "An extra set of helpful Stream Gatherers for Java"
Expand Down Expand Up @@ -73,6 +76,21 @@ publishing {
}
}
}
repositories {
maven {
url = if(version.toString().endsWith("-SNAPSHOT")) URI("https://oss.sonatype.org/content/repositories/snapshots/")
else URI("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_TOKEN")
}
}
}
}

signing {
useInMemoryPgpKeys(System.getenv("SONATYPE_SIGNING_KEY"), System.getenv("SONATYPE_SIGNING_PASSPHRASE"))
sign(publishing.publications["gatherers4j"])
}

tasks {
Expand Down

0 comments on commit 8d69946

Please sign in to comment.