Skip to content

Commit acf5df2

Browse files
#6 migrate to mavenCentral
1 parent cd34eb3 commit acf5df2

File tree

8 files changed

+113
-27
lines changed

8 files changed

+113
-27
lines changed

.github/workflows/publish.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
name: KMP library publish
1+
name: Create release
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version'
8+
default: '0.1.0'
9+
required: true
610

711
jobs:
8-
build:
12+
publish:
13+
name: Publish library at mavenCentral
914
runs-on: macOS-latest
15+
env:
16+
OSSRH_USER: ${{ secrets.OSSRH_USER }}
17+
OSSRH_KEY: ${{ secrets.OSSRH_KEY }}
18+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEYID }}
19+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
20+
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}
1021

1122
steps:
1223
- uses: actions/checkout@v1
@@ -17,4 +28,20 @@ jobs:
1728
- name: Cocoapods install
1829
run: (cd sample/ios-app && pod install)
1930
- name: Publish library
20-
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
31+
run: ./gradlew publish
32+
release:
33+
name: Create release
34+
needs: publish
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Create Release
38+
id: create_release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
commitish: ${{ github.ref }}
44+
tag_name: release/${{ github.event.inputs.version }}
45+
release_name: Release ${{ github.event.inputs.version }}
46+
body: "Will be filled later"
47+
draft: true

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
![moko-crash-reporting](https://user-images.githubusercontent.com/701307/98647965-37858400-2368-11eb-98e8-6e62d75fa6af.png)
2-
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://api.bintray.com/packages/icerockdev/moko/moko-crash-reporting/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-crash-reporting/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.21-orange)
2+
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/crash-reporting) ](https://repo1.maven.org/maven2/dev/icerock/moko/crash-reporting) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.31-orange)
33

44
# Mobile Kotlin crash report
55

@@ -26,25 +26,29 @@ This is a Kotlin MultiPlatform library that provides reporting fatal and non-fat
2626
- iOS version 9.0+
2727

2828
## Versions
29+
### Bintray
2930
- kotlin 1.4.10
3031
- 0.1.0
3132
- kotlin 1.4.21
3233
- 0.1.1
34+
### mavenCentral
35+
- kotlin 1.4.31
36+
- 0.1.2
3337

3438
## Installation
3539
root build.gradle
3640
```groovy
3741
allprojects {
3842
repositories {
39-
maven { url = "https://dl.bintray.com/icerockdev/moko" }
43+
mavenCentral()
4044
maven { url = uri("https://dl.bintray.com/aakira/maven") } // for CrashReportingAntilog
4145
}
4246
}
4347
```
4448
project build.gradle
4549
```groovy
4650
dependencies {
47-
commonMainImplementation("dev.icerock.moko:crash-reporting-crashlytics:0.1.1") // for CrashlyticsLogger
51+
commonMainImplementation("dev.icerock.moko:crash-reporting-crashlytics:0.1.2") // for CrashlyticsLogger
4852
commonMainImplementation("dev.icerock.moko:crash-reporting-napier:0.1.1") // for CrashReportingAntilog
4953
commonMainImplementation("com.github.aakira:napier:1.4.1") // for CrashReportingAntilog
5054
}

build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ plugins {
88

99
buildscript {
1010
repositories {
11-
jcenter()
11+
mavenCentral()
1212
google()
1313

14-
maven { url = uri("https://dl.bintray.com/kotlin/kotlin") }
15-
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
16-
maven { url = uri("https://plugins.gradle.org/m2/") }
14+
jcenter {
15+
content {
16+
includeGroup("org.jetbrains.trove4j")
17+
}
18+
}
1719
}
1820
dependencies {
1921
plugin(Deps.Plugins.googleServices)

buildSrc/build.gradle.kts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,22 @@
33
*/
44

55
plugins {
6-
id("org.jetbrains.kotlin.jvm") version("1.4.21")
6+
id("org.jetbrains.kotlin.jvm") version("1.4.31")
77
}
88

99
repositories {
10-
jcenter()
10+
mavenCentral()
1111
google()
1212

13-
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
13+
jcenter {
14+
content {
15+
includeGroup("org.jetbrains.trove4j")
16+
}
17+
}
1418
}
1519

1620
dependencies {
17-
implementation("dev.icerock:mobile-multiplatform:0.9.0")
18-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
21+
implementation("dev.icerock:mobile-multiplatform:0.9.1")
22+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
1923
implementation("com.android.tools.build:gradle:4.0.1")
2024
}

buildSrc/src/main/kotlin/Deps.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ object Deps {
1414
private const val firebaseCoreVersion = "17.4.3"
1515
private const val firebaseCrashlyticsVersion = "17.1.0"
1616

17-
const val mokoCrashReportingVersion = "0.1.1"
17+
const val mokoCrashReportingVersion = "0.1.2"
1818

1919

2020
object Android {
2121
const val compileSdk = 28
2222
const val targetSdk = 28
2323
const val minSdk = 16
24+
25+
val signing = GradlePlugin(id = "signing")
2426
}
2527

2628
object Plugins {

crash-reporting-core/build.gradle.kts

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
import java.util.Base64
6+
import kotlin.text.String
7+
58
plugins {
69
plugin(Deps.Plugins.androidLibrary)
710
plugin(Deps.Plugins.kotlinMultiplatform)
811
plugin(Deps.Plugins.mobileMultiplatform)
912
plugin(Deps.Plugins.mavenPublish)
13+
plugin(Deps.Plugins.signing)
1014
}
1115

1216
group = "dev.icerock.moko"
@@ -16,13 +20,60 @@ dependencies {
1620
androidMainImplementation(Deps.Libs.Android.appCompat)
1721
}
1822

23+
val javadocJar by tasks.registering(Jar::class) {
24+
archiveClassifier.set("javadoc")
25+
}
26+
1927
publishing {
20-
repositories.maven("https://api.bintray.com/maven/icerockdev/moko/moko-crash-reporting/;publish=1") {
21-
name = "bintray"
28+
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
29+
name = "OSSRH"
2230

2331
credentials {
24-
username = System.getProperty("BINTRAY_USER")
25-
password = System.getProperty("BINTRAY_KEY")
32+
username = System.getenv("OSSRH_USER")
33+
password = System.getenv("OSSRH_KEY")
34+
}
35+
}
36+
37+
publications.withType<MavenPublication> {
38+
// Stub javadoc.jar artifact
39+
artifact(javadocJar.get())
40+
41+
// Provide artifacts information requited by Maven Central
42+
pom {
43+
name.set("MOKO crash reporting")
44+
description.set("Fatal and Non-Fatal reporting to Crashlytics for Kotlin Multiplatform Mobile")
45+
url.set("https://github.com/icerockdev/moko-crash-reporting")
46+
licenses {
47+
license {
48+
url.set("https://github.com/icerockdev/moko-crash-reporting/blob/master/LICENSE.md")
49+
}
50+
}
51+
52+
developers {
53+
developer {
54+
id.set("Alex009")
55+
name.set("Aleksey Mikhailov")
56+
email.set("aleksey.mikhailov@icerockdev.com")
57+
}
58+
}
59+
60+
scm {
61+
connection.set("scm:git:ssh://github.com/icerockdev/moko-crash-reporting.git")
62+
developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-crash-reporting.git")
63+
url.set("https://github.com/icerockdev/moko-crash-reporting")
64+
}
65+
}
66+
}
67+
68+
signing {
69+
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
70+
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
71+
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
72+
String(Base64.getDecoder().decode(base64Key))
73+
}
74+
if (signingKeyId != null) {
75+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
76+
sign(publishing.publications)
2677
}
2778
}
2879
}

gradle.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ kotlin.mpp.enableGranularSourceSetsMetadata=true
88
kotlin.mpp.enableCompatibilityMetadataVariant=true
99

1010
android.useAndroidX=true
11-
12-
# Workaround for Bintray treating .sha512 files as artifacts
13-
# https://github.com/gradle/gradle/issues/11412
14-
systemProp.org.gradle.internal.publish.checksums.insecure=true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)