Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
065cc4f
added manual deployment(release) step for the Publisher Portal
ahavryliuk-sift Jul 30, 2025
db44a11
allow to run from branch for testing
ahavryliuk-sift Jul 30, 2025
b7ef139
on push publish for testing
ahavryliuk-sift Jul 30, 2025
73eacd6
fixed some vars
ahavryliuk-sift Jul 30, 2025
a74cc07
sonatype host changed
ahavryliuk-sift Jul 30, 2025
88a12d7
sonatype maven repo name changed
ahavryliuk-sift Jul 30, 2025
2de68ae
sonatype maven repo name changed
ahavryliuk-sift Jul 30, 2025
a463a15
debug flag for gradlew
ahavryliuk-sift Jul 30, 2025
3ee9656
Portal Publisher API test
ahavryliuk-sift Jul 30, 2025
c18e521
Portal Publisher API auth with Bearer
ahavryliuk-sift Jul 30, 2025
f573082
auth with Bearer attempt
ahavryliuk-sift Jul 30, 2025
c68a5b4
back to basic auth attempt
ahavryliuk-sift Jul 30, 2025
09e4adb
fixed yml
ahavryliuk-sift Jul 30, 2025
0d11634
publisher url changed
ahavryliuk-sift Jul 30, 2025
88d9c20
back to ossrh
ahavryliuk-sift Jul 30, 2025
b6d4e57
nexus plugin attempt
ahavryliuk-sift Jul 30, 2025
96f32a9
nexus plugin job attempt
ahavryliuk-sift Jul 30, 2025
f9d3b2b
different plugin and job attempt
ahavryliuk-sift Jul 30, 2025
d0a8b69
nexus plugin creds
ahavryliuk-sift Jul 30, 2025
0821ad5
nexus plugin last attempt
ahavryliuk-sift Jul 30, 2025
e73243c
nexus plugin 1 more attempt
ahavryliuk-sift Jul 30, 2025
6c04373
nexus plugin attempt
ahavryliuk-sift Jul 30, 2025
1c0b336
jreleaser plugin attempt
ahavryliuk-sift Jul 30, 2025
1312104
jreleaser plugin configs attempt
ahavryliuk-sift Jul 30, 2025
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
20 changes: 16 additions & 4 deletions .github/workflows/publishing2sonatype.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Publishing to Sonatype
on:
release:
types: [published]
push:
# release:
# types: [published]

env:
GH_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -33,6 +34,17 @@ jobs:
run: |
sed -i -e 's|.*sonatypeUsername.*| username = "${{ secrets.SUSER }}"|' ./build.gradle
sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle
- name: Publish to Sonatype
- name: Sonatype Publish
run: |
./gradlew publishJarPublicationToStagingRepository
mkdir -p ~/.jreleaser
touch ~/.jreleaser/config.toml
echo "JRELEASER_NEXUS2_USERNAME='${{ secrets.SUSER }}'" >> ~/.jreleaser/config.toml
echo "JRELEASER_NEXUS2_PASSWORD='${{ secrets.SPASSWORD }}'" >> ~/.jreleaser/config.toml
./gradlew publish
# ./gradlew jreleaserDeploy
# ./gradlew -S releaseSonatypeStagingRepository
# BEARER=$(printf "${{ secrets.SUSER }}:${{ secrets.SPASSWORD }}" | base64)
# curl --request POST \
# --verbose \
# --header "Authorization: Bearer ${BEARER}" \
# https://ossrh-staging-api.central.sonatype.com/manual/upload/defaultRepository/${{ secrets.SREPO_ID }}
83 changes: 62 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
buildscript {
repositories {
jcenter()
}
}

plugins {
id 'org.jreleaser' version '1.19.0'
// id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}

apply plugin: 'java'
apply plugin: 'maven-publish'
Expand All @@ -7,17 +17,22 @@ apply plugin: 'java-library-distribution'
group = 'com.siftscience'
version = '3.21.2'

java {
withJavadocJar()
withSourcesJar()
}

repositories {
mavenCentral()
}

compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

compileTestJava {
sourceCompatibility = 1.8
sourceCompatibility = 1.8
}

dependencies {
Expand All @@ -31,12 +46,6 @@ dependencies {
implementation 'commons-codec:commons-codec:1.19.0'
}

buildscript {
repositories {
jcenter()
}
}

task sourceJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
Expand Down Expand Up @@ -154,26 +163,58 @@ publishing {
}
}
}

repositories {
maven {
name 'staging'
url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'

credentials {
username = "${sonatypeUsername}"
password = "${sonatypePassword}"
}
url = layout.buildDirectory.dir('staging-deploy')
}
}
}

model {
tasks.publishJarPublicationToStagingRepository {
dependsOn(project.tasks.signArchives)
// repositories {
// maven {
// name 'staging'
// url = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
//
// credentials {
// username = "${sonatypeUsername}"
// password = "${sonatypePassword}"
// }
// }
// }


//nexusPublishing {
// repositories {
// // see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
// sonatype {
// nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
// }
// }
//}

jreleaser {
signing {
active = 'ALWAYS'
armored = true
}
deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
stagingRepository('build/staging-deploy')
}
}
}
}
}

//model {
// tasks.publishJarPublicationToStagingRepository {
// dependsOn(project.tasks.signArchives)
// }
//}

distributions {
main {
distributionBaseName = 'sift-java'
Expand Down