-
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.
* add api client with grpc kotlin * first pass at package work * add a release script * first pass at package management * move signing in to after
- Loading branch information
1 parent
b26d97b
commit d2ddf72
Showing
5 changed files
with
127 additions
and
1 deletion.
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,41 @@ | ||
name: Release XMTP Android Package | ||
on: | ||
push: | ||
branches: | ||
- release | ||
|
||
jobs: | ||
library: | ||
name: Release Library | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Run build with Gradle Wrapper | ||
run: ./gradlew build | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create a GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ steps.tag_version.outputs.new_version }} | ||
name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
- name: Gradle Publish | ||
env: | ||
RELEASE_VERSION: ${{ steps.tag_version.outputs.new_version }} | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
SIGN_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | ||
SIGN_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | ||
MAVEN_PROFILE_ID: ${{ secrets.MAVEN_PROFILE_ID }} | ||
run: ./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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
plugins { | ||
id 'signing' | ||
id 'maven-publish' | ||
id 'com.android.library' | ||
id 'org.jetbrains.kotlin.android' | ||
id 'com.google.protobuf' version '0.9.1' | ||
|
@@ -33,6 +35,13 @@ android { | |
kotlinOptions { | ||
jvmTarget = '11' | ||
} | ||
|
||
publishing { | ||
singleVariant("release") { | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
} | ||
} | ||
|
||
protobuf { | ||
|
@@ -73,4 +82,49 @@ dependencies { | |
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.5' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId = "org.xmtp" | ||
artifactId = "android" | ||
version = System.getenv("RELEASE_VERSION") | ||
from components.release | ||
|
||
pom { | ||
name = "XMTP" | ||
description = "XMTP Android Library" | ||
url = "https://github.com/xmtp/xmtp-android" | ||
packaging = "jar" | ||
|
||
licenses { | ||
license { | ||
name = "MIT License" | ||
url = "https://github.com/xmtp/xmtp-android/blob/main/LICENSE" | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = "xmtp" | ||
name = "xmtp" | ||
email = "[email protected]" | ||
} | ||
} | ||
scm { | ||
connection = "https://github.com/xmtp/xmtp-android.git" | ||
developerConnection = "https://github.com/xmtp/xmtp-android.git" | ||
url = "https://github.com/xmtp/xmtp-android/tree/main" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
signing { | ||
def signingKey = System.getenv("SIGN_KEY") | ||
def signingPassword = System.getenv("SIGN_PASSWORD") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.release | ||
} | ||
} |
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,16 @@ | ||
#!/usr/bin/python | ||
import os | ||
import subprocess | ||
|
||
if (input("\nAre you sure? This will replace the current \"release\" branch with origin/main. Y/n\n") != "Y"): | ||
print(u'\U0001f44C' + " lmk if you change your mind") | ||
exit(0) | ||
|
||
os.system("git fetch origin") | ||
os.system("git checkout release") | ||
|
||
os.system("git reset --hard origin/main") | ||
os.system("git push --force origin release") | ||
|
||
print(u'\U0001f680' + " Successfully pushed origin/main to release") | ||
print(u'\U0001f440' + " Follow the deploy at https://github.com/xmtp/xmtp-android/actions") |