Skip to content

Commit

Permalink
Merge pull request #400 from GDATASoftwareAG/ci/java/push-to-cental-m…
Browse files Browse the repository at this point in the history
…aven

Ci/java/push to cental maven
  • Loading branch information
doxthree authored Mar 14, 2024
2 parents 98a0454 + c47eb28 commit 2d7972b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci-java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ jobs:
- name: publish Maven package
if: startsWith(github.ref, 'refs/tags/java')
env:
ORG_GRADLE_PROJECT_username: ${{ secrets.ORG_GRADLE_PROJECT_USERNAME }}
ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
uses: gradle/gradle-build-action@v3
Expand All @@ -130,16 +128,18 @@ jobs:
gradle-version: "8.6"
build-root-directory: java

- name: push to Maven Central
- name: zip and publish Maven package
if: startsWith(github.ref, 'refs/tags/java')
env:
ORG_GRADLE_PROJECT_username: ${{ secrets.ORG_GRADLE_PROJECT_USERNAME }}
ORG_GRADLE_PROJECT_password: ${{ secrets.ORG_GRADLE_PROJECT_PASSWORD }}
uses: gradle/gradle-build-action@v3
MAVEN_CENTRAL_BEARER_TOKEN: ${{ secrets.MAVEN_CENTRAL_BEARER_TOKEN }}
run: |
zip -r package.zip .
curl --request POST \
--header 'Authorization: Bearer $MAVEN_CENTRAL_BEARER_TOKEN' \
--form [email protected] \
https://central.sonatype.com/api/v1/publisher/upload
with:
arguments: closeAndReleaseRepository
gradle-version: "8.6"
build-root-directory: java
working-directory: java/build/repos/releases

- name: Microsoft Teams Notification
uses: skitionek/notify-microsoft-teams@master
Expand Down
23 changes: 6 additions & 17 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id "io.codearte.nexus-staging" version "0.30.0"
}

group = 'de.gdata'
Expand Down Expand Up @@ -79,27 +78,17 @@ publishing {
}
}

repositories {
maven {
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = findProperty("username")
password = findProperty("password")
}
}
}

signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
}

nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
username = findProperty("username")
password = findProperty("password")
packageGroup = "de.gdata"
repositories {
maven {
url = layout.buildDirectory.dir('repos/releases')
}
}
}

0 comments on commit 2d7972b

Please sign in to comment.