diff --git a/.github/publish-maven.sh b/.github/publish-maven.sh index d4a4ba1a1a..ab80d9d8d5 100755 --- a/.github/publish-maven.sh +++ b/.github/publish-maven.sh @@ -1,27 +1,29 @@ #!/usr/bin/env bash echo "Extracting the SDK version from sbt build" + +# debugging help +echo "----" +sbt --client --no-colors "print coreSdk/version" +echo "----" SDK_VERSION=$(sbt --client --no-colors "print coreSdk/version" | tail -n 3 | head -n 1 | tr -d '\n') -IS_SNAPSHOT=$(sbt --client --no-colors "print coreSdk/isSnapshot" | tail -n 3 | head -n 1 | tr -d '\n') -if [ "false" == "${IS_SNAPSHOT}" ] -then - REPO="akka-repo::default::https://maven.cloudsmith.io/lightbend/akka/" -else - REPO="akka-repo::default::https://maven.cloudsmith.io/lightbend/akka-snapshots/" -fi -echo "Publishing '${SDK_VERSION}' to '${REPO}'" +echo "Publishing '${SDK_VERSION}'" cd maven-java -echo ${PGP_SECRET} | base64 -d | gpg --import --batch + +# update poms with the version extracted from sbt dynver (-B == no colors) +mvn -B versions:set -DnewVersion=${SDK_VERSION} + +# create Maven settings.xml with credentials for repository publishing mkdir -p ~/.m2 cat <~/.m2/settings.xml - - akka-repo - ${PUBLISH_USER} - ${PUBLISH_PASSWORD} + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} @@ -34,5 +36,9 @@ cat <~/.m2/settings.xml EOF -mvn -B versions:set -DnewVersion=${SDK_VERSION} -mvn -P release -B deploy -DaltDeploymentRepository="${REPO}" + +# import the artefact signing key +echo ${PGP_SECRET} | base64 -d | gpg --import --batch + +# Maven deply with profile `release` (-B == no colors) +mvn -P release -B deploy diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ac20819704..7d8d1eb56b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,6 +54,8 @@ jobs: PGP_SECRET: ${{ secrets.PGP_SECRET }} PUBLISH_USER: ${{ secrets.PUBLISH_USER }} PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} publish-documentation: name: Documentation diff --git a/maven-java/pom.xml b/maven-java/pom.xml index 435c348784..b47ad35ef6 100644 --- a/maven-java/pom.xml +++ b/maven-java/pom.xml @@ -49,27 +49,27 @@ 3.9.0 - - - - - - + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + - - - - - - - - - - - + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + true + + ossrh + https://s01.oss.sonatype.org + true + + org.apache.maven.plugins maven-resources-plugin