Skip to content

Commit 56a5746

Browse files
committed
update publish process
1 parent dddfc0c commit 56a5746

7 files changed

Lines changed: 23 additions & 17 deletions

File tree

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
run: ./gradlew publish
2121
env:
2222
RELEASE_TAG: ${{ github.event.release.tag_name }}
23-
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
24-
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
23+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
24+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
2525
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
2626
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
2727
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ if (propertiesFile.exists()) {
2323
properties.load(propertiesFile.newDataInputStream())
2424
}
2525

26-
ext.nexusUsername = properties.getProperty('nexusUsername') != null ? properties.getProperty('nexusUsername') : System.getenv('NEXUS_USERNAME');
27-
ext.nexusPassword = properties.getProperty('nexusPassword') != null ? properties.getProperty('nexusPassword') : System.getenv('NEXUS_PASSWORD');
26+
ext.ossrhUsername = properties.getProperty('ossrhUsername') != null ? properties.getProperty('ossrhUsername') : System.getenv('OSSRH_USERNAME');
27+
ext.ossrhPassword = properties.getProperty('ossrhPassword') != null ? properties.getProperty('ossrhPassword') : System.getenv('OSSRH_PASSWORD');
2828

2929
ext.signingKeyId = properties.getProperty('signingKeyId') != null ? properties.getProperty('signingKeyId') : System.getenv('SIGNING_KEY_ID');
3030
ext.signingKey = properties.getProperty('signingKey') != null ? properties.getProperty('signingKey') : System.getenv('SIGNING_KEY');
@@ -74,7 +74,7 @@ allprojects {
7474
def repoGroupIdVal = 'ai.kontent';
7575

7676
subprojects {
77-
version = System.getenv('RELEASE_TAG') != null && !System.getenv('RELEASE_TAG').isEmpty() ? System.getenv('RELEASE_TAG') : '5.1.0-SNAPSHOT'
77+
version = System.getenv('RELEASE_TAG') != null && !System.getenv('RELEASE_TAG').isEmpty() ? System.getenv('RELEASE_TAG') : '5.1.2'
7878
ext.repoGroupId = repoGroupIdVal
7979
group = repoGroupIdVal
8080
ext.repositoryHost = 'maven.org'

delivery-sdk-generators/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ publishing {
8282
}
8383
repositories {
8484
maven {
85+
name = "OSSRH"
8586
if (project.getVersion().toString().endsWith('SNAPSHOT')) {
8687
url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
8788
} else {
8889
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
8990
}
9091

9192
credentials {
92-
username nexusUsername
93-
password nexusPassword
93+
username ossrhUsername
94+
password ossrhPassword
9495
}
9596
}
9697
}

delivery-sdk/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ publishing {
9494
}
9595
repositories {
9696
maven {
97+
name = "OSSRH"
9798
if (project.getVersion().toString().endsWith('SNAPSHOT')) {
9899
url "https://s01.oss.sonatype.org/content/repositories/snapshots/"
99100
} else {
100101
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
101102
}
102103
credentials {
103-
username nexusUsername
104-
password nexusPassword
104+
username ossrhUsername
105+
password ossrhPassword
105106
}
106107
}
107108
}

docs/Release-process.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ There are 5 keys for successful publishing and they can be provided via `local.p
1515
1616
| Key | local.properties property name | environment variable name |
1717
| ------------------- | :----------------------------: | :-----------------------: |
18-
| Nexus User Name | `nexusUsername` | `NEXUS_USERNAME` |
19-
| Nexus Password | `nexusPassword` | `NEXUS_PASSWORD` |
18+
| Ossrh Username | `ossrhUsername` | `OSSRH_USERNAME` |
19+
| Ossrh password | `ossrhPassword` | `OSSRH_PASSWORD` |
2020
| GPG Key ID | `signingKeyId` | `SIGNING_KEY_ID` |
2121
| GPG Private Key | `signingKey` | `SIGNING_KEY` |
2222
| GPG Password Phrase | `signingPassword` | `SIGNING_PASSWORD` |
2323

24+
> [!NOTE]
25+
> 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.
26+
2427
## Plugins
2528

2629
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.

gradle/verification-metadata.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<trusted-artifacts>
77
<trust file=".*-javadoc[.]jar" regex="true"/>
88
<trust file=".*-sources[.]jar" regex="true"/>
9-
<trust group="ai.kontent" name="delivery-sdk" version="[0-9]+.[0-9]+.[0-9]+-SNAPSHOT" regex="true"/>
10-
<trust group="ai.kontent" name="delivery-sdk-generators" version="[0-9]+.[0-9]+.[0-9]+-SNAPSHOT" regex="true"/>
9+
<trust group="ai.kontent" name="delivery-sdk" version="[0-9]+.[0-9]+.[0-9]+(-SNAPSHOT)?" regex="true"/>
10+
<trust group="ai.kontent" name="delivery-sdk-generators" version="[0-9]+.[0-9]+.[0-9]+(-SNAPSHOT)?" regex="true"/>
1111
<trust group="com.android.tools.build"/>
1212
</trusted-artifacts>
1313
</configuration>

local.properties.template

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
sdk.dir=
33

44
# https://docs.gradle.org/6.3/userguide/signing_plugin.html#sec:in-memory-keys
5-
signingKeyId=A5992A24
5+
signingKeyId=11D844AB
66
signingPassword=
7-
# Starts with -----BEGIN PGP PRIVATE KEY BLOCK-----\n\n... - no apostrophes wrapping: ""
7+
# Starts with -----BEGIN PGP PRIVATE KEY BLOCK-----\n\n... - no apostrophes wrapping: "".
8+
# Be aware of using \n instead of every new line!
89
signingKey=
910

10-
nexusUsername=
11-
nexusPassword=
11+
ossrhUsername=
12+
ossrhPassword=

0 commit comments

Comments
 (0)