Skip to content

Commit 3f8a30d

Browse files
Create steps for manual release (#128)
* Create steps for manual release * Remove circleci
1 parent dfc63f5 commit 3f8a30d

File tree

7 files changed

+154
-28
lines changed

7 files changed

+154
-28
lines changed

.circleci/config.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.0

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
4+
<uses-feature
5+
android:name="android.hardware.camera"
6+
android:required="false" />
47

58
<uses-permission android:name="android.permission.CAMERA" />
69
<uses-permission android:name="android.permission.INTERNET" />
10+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
711

812
<application
913
android:allowBackup="true"

gradle.properties

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,32 @@ android.defaults.buildfeatures.buildconfig=true
2020
android.enableJetifier=true
2121
android.nonFinalResIds=false
2222
android.nonTransitiveRClass=false
23-
android.useAndroidX=true
23+
android.useAndroidX=true
24+
25+
26+
org.gradle.parallel=true
27+
org.gradle.daemon=true
28+
org.gradle.jvmargs=-Xmx12800M
29+
org.gradle.configureondemand=true
30+
31+
32+
android.useAndroidX=true
33+
GROUP=com.auth0.android
34+
POM_ARTIFACT_ID=guardian
35+
36+
POM_NAME=Guardian.Android
37+
POM_DESCRIPTION=Auth0 Guardian SDK
38+
POM_PACKAGING=aar
39+
40+
POM_URL=https://github.com/auth0/Guardian.Android
41+
POM_SCM_URL=https://github.com/auth0/Guardian.Android
42+
POM_SCM_CONNECTION=scm:[email protected]:auth0/Guardian.Android.git
43+
POM_SCM_DEV_CONNECTION=scm:[email protected]:auth0/Guardian.Android.git
44+
45+
POM_LICENCE_NAME=The MIT License (MIT)
46+
POM_LICENCE_URL=https://raw.githubusercontent.com/auth0/Guardian.Android/master/LICENSE
47+
POM_LICENCE_DIST=repo
48+
49+
POM_DEVELOPER_ID=auth0
50+
POM_DEVELOPER_NAME=Auth0
51+
POM_DEVELOPER_EMAIL=[email protected]

gradle/maven-publish.gradle

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
apply from: rootProject.file('gradle/versioning.gradle')
5+
6+
// TODO: java docs
7+
8+
task sourcesJar(type: Jar) {
9+
archiveClassifier = 'sources'
10+
from android.sourceSets.main.java.source
11+
}
12+
13+
final releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
14+
final snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
15+
16+
publishing {
17+
publications {
18+
release(MavenPublication) {
19+
groupId = GROUP
20+
artifactId = POM_ARTIFACT_ID
21+
version = getVersionName()
22+
23+
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
24+
artifact sourcesJar
25+
//TODO: artifact javadocJar
26+
27+
pom {
28+
name = POM_NAME
29+
packaging = POM_PACKAGING
30+
description = POM_DESCRIPTION
31+
url = POM_URL
32+
33+
licenses {
34+
license {
35+
name = POM_LICENCE_NAME
36+
url = POM_LICENCE_URL
37+
distribution = POM_LICENCE_DIST
38+
}
39+
}
40+
41+
developers {
42+
developer {
43+
id = POM_DEVELOPER_ID
44+
name = POM_DEVELOPER_NAME
45+
email = POM_DEVELOPER_EMAIL
46+
}
47+
}
48+
49+
scm {
50+
url = POM_SCM_URL
51+
connection = POM_SCM_CONNECTION
52+
developerConnection = POM_SCM_DEV_CONNECTION
53+
}
54+
55+
withXml {
56+
def dependenciesNode = asNode().appendNode('dependencies')
57+
58+
project.configurations.implementation.allDependencies.each {
59+
def dependencyNode = dependenciesNode.appendNode('dependency')
60+
dependencyNode.appendNode('groupId', it.group)
61+
dependencyNode.appendNode('artifactId', it.name)
62+
dependencyNode.appendNode('version', it.version)
63+
}
64+
}
65+
}
66+
}
67+
}
68+
repositories {
69+
maven {
70+
name = "sonatype"
71+
url = version.endsWith('SNAPSHOT') ? snapshotRepositoryUrl : releaseRepositoryUrl
72+
credentials {
73+
username = System.getenv("MAVEN_USERNAME")
74+
password = System.getenv("MAVEN_PASSWORD")
75+
}
76+
}
77+
}
78+
}
79+
80+
81+
signing {
82+
def signingKey = System.getenv("SIGNING_KEY")
83+
def signingPassword = System.getenv("SIGNING_PASSWORD")
84+
useInMemoryPgpKeys(signingKey, signingPassword)
85+
sign publishing.publications
86+
}
87+
88+
publish.dependsOn build
89+
tasks.named('signReleasePublication').configure {
90+
dependsOn 'bundleReleaseAar'
91+
}

gradle/versioning.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def getVersionFromFile() {
2+
def versionFile = rootProject.file('.version')
3+
return versionFile.text.readLines().first().trim()
4+
}
5+
6+
def isSnapshot() {
7+
return hasProperty('isSnapshot') ? isSnapshot.toBoolean() : true
8+
}
9+
10+
def getVersionName() {
11+
return isSnapshot() ? project.version+"-SNAPSHOT" : project.version
12+
}
13+
14+
ext {
15+
getVersionName = this.&getVersionName
16+
getVersionFromFile = this.&getVersionFromFile
17+
}

guardian/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ plugins {
22
id 'com.android.library'
33
}
44

5+
6+
7+
apply from: rootProject.file('gradle/versioning.gradle')
8+
9+
version = getVersionFromFile()
10+
11+
logger.lifecycle("Using version ${version} for ${name}")
12+
13+
514
android {
615
defaultConfig {
716
compileSdk 33
@@ -29,6 +38,9 @@ android {
2938
namespace 'com.auth0.android.guardian.sdk'
3039
}
3140

41+
apply from: rootProject.file('gradle/maven-publish.gradle')
42+
43+
3244
dependencies {
3345
implementation fileTree(include: ['*.jar'], dir: 'libs')
3446
// Annotations (@NonNull etc)

0 commit comments

Comments
 (0)