Skip to content

Commit 92ac045

Browse files
committed
Configure publishing to Sonatype / Maven central.
1 parent 8cfc4f5 commit 92ac045

File tree

3 files changed

+25
-34
lines changed

3 files changed

+25
-34
lines changed

Diff for: .github/workflows/release.yml

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ jobs:
6666
./gradlew publish
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
70+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
71+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
72+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
6973

7074
publish_ios_pod:
7175
name: Publish iOS

Diff for: android/build.gradle.kts

+21-33
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import java.util.Properties
1+
import java.util.Base64
22

33
plugins {
44
id("com.android.library") version "8.0.1"
55
id("maven-publish")
6-
// id("signing")
6+
id("signing")
77
}
88

99
group = "co.powersync"
@@ -52,19 +52,6 @@ tasks.named("preBuild") {
5252
dependsOn(buildRust)
5353
}
5454

55-
val secretsFile = rootProject.file("local.properties")
56-
val secretProperties = Properties()
57-
58-
if (secretsFile.exists()) {
59-
secretsFile.reader().use { secretProperties.load(it) }
60-
61-
secretProperties.forEach { key, value ->
62-
if (key is String && key.startsWith("signing")) {
63-
ext[key] = value
64-
}
65-
}
66-
}
67-
6855
publishing {
6956
publications {
7057
register<MavenPublication>("maven") {
@@ -106,19 +93,14 @@ publishing {
10693
}
10794

10895
repositories {
109-
// maven {
110-
// name = "sonatype"
111-
// url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
112-
// credentials {
113-
// username = secretProperties.getProperty("ossrhUsername")
114-
// password = secretProperties.getProperty("ossrhPassword")
115-
// }
116-
// }
117-
//
118-
// maven {
119-
// name = "here"
120-
// url = uri("build/here/")
121-
// }
96+
maven {
97+
name = "sonatype"
98+
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
99+
credentials {
100+
username = System.getenv("OSSRH_USERNAME")
101+
password = System.getenv("OSSRH_PASSWORD")
102+
}
103+
}
122104

123105
maven {
124106
name = "GitHubPackages"
@@ -130,11 +112,17 @@ publishing {
130112
}
131113
}
132114
}
133-
//
134-
//signing {
135-
// useGpgCmd()
136-
// sign(publishing.publications)
137-
//}
115+
116+
signing {
117+
if (System.getenv("GPG_PRIVATE_KEY") == null) {
118+
useGpgCmd()
119+
} else {
120+
var signingKey = String(Base64.getDecoder().decode(System.getenv("GPG_PRIVATE_KEY"))).trim()
121+
var signingPassword = System.getenv("GPG_PASSWORD")
122+
useInMemoryPgpKeys(signingKey, signingPassword)
123+
}
124+
sign(publishing.publications)
125+
}
138126

139127
tasks.withType<AbstractPublishToMaven>() {
140128
dependsOn("assembleRelease")

Diff for: powersync-sqlite-core.podspec

-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ PowerSync extension for SQLite.
1515

1616

1717
s.ios.deployment_target = '11.0'
18-
# osx not supported yet
1918
s.osx.deployment_target = '10.13'
2019
end

0 commit comments

Comments
 (0)