Skip to content

Commit 176fe97

Browse files
Release 0.2 (#88)
1 parent 9e3e898 commit 176fe97

File tree

3 files changed

+93
-10
lines changed

3 files changed

+93
-10
lines changed

.github/workflows/cross.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ jobs:
280280
uses: actions/upload-artifact@v4
281281
with:
282282
name: surrealdb
283-
path: build/libs/surrealdb-0.2-SNAPSHOT.jar
283+
path: build/libs/surrealdb-0.2.0.jar
284284

285285
- name: Linux Integration Test
286286
run: ./gradlew -i integrationTest
@@ -322,7 +322,7 @@ jobs:
322322
needs:
323323
- aggregated-jar
324324
- integration-tests
325-
if: github.event_name == 'release' && github.event.action == 'created'
325+
if: github.ref == 'refs/heads/main'
326326
runs-on: ubuntu-latest
327327
permissions:
328328
contents: read
@@ -342,13 +342,20 @@ jobs:
342342
name: surrealdb
343343
path: build/libs
344344

345+
- name: Publish Jar (Maven)
346+
run: ./gradlew publish
347+
env:
348+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
349+
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
350+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASS }}
351+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
352+
SIGNING_KEY_PASS: ${{ secrets.SIGNING_KEY_PASS }}
353+
345354
- name: Publish release package
346355
uses: softprops/action-gh-release@v2
356+
if: github.event_name == 'release' && github.event.action == 'created'
347357
with:
348358
name: "Release ${{ github.ref_name }}"
349359
files: |
350360
LICENSE
351-
build/libs/*.jar
352-
353-
- name: Publish Jar (Maven)
354-
run: ./gradlew publish
361+
build/libs/*.jar

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ext {
3333
}
3434
3535
dependencies {
36-
implementation "com.surrealdb:surrealdb-driver:${surrealdbVersion}"
36+
implementation "com.surrealdb:surrealdb:${surrealdbVersion}"
3737
}
3838
```
3939

@@ -43,7 +43,7 @@ Maven:
4343

4444
<dependency>
4545
<groupId>com.surrealdb</groupId>
46-
<artifactId>surrealdb-driver</artifactId>
46+
<artifactId>surrealdb</artifactId>
4747
<version>0.2.0</version>
4848
</dependency>
4949
```

build.gradle

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ plugins {
33
id 'jacoco'
44
id 'java-library'
55
id 'maven-publish'
6+
id 'signing'
67
}
78

89
group 'com.surrealdb'
9-
version '0.2-SNAPSHOT'
10+
version '0.2.0'
1011

1112
repositories {
1213
mavenCentral()
@@ -30,7 +31,7 @@ configurations {
3031

3132
dependencies {
3233
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
33-
integrationTestImplementation files("build/libs/surrealdb-0.2-SNAPSHOT.jar")
34+
integrationTestImplementation files("build/libs/surrealdb-0.2.0.jar")
3435
}
3536

3637
jacoco {
@@ -64,6 +65,20 @@ javadoc {
6465
destinationDir = file("build/reports/javadoc")
6566
}
6667

68+
tasks.register('javadocJar', Jar) {
69+
archiveClassifier = 'javadoc'
70+
from javadoc
71+
}
72+
73+
tasks.register('sourcesJar', Jar) {
74+
archiveClassifier = 'sources'
75+
from sourceSets.main.allSource
76+
}
77+
78+
artifacts {
79+
archives javadocJar, sourcesJar
80+
}
81+
6782
tasks.register('createCombinedReport') {
6883
dependsOn jacocoTestReport
6984
dependsOn javadoc
@@ -102,6 +117,16 @@ tasks.register('integrationTest', Test) {
102117
}
103118
}
104119

120+
project.afterEvaluate {
121+
def key = System.getenv('SIGNING_KEY')
122+
def _pass = System.getenv('SIGNING_KEY_PASS')
123+
124+
signing {
125+
useInMemoryPgpKeys(key, _pass)
126+
sign publishing.publications.mavenJava
127+
}
128+
}
129+
105130
publishing {
106131
repositories {
107132
maven {
@@ -112,14 +137,65 @@ publishing {
112137
password = System.getenv("GITHUB_TOKEN")
113138
}
114139
}
140+
// maven {
141+
// name = "OSSRH"
142+
// def releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
143+
// def snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
144+
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
145+
// credentials {
146+
// username = System.getenv("MAVEN_USERNAME")
147+
// password = System.getenv("MAVEN_PASSWORD")
148+
// }
149+
// }
115150
}
151+
116152
publications {
117153
mavenJava(MavenPublication) {
118154
groupId = project.group
119155
artifactId = project.rootProject.name
120156
version = project.version
121157

158+
artifact(javadocJar)
159+
artifact(sourcesJar)
122160
artifact("build/libs/${project.rootProject.name}-${project.version}.jar")
161+
162+
163+
pom {
164+
name = 'SurrealDB Driver'
165+
packaging = 'jar'
166+
description = 'The driver for accessing a SurrealDB instance.'
167+
url = 'https://surrealdb.com/docs/integration/libraries/java'
168+
169+
scm {
170+
connection = 'scm:git:[email protected]:surrealdb/surrealdb.java.git'
171+
url = 'https://github.com/surrealdb/surrealdb.java'
172+
}
173+
174+
licenses {
175+
license {
176+
name = 'The Apache License, Version 2.0'
177+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
178+
}
179+
}
180+
181+
developers {
182+
developer {
183+
id = 'tobiemh'
184+
name = 'Tobie Morgan Hitchcock'
185+
186+
}
187+
developer {
188+
id = 'phughk'
189+
name = 'Hugh Kaznowski'
190+
191+
}
192+
developer {
193+
id = 'emmanuel-keller'
194+
name = 'Emmanuel Keller'
195+
196+
}
197+
}
198+
}
123199
}
124200
}
125201
}

0 commit comments

Comments
 (0)