-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dc17e9
commit 9b10ebf
Showing
9 changed files
with
194 additions
and
41 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
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,33 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' # Push events to any matching semantic tag. For example, 1.10.1 or 2.0.0. | ||
# For more details, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet | ||
# and https://docs.npmjs.com/about-semantic-versioning | ||
|
||
jobs: | ||
publish: | ||
name: Release build and publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
cache: gradle | ||
- name: Release build | ||
run: ./gradlew :clickstream:assembleRelease | ||
- name: Publish to MavenCentral | ||
run: ./gradlew :clickstream:publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | ||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | ||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} |
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.gojek.android.clickstream"> | ||
package="com.gojek.clickstream"> | ||
|
||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
</manifest> |
This file was deleted.
Oops, something went wrong.
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,77 @@ | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
task androidSourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
// For Android libraries | ||
from android.sourceSets.main.java.srcDirs | ||
from android.sourceSets.main.kotlin.srcDirs | ||
} else { | ||
// For pure Kotlin libraries, in case you have them | ||
from sourceSets.main.java.srcDirs | ||
from sourceSets.main.kotlin.srcDirs | ||
} | ||
} | ||
|
||
artifacts { | ||
archives androidSourcesJar | ||
} | ||
|
||
group = PUBLISH_GROUP_ID | ||
version = PUBLISH_VERSION | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId PUBLISH_GROUP_ID | ||
artifactId PUBLISH_ARTIFACT_ID | ||
version PUBLISH_VERSION | ||
|
||
// Two artifacts, the `aar` (or `jar`) and the sources | ||
if (project.plugins.findPlugin("com.android.library")) { | ||
from components.release | ||
} else { | ||
from components.java | ||
} | ||
|
||
artifact androidSourcesJar | ||
//artifact javadocJar | ||
|
||
pom { | ||
name = PUBLISH_ARTIFACT_ID | ||
description = 'Clickstream' | ||
url = 'https://github.com/gojek/clickstream-android' | ||
licenses { | ||
license { | ||
name = 'Clickstream License' | ||
url = 'https://github.com/gojek/clickstream-android/blob/main/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'radityagumay' | ||
name = 'Raditya Gumay' | ||
email = 'raditya.g@gojek.com' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:github.com/gojek/clickstream-android.git' | ||
developerConnection = 'scm:git:ssh://github.com/gojek/clickstream-android.git' | ||
url = 'https://github.com/gojek/clickstream-android/tree/main' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
useInMemoryPgpKeys( | ||
rootProject.ext["signing.keyId"], | ||
rootProject.ext["signing.key"], | ||
rootProject.ext["signing.password"], | ||
) | ||
sign publishing.publications | ||
} |
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,36 @@ | ||
// Create variables with empty default values | ||
ext["ossrhUsername"] = '' | ||
ext["ossrhPassword"] = '' | ||
ext["sonatypeStagingProfileId"] = '' | ||
ext["signing.keyId"] = '' | ||
ext["signing.password"] = '' | ||
ext["signing.key"] = '' | ||
|
||
File secretPropsFile = project.rootProject.file('local.properties') | ||
if (secretPropsFile.exists()) { | ||
// Read local.properties file first if it exists | ||
Properties p = new Properties() | ||
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) } | ||
p.each { name, value -> ext[name] = value } | ||
} else { | ||
// Use system environment variables | ||
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME') | ||
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD') | ||
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID') | ||
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID') | ||
ext["signing.password"] = System.getenv('SIGNING_PASSWORD') | ||
ext["signing.key"] = System.getenv('SIGNING_KEY') | ||
} | ||
|
||
// Set up Sonatype repository | ||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
stagingProfileId = sonatypeStagingProfileId | ||
username = ossrhUsername | ||
password = ossrhPassword | ||
nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) | ||
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/")) | ||
} | ||
} | ||
} |