This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add gradle task to publish cryptobox-android on sonatype (WPB-1…
…235) (#20)
- Loading branch information
1 parent
469c066
commit 117244c
Showing
13 changed files
with
499 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# Linux start script should use lf | ||
/gradlew text eol=lf | ||
|
||
# These are Windows script files and should use crlf | ||
*.bat text eol=crlf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
pipeline { | ||
agent { | ||
label 'android-reloaded-builder' | ||
} | ||
|
||
options { | ||
parallelsAlwaysFailFast() | ||
disableConcurrentBuilds() | ||
} | ||
|
||
parameters { | ||
string(name: 'version', defaultValue: '1.1.4') | ||
booleanParam(name: 'deploy', defaultValue: false) | ||
} | ||
|
||
stages { | ||
|
||
stage('Build') { | ||
agent { | ||
dockerfile true | ||
} | ||
steps { | ||
checkout scm | ||
writeFile file: 'mk/version.mk', text: "VERSION := $version" | ||
sh "rm -rf android/dist" | ||
sh "cd android && make dist" | ||
stash includes: 'android/dist/*', name: 'artifacts' | ||
archiveArtifacts artifacts: 'android/dist/*', followSymlinks: false | ||
} | ||
} | ||
|
||
stage('Upload to sonatype') { | ||
when { | ||
expression { return params.deploy } | ||
} | ||
steps { | ||
withCredentials([ usernamePassword( credentialsId: 'android-sonatype-nexus', usernameVariable: 'SONATYPE_USERNAME', passwordVariable: 'SONATYPE_PASSWORD' ), | ||
file(credentialsId: 'D599C1AA126762B1.asc', variable: 'PGP_PRIVATE_KEY_FILE'), | ||
string(credentialsId: 'PGP_PASSPHRASE', variable: 'PGP_PASSPHRASE') ]) { | ||
withMaven(maven: 'M3') { | ||
unstash 'artifacts' | ||
sh( | ||
script: """ | ||
touch local.properties | ||
version=$version ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
""" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
plugins { | ||
id "java-library" | ||
id "maven-publish" | ||
id "signing" | ||
id("io.github.gradle-nexus.publish-plugin") version "1.3.0" | ||
} | ||
|
||
group = "com.wire" | ||
version = System.getenv("version") | ||
|
||
def Properties properties = new Properties() | ||
properties.load(project.rootProject.file("local.properties").newDataInputStream()) | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
username = properties.getProperty("sonatype.username") ?: System.getenv("SONATYPE_USERNAME") | ||
password = properties.getProperty("sonatype.password") ?: System.getenv("SONATYPE_PASSWORD") | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifact "android/dist/cryptobox-android.aar" | ||
artifact source: "android/dist/cryptobox-android-javadoc.jar", classifier: 'javadoc' | ||
artifact source: "android/dist/cryptobox-android-sources.jar", classifier: 'sources' | ||
|
||
pom { | ||
name.set("cryptobox-android") | ||
description.set("Wire - Cryptobox JNI bindings for Android") | ||
url.set("https://github.com/wireapp/cryptobox-jni") | ||
licenses { | ||
license { | ||
name.set("GPL-3.0") | ||
url.set("https://opensource.org/licenses/GPL-3.0") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("svenwire") | ||
name.set("Sven Jost") | ||
email.set("[email protected]") | ||
organization.set("Wire Swiss GmbH") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/wireapp/cryptobox-jni") | ||
developerConnection.set("scm:git:git://github.com/wireapp/cryptobox-jni") | ||
url.set("https://github.com/wireapp/cryptobox-jni") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
def signingKeyFile = properties.getProperty("signingKeyFile") ?: System.getenv("PGP_PRIVATE_KEY_FILE") | ||
def signingKey = new File(signingKeyFile).text | ||
def signingPassword = properties.getProperty("signingPassword") ?: System.getenv("PGP_PASSPHRASE") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.mavenJava | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.