diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f8cfcbe..c10c8f7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,8 +20,8 @@ jobs: run: ./gradlew publish env: RELEASE_TAG: ${{ github.event.release.tag_name }} - NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} - NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} diff --git a/build.gradle b/build.gradle index c95437e..de0b2e4 100644 --- a/build.gradle +++ b/build.gradle @@ -23,8 +23,8 @@ if (propertiesFile.exists()) { properties.load(propertiesFile.newDataInputStream()) } -ext.nexusUsername = properties.getProperty('nexusUsername') != null ? properties.getProperty('nexusUsername') : System.getenv('NEXUS_USERNAME'); -ext.nexusPassword = properties.getProperty('nexusPassword') != null ? properties.getProperty('nexusPassword') : System.getenv('NEXUS_PASSWORD'); +ext.ossrhUsername = properties.getProperty('ossrhUsername') != null ? properties.getProperty('ossrhUsername') : System.getenv('OSSRH_USERNAME'); +ext.ossrhPassword = properties.getProperty('ossrhPassword') != null ? properties.getProperty('ossrhPassword') : System.getenv('OSSRH_PASSWORD'); ext.signingKeyId = properties.getProperty('signingKeyId') != null ? properties.getProperty('signingKeyId') : System.getenv('SIGNING_KEY_ID'); ext.signingKey = properties.getProperty('signingKey') != null ? properties.getProperty('signingKey') : System.getenv('SIGNING_KEY'); @@ -74,7 +74,7 @@ allprojects { def repoGroupIdVal = 'ai.kontent'; subprojects { - version = System.getenv('RELEASE_TAG') != null && !System.getenv('RELEASE_TAG').isEmpty() ? System.getenv('RELEASE_TAG') : '5.1.0-SNAPSHOT' + version = System.getenv('RELEASE_TAG') != null && !System.getenv('RELEASE_TAG').isEmpty() ? System.getenv('RELEASE_TAG') : '5.1.2' ext.repoGroupId = repoGroupIdVal group = repoGroupIdVal ext.repositoryHost = 'maven.org' diff --git a/delivery-sdk-generators/build.gradle b/delivery-sdk-generators/build.gradle index 7b6949e..74f9671 100644 --- a/delivery-sdk-generators/build.gradle +++ b/delivery-sdk-generators/build.gradle @@ -82,6 +82,7 @@ publishing { } repositories { maven { + name = "OSSRH" if (project.getVersion().toString().endsWith('SNAPSHOT')) { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } else { @@ -89,8 +90,8 @@ publishing { } credentials { - username nexusUsername - password nexusPassword + username ossrhUsername + password ossrhPassword } } } diff --git a/delivery-sdk/build.gradle b/delivery-sdk/build.gradle index 6ba502b..52f7f54 100644 --- a/delivery-sdk/build.gradle +++ b/delivery-sdk/build.gradle @@ -94,14 +94,15 @@ publishing { } repositories { maven { + name = "OSSRH" if (project.getVersion().toString().endsWith('SNAPSHOT')) { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } else { url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" } credentials { - username nexusUsername - password nexusPassword + username ossrhUsername + password ossrhPassword } } } diff --git a/docs/Release-process.md b/docs/Release-process.md index 0338cd9..56e1ed3 100644 --- a/docs/Release-process.md +++ b/docs/Release-process.md @@ -15,12 +15,15 @@ There are 5 keys for successful publishing and they can be provided via `local.p | Key | local.properties property name | environment variable name | | ------------------- | :----------------------------: | :-----------------------: | -| Nexus User Name | `nexusUsername` | `NEXUS_USERNAME` | -| Nexus Password | `nexusPassword` | `NEXUS_PASSWORD` | +| Ossrh Username | `ossrhUsername` | `OSSRH_USERNAME` | +| Ossrh password | `ossrhPassword` | `OSSRH_PASSWORD` | | GPG Key ID | `signingKeyId` | `SIGNING_KEY_ID` | | GPG Private Key | `signingKey` | `SIGNING_KEY` | | GPG Password Phrase | `signingPassword` | `SIGNING_PASSWORD` | +> [!NOTE] +> If GPG keys are outdated, you need to generate them using GnuGP. Don't forget to publish the public key to repository (e.g. keys.ubuntu.com) so the Sonatype can verify the public key. + ## Plugins The release process is using the Gradle plugin [maven-publish](https://docs.gradle.org/current/userguide/publishing_maven.html) for creating the publication from the source code and the metadata and sends it to the [Nexus Repository Manager](https://s01.oss.sonatype.org/). The second Gradle plugin, [signing](https://docs.gradle.org/current/userguide/signing_plugin.html#signing_plugin), is responsible for signing the artifacts produced by the maven-publish plugin. diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 55f30da..2e18c7c 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -6,8 +6,8 @@ - - + + diff --git a/local.properties.template b/local.properties.template index 6b0940e..1ce8d31 100644 --- a/local.properties.template +++ b/local.properties.template @@ -2,10 +2,11 @@ sdk.dir= # https://docs.gradle.org/6.3/userguide/signing_plugin.html#sec:in-memory-keys -signingKeyId=A5992A24 +signingKeyId=11D844AB signingPassword= -# Starts with -----BEGIN PGP PRIVATE KEY BLOCK-----\n\n... - no apostrophes wrapping: "" +# Starts with -----BEGIN PGP PRIVATE KEY BLOCK-----\n\n... - no apostrophes wrapping: "". +# Be aware of using \n instead of every new line! signingKey= -nexusUsername= -nexusPassword= \ No newline at end of file +ossrhUsername= +ossrhPassword= \ No newline at end of file