Skip to content

Commit f4f506c

Browse files
authored
conf: Sonatype publishing Fixes #69 (#85)
* conf: Sonatype publishing Fixes #69 * fix: evaluation of publishing delayed to use the correct archivesBaseName * docs: badges in README updated * fix: versioning fixed Co-authored-by: Michal Augustýn <[email protected]>
1 parent a722e0b commit f4f506c

File tree

4 files changed

+62
-65
lines changed

4 files changed

+62
-65
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ jobs:
1717
- uses: olafurpg/setup-scala@v10
1818
with:
1919
java-version: [email protected]
20-
- name: Coursier cache
21-
uses: coursier/cache-action@v6
22-
# - name: sbt ci ${{ github.ref }}
23-
# run: ./sbt ci
2420
- name: gradle test ${{ github.ref }}
25-
run: ./gradlew test
21+
run: ./gradlew check
2622
env:
2723
SCALA_VERSION: ${{ matrix.scala-version }}

.github/workflows/release.yml

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,11 @@ jobs:
1717
- uses: olafurpg/setup-scala@v10
1818
with:
1919
java-version: [email protected]
20-
- name: Coursier cache
21-
uses: coursier/cache-action@v6
22-
# - name: sbt ci-release ${{ github.ref }}
23-
# run: ./sbt ci-release
24-
- name: gradle bintrayUpload ${{ github.ref }}
25-
run: ./gradlew bintrayUpload -Pversion="${{ github.event.release.tag_name }}" --info
20+
- name: Sonatype publishing ${{ github.ref }}
21+
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Pversion="${{ github.event.release.tag_name }}" --info
2622
env:
27-
# PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
28-
# PGP_SECRET: ${{ secrets.PGP_SECRET }}
29-
# SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
30-
# SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3123
SCALA_VERSION: ${{ matrix.scala-version }}
32-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
33-
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
24+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
25+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
26+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
27+
ORG_GRADLE_PROJECT_sonatypePassword : ${{ secrets.SONATYPE_PASSWORD }}

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# RabbitMQ client
2-
3-
[![Release](https://github.com/avast/rabbitmq-scala-client/workflows/Release/badge.svg)](https://github.com/avast/rabbitmq-scala-client/actions?query=workflow%3ARelease)
4-
[![Download](https://api.bintray.com/packages/avast/maven/rabbitmq-scala-client/images/download.svg) ](https://bintray.com/avast/maven/rabbitmq-scala-client/_latestVersion)
5-
1+
# RabbitMQ client [![CI](https://github.com/avast/rabbitmq-scala-client/actions/workflows/ci.yml/badge.svg)](https://github.com/avast/rabbitmq-scala-client/actions/workflows/ci.yml) [![Version](https://badgen.net/maven/v/maven-central/com.avast.clients.rabbitmq/rabbitmq-client-api_2.13)](https://repo1.maven.org/maven2/com/avast/clients/rabbitmq/rabbitmq-client-api_2.13/)
62

73
This client is Scala wrapper over the standard [RabbitMQ Java client](https://www.rabbitmq.com/java-client.html). Goal of this library is
84
to simplify basic use cases - to provide FP-oriented API for programmers and to shadow the programmer from an underlying client.

build.gradle

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
buildscript {
22
repositories {
33
mavenCentral()
4-
jcenter()
54
}
6-
75
dependencies {
86
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.15'
97
classpath 'com.avast.gradle:gradle-docker-compose-plugin:0.14.1'
108
classpath 'com.github.ben-manes:gradle-versions-plugin:0.36.0'
11-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
129
}
1310
}
1411

15-
apply plugin: 'idea'
12+
plugins {
13+
id "io.github.gradle-nexus.publish-plugin" version '1.0.0'
14+
}
1615
apply plugin: 'docker-compose'
1716

18-
group = "com.avast.clients.rabbitmq"
19-
version = version == 'unspecified' ? 'DEVELOPER-SNAPSHOT' : version
17+
nexusPublishing {
18+
repositories {
19+
sonatype()
20+
}
21+
}
2022

2123
allprojects {
24+
apply plugin: 'idea'
25+
group = 'com.avast.clients.rabbitmq'
26+
version = version == 'unspecified' ? 'DEVELOPER-SNAPSHOT' : version
2227
ext {
2328
def scalaVersionEnv = System.getenv("SCALA_VERSION")
2429

@@ -44,11 +49,10 @@ println("Scala version: ${scalaVersion} (${scalaVersionFull})") // will display
4449
subprojects {
4550
apply plugin: 'java'
4651
apply plugin: 'scala'
47-
apply plugin: 'com.github.ben-manes.versions'
48-
apply plugin: 'com.jfrog.bintray'
49-
apply plugin: 'maven'
52+
apply plugin: 'java-library'
5053
apply plugin: 'maven-publish'
51-
apply plugin: 'idea'
54+
apply plugin: 'signing'
55+
apply plugin: 'com.github.ben-manes.versions'
5256

5357
task sourceJar(type: Jar) {
5458
from sourceSets.main.allSource
@@ -57,43 +61,50 @@ subprojects {
5761

5862
group = "com.avast.clients.rabbitmq"
5963

60-
publishing {
61-
publications {
62-
MyPublication(MavenPublication) {
63-
from components.java
64-
groupId project.group
65-
version project.version
66-
artifact sourceJar
64+
java {
65+
withJavadocJar()
66+
withSourcesJar()
67+
}
68+
69+
afterEvaluate {
70+
publishing {
71+
publications {
72+
mavenJava(MavenPublication) {
73+
from(components.java)
74+
artifactId = archivesBaseName
75+
pom {
76+
name = 'RabbitMQ client for Scala'
77+
description = 'Scala wrapper over standard RabbitMQ Java client library'
78+
url = 'https://github.com/avast/rabbitmq-scala-client'
79+
licenses {
80+
license {
81+
name = 'The MIT License'
82+
url = 'http://www.opensource.org/licenses/mit-license.php'
83+
}
84+
}
85+
developers {
86+
developer {
87+
id = 'jendakol'
88+
name = 'Jenda Kolena'
89+
90+
}
91+
}
92+
scm {
93+
connection = 'scm:git:git://github.com/avast/rabbitmq-scala-client.git'
94+
developerConnection = 'scm:git:ssh://github.com/avast/rabbitmq-scala-client.git'
95+
url = 'https://github.com/avast/rabbitmq-scala-client'
96+
}
97+
}
98+
}
6799
}
68100
}
69101
}
70102

71-
artifacts {
72-
archives jar
73-
archives sourceJar
74-
}
75-
76-
bintray {
77-
user = System.getenv('BINTRAY_USER')
78-
key = System.getenv('BINTRAY_KEY')
79-
publish = true // auto publish
80-
configurations = ['archives']
81-
82-
pkg {
83-
repo = 'maven'
84-
name = 'rabbitmq-scala-client'
85-
userOrg = 'avast'
86-
desc = 'Scala wrapper over standard RabbitMQ Java client library'
87-
licenses = ['Apache-2.0']
88-
vcsUrl = 'https://github.com/avast/rabbitmq-scala-client.git'
89-
githubRepo = 'avast/rabbitmq-scala-client'
90-
websiteUrl = 'https://github.com/avast/rabbitmq-scala-client'
91-
issueTrackerUrl = 'https://github.com/avast/rabbitmq-scala-client/issues'
92-
labels = ['rabbitmq', 'client', 'amqp', 'scala']
93-
version {
94-
name = project.version
95-
vcsTag = project.version
96-
}
103+
signing {
104+
String base64Key = System.getenv('SIGNING_KEY')
105+
if (base64Key) {
106+
useInMemoryPgpKeys(new String(Base64.decoder.decode(base64Key)), System.getenv('SIGNING_PASSWORD'))
107+
sign publishing.publications
97108
}
98109
}
99110

0 commit comments

Comments
 (0)