Skip to content

Commit 5a14621

Browse files
authored
Merge pull request #88 from rive-app/chore/gh-actions
Chore/gh actions
2 parents d879ad4 + d28b551 commit 5a14621

File tree

6 files changed

+85
-14
lines changed

6 files changed

+85
-14
lines changed

.github/workflows/build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build Rive Module
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
build:
9+
runs-on: macos-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
token: ${{ secrets.RIVE_REPO_PAT }}
15+
submodules: recursive
16+
- name: Init submodule
17+
run: git submodule update --init
18+
- name: Build Android
19+
uses: reactivecircus/android-emulator-runner@v2
20+
with:
21+
api-level: 29
22+
script: ./gradlew kotlin:assembleRelease
23+
- name: Upload artifact
24+
uses: actions/upload-artifact@v2
25+
with:
26+
name: rive
27+
path: kotlin/build/outputs/aar/kotlin-release.aar
28+
29+
publish:
30+
name: Release build and publish
31+
needs: build
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v2
36+
- name: Set up JDK 1.8
37+
uses: actions/setup-java@v1
38+
with:
39+
java-version: 1.8
40+
# Base64 decodes and pipes the GPG key content into the secret file
41+
- name: Prepare environment
42+
env:
43+
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
44+
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
45+
run: |
46+
git fetch --unshallow
47+
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
48+
# Builds the release artifacts of the library
49+
- name: Download framework artifact
50+
uses: actions/download-artifact@v2
51+
with:
52+
name: rive
53+
path: kotlin/build/outputs/aar/kotlin-release.aar
54+
# Runs upload, and then closes & releases the repository
55+
- name: Publish to MavenCentral
56+
uses: reactivecircus/android-emulator-runner@v2
57+
with:
58+
api-level: 29
59+
script: ./gradlew publishAllPublicationsToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
60+
env:
61+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
62+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
63+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
64+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
65+
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
66+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
implementation 'androidx.core:core-ktx:1.3.2'
3939
implementation 'androidx.appcompat:appcompat:1.2.0'
4040
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
41-
implementation project(path: ':kotlin')
41+
implementation 'app.rive:rive-android:0.0.3'
4242
testImplementation 'junit:junit:4.13.2'
4343
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
4444
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

build.gradle

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
apply plugin: "io.github.gradle-nexus.publish-plugin"
3+
apply plugin: 'com.palantir.git-version'
4+
5+
def details = versionDetails()
6+
7+
ext {
8+
PUBLISH_GROUP_ID = 'app.rive'
9+
PUBLISH_VERSION = details.lastTag
10+
PUBLISH_ARTIFACT_ID = 'rive'
11+
}
212
buildscript {
313
ext{
414
kotlin_version = "1.4.32"
@@ -8,22 +18,23 @@ buildscript {
818
repositories {
919
google()
1020
jcenter()
21+
maven {
22+
url = uri("https://plugins.gradle.org/m2/")
23+
}
1124
}
1225

1326
dependencies {
1427
classpath 'com.android.tools.build:gradle:4.1.3'
1528
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1629
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${dokkaVersion}")
30+
classpath("io.github.gradle-nexus:publish-plugin:1.0.0")
31+
classpath "com.palantir.gradle.gitversion:gradle-git-version:0.12.3"
1732
// NOTE: Do not place your application dependencies here; they belong
1833
// in the individual module build.gradle files
1934
}
2035

2136
}
2237

23-
plugins {
24-
id("io.github.gradle-nexus.publish-plugin") version "1.0.0"
25-
}
26-
2738
allprojects {
2839
repositories {
2940
google()

kotlin/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,4 @@ task buildJNI(type: Exec) {
6464
commandLine './build.rive.for.sh', '-a', getDeviceAbi()
6565
}
6666

67-
ext {
68-
PUBLISH_GROUP_ID = 'app.rive'
69-
PUBLISH_VERSION = '0.0.3'
70-
PUBLISH_ARTIFACT_ID = 'rive-android'
71-
}
72-
73-
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
67+
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

scripts/publish-module.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
8888

8989
signing {
9090
sign publishing.publications
91-
}
91+
}

scripts/publish-root.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ nexusPublishing {
3232
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
3333
}
3434
}
35-
}
35+
}

0 commit comments

Comments
 (0)