Skip to content

Commit

Permalink
fix(init): remove publishing from github action pipeline - this will …
Browse files Browse the repository at this point in the history
…come later. For now we can use the release.sh script.
  • Loading branch information
andrekaplick5678 committed Sep 21, 2023
1 parent 218334c commit 86a1ba6
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 32 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,3 @@ jobs:
if: steps.semantic.outputs.new_release_published == 'true'
run: |
echo "New Release Version: ${{ steps.semantic.outputs.new_release_version }}"
publishLibraries:
name: Publish the libraries to Maven Central
needs: [semanticRelease]
if: needs.semanticRelease.outputs.new_release_published == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
## checkout new created tag e.g. tag/v1.6.4
ref: v${{ needs.semanticRelease.outputs.new_release_version }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Publish package
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
37 changes: 27 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,40 +45,57 @@ dependencies {
java {
// create sources.jar as well
withSourcesJar()
// create javadoc.jar as well
withJavadocJar()
}

jar {
manifest {
attributes('Implementation-Title': project.name,
'Implementation-Version': project.version,
'Source-Code-Url': 'https://github.com/otto-de/kafka-messaging-e2ee')
}
manifest.attributes provider: 'gradle'
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'de.otto'
artifactId = 'kafka-messaging-e2ee'
description = 'Kafka Messaging End-To-End-Encryption'
from components.java

pom {
name = 'Kafka Messaging E2EE'
description = 'Kafka Messaging End-To-End-Encryption'
groupId = 'de.otto'

url = 'https://github.com/otto-de/kafka-messaging-e2ee'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'andrekaplick5678'
name = 'Andre Kaplick'
organization = 'OTTO'
organizationUrl = 'https://www.github.com/otto-de'
}
}
scm {
url = "https://github.com/otto-de/kafka-messaging-e2ee"
connection = 'scm:git:git://github.com:otto-de/kafka-messaging-e2ee.git'
developerConnection = 'scm:git:ssh://github.com:otto-de/kafka-messaging-e2ee.git'
url = 'https://github.com/otto-de/kafka-messaging-e2ee/tree/main'
}
}
}
}
}

nexusPublishing {
packageGroup = 'de.otto'
repositories {
sonatype()
}
}

signing {
required { false }
// required { false }
sign publishing.publications.mavenJava
}
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd /repos/kafka-messaging-e2ee/examples

```bash
## (optional) clean old versions of this libraries
rm -rfv $HOME/.m2/repository/de/otto/messaging.kafka.e2ee
rm -rfv $HOME/.m2/repository/de/otto/messaging-kafka-e2ee

## update the libraries in local maven repository
cd /repos/kafka-messaging-e2ee
Expand Down
2 changes: 1 addition & 1 deletion examples/springboot-fieldlevel-multiple/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
testImplementation 'org.springframework.kafka:spring-kafka-test'

// include our messaging.kafka.e2ee lib (run "./gradlew clean build publishToMavenLocal" beforehand)
implementation "de.otto:messaging.kafka.e2ee:${kafkaE2eeLibraryVersion}"
implementation "de.otto:kafka-messaging-e2ee:${kafkaE2eeLibraryVersion}"
}

tasks.named('test') {
Expand Down
2 changes: 1 addition & 1 deletion examples/springboot-fullmessage-multiple/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
testImplementation 'org.springframework.kafka:spring-kafka-test'

// include our messaging.kafka.e2ee lib (run "./gradlew clean build publishToMavenLocal" beforehand)
implementation "de.otto:messaging.kafka.e2ee:${kafkaE2eeLibraryVersion}"
implementation "de.otto:kafka-messaging-e2ee:${kafkaE2eeLibraryVersion}"
}

tasks.named('test') {
Expand Down
2 changes: 1 addition & 1 deletion examples/springboot-fullmessage-single/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
testImplementation 'org.springframework.kafka:spring-kafka-test'

// include our messaging.kafka.e2ee lib (run "./gradlew clean build publishToMavenLocal" beforehand)
implementation "de.otto:messaging.kafka.e2ee:${kafkaE2eeLibraryVersion}"
implementation "de.otto:kafka-messaging-e2ee:${kafkaE2eeLibraryVersion}"
}

tasks.named('test') {
Expand Down
42 changes: 42 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

set -e
SCRIPT_DIR=$(dirname $0)

USER_GRADLE_PROPERTIES=$HOME/.gradle/gradle.properties

check_configured() {
grep -q "$1" ${USER_GRADLE_PROPERTIES} || echo "$1 not configured in ${USER_GRADLE_PROPERTIES}. $2"
}

check_configuration() {
if [ ! -f ${USER_GRADLE_PROPERTIES} ]; then
echo "${USER_GRADLE_PROPERTIES} does not exist"
exit 1
fi

check_configured "sonatypeUsername" "This is the username you use to authenticate with sonatype nexus (e.g. otto-de)"
check_configured "sonatypePassword" "This is the password you use to authenticate with sonatype nexus (ask Guido or one of the developers)"
check_configured "signing.secretKeyRingFile" "This is the gpg secret key file, e.g. ~/.gnupg/secring.gpg. If this doesn't exist, generate a key: gpg --gen-key"
check_configured "signing.keyId" "This is the id of your key (e.g. 72FE5380). Use gpg --list-keys to find yours"
check_configured "signing.password" "This is the password you defined for your gpg key"
# gpg --send-keys --keyserver keyserver.ubuntu.com yourKeyId
}

check_configuration

set +e
grep 'version = .*-SNAPSHOT' "$SCRIPT_DIR/gradle.properties"
SNAPSHOT=$?
set -e

"${SCRIPT_DIR}"/gradlew clean check

if [[ $SNAPSHOT == 1 ]]; then
echo "Publishing, closing and releasing into Sonatype OSS repository"
"${SCRIPT_DIR}"/gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
else
echo "Publishing into Sonatype OSS repository"
"${SCRIPT_DIR}"/gradlew publishToSonatype
echo "This is a snapshot release. Closing in sonatype is not necessary"
fi
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'messaging.kafka.e2ee'
rootProject.name = 'kafka-messaging-e2ee'

0 comments on commit 86a1ba6

Please sign in to comment.