Skip to content

Commit b416d22

Browse files
authored
cd: Automated releases (#15)
* cd: Release action cd.yml * ci: release config build.gradle * chore: updated publish step name
1 parent 8d37efd commit b416d22

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/cd.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Build and Deploy
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches: [ "master" ]
6+
tags:
7+
- 'v*'
68

79
permissions:
810
contents: write
@@ -52,7 +54,28 @@ jobs:
5254
publish:
5355
runs-on: ubuntu-latest
5456
needs: build
57+
env:
58+
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }}
59+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
60+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
61+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
62+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
5563
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v4
66+
67+
- name: Set up JDK 17
68+
uses: actions/setup-java@v3
69+
with:
70+
java-version: '17'
71+
distribution: 'temurin'
72+
73+
- name: Publish package
74+
uses: gradle/gradle-build-action@v2
75+
with:
76+
gradle-version: 8.5
77+
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository
78+
5679
- name: Deploy javadoc to Github Pages
5780
uses: dev-vince/[email protected]
5881
with:

build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ plugins {
2020

2121
id 'com.google.protobuf' version '0.9.4'
2222
id "net.ltgt.errorprone" version '3.1.0'
23+
id 'io.github.gradle-nexus.publish-plugin' version "1.3.0"
2324
}
2425

2526
group = 'io.qdrant'
@@ -201,6 +202,7 @@ publishing {
201202
mavenJava(MavenPublication) {
202203
from components.java
203204
pom {
205+
name = "Qdrant Java Client"
204206
description = "${project.description}"
205207
url = "https://github.com/${organization}/${repository}"
206208
licenses {
@@ -229,3 +231,20 @@ publishing {
229231
mavenLocal()
230232
}
231233
}
234+
235+
nexusPublishing {
236+
repositories {
237+
sonatype {
238+
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
239+
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
240+
}
241+
}
242+
}
243+
244+
signing {
245+
def signingKeyId = findProperty("signingKeyId")
246+
def signingKey = findProperty("signingKey")
247+
def signingPassword = findProperty("signingPassword")
248+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
249+
sign publishing.publications.mavenJava
250+
}

0 commit comments

Comments
 (0)