Skip to content

Commit

Permalink
Merge pull request #21 from icerockdev/#20-maven-central
Browse files Browse the repository at this point in the history
#20 maven central configuration
  • Loading branch information
Alex009 authored Mar 27, 2021
2 parents c1226cf + 5bca936 commit 7957f46
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 29 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
name: KMP library publish
name: Create release

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version'
default: '0.1.0'
required: true

jobs:
build:
publish:
name: Publish library at mavenCentral
runs-on: ${{ matrix.os }}
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_KEY: ${{ secrets.OSSRH_KEY }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
Expand All @@ -17,4 +28,20 @@ jobs:
with:
java-version: 1.8
- name: Publish
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }} -DIS_MAIN_HOST=${{ matrix.os == 'ubuntu-latest' }}
run: ./gradlew publish -DIS_MAIN_HOST=${{ matrix.os == 'ubuntu-latest' }}
release:
name: Create release
needs: publish
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ github.ref }}
tag_name: release/${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
body: "Will be filled later"
draft: true
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![moko-parcelize](img/logo.png)
[![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-parcelize/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-parcelize/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.21-orange)
[![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/parcelize) ](https://repo1.maven.org/maven2/dev/icerock/moko/parcelize) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.31-orange)

# MOKO Parcelize
This is a Kotlin Multiplatform library that supports Parcelize in common code.
Expand All @@ -25,6 +25,7 @@ This is a Kotlin Multiplatform library that supports Parcelize in common code.
- iOS version 9.0+

## Versions
### Bintray
- kotlin 1.3.50
- 0.1.0
- kotlin 1.3.60
Expand All @@ -37,21 +38,24 @@ This is a Kotlin Multiplatform library that supports Parcelize in common code.
- 0.5.0
- kotlin 1.4.21
- 0.6.0
### mavenCentral
- kotlin 1.4.31
- 0.6.1

## Installation
root build.gradle
```groovy
allprojects {
repositories {
maven { url = "https://dl.bintray.com/icerockdev/moko" }
mavenCentral()
}
}
```

project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:parcelize:0.6.0")
commonMainApi("dev.icerock.moko:parcelize:0.6.1")
}
```

Expand Down
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

allprojects {
repositories {

mavenCentral()
google()
jcenter()

maven { url = uri("https://kotlin.bintray.com/kotlin") }
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
maven { url = uri("https://dl.bintray.com/icerockdev/moko") }
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}

plugins.withId(Deps.Plugins.androidLibrary.id) {
Expand Down
14 changes: 9 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
*/

plugins {
id("org.jetbrains.kotlin.jvm") version("1.4.21")
id("org.jetbrains.kotlin.jvm") version("1.4.31")
}

repositories {
jcenter()
mavenCentral()
google()

maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}

dependencies {
implementation("dev.icerock:mobile-multiplatform:0.9.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
implementation("dev.icerock:mobile-multiplatform:0.9.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
implementation("com.android.tools.build:gradle:4.1.1")
}
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
*/

object Deps {
private const val kotlinVersion = "1.4.21"
private const val kotlinVersion = "1.4.31"
private const val androidAppCompatVersion = "1.1.0"
const val mokoParcelizeVersion = "0.6.0"
const val mokoParcelizeVersion = "0.6.1"

object Android {
const val compileSdk = 28
Expand All @@ -23,6 +23,7 @@ object Deps {
val mobileMultiPlatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform")
val appleFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.apple-framework")
val mavenPublish = GradlePlugin(id = "maven-publish")
val signing = GradlePlugin(id = "signing")
}

object Libs {
Expand Down
4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true

android.useAndroidX=true

# Workaround for Bintray treating .sha512 files as artifacts
# https://github.com/gradle/gradle/issues/11412
systemProp.org.gradle.internal.publish.checksums.insecure=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
64 changes: 60 additions & 4 deletions parcelize/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

import java.util.Base64
import kotlin.text.String

plugins {
plugin(Deps.Plugins.androidLibrary)
plugin(Deps.Plugins.kotlinMultiPlatform)
plugin(Deps.Plugins.kotlinParcelize)
plugin(Deps.Plugins.mobileMultiPlatform)
plugin(Deps.Plugins.mavenPublish)
plugin(Deps.Plugins.signing)
}

group = "dev.icerock.moko"
Expand Down Expand Up @@ -61,13 +65,17 @@ fun org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.windows() {
mingwX86()
}

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
repositories.maven("https://api.bintray.com/maven/icerockdev/moko/moko-parcelize/;publish=1") {
name = "bintray"
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
name = "OSSRH"

credentials {
username = System.getProperty("BINTRAY_USER")
password = System.getProperty("BINTRAY_KEY")
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_KEY")
}
}

Expand All @@ -92,4 +100,52 @@ publishing {
.matching { it.publication == targetPublication }
.all { onlyIf { System.getProperty("IS_MAIN_HOST") == "true" } }
}

publications.withType<MavenPublication> {
// Stub javadoc.jar artifact
artifact(javadocJar.get())

// Provide artifacts information requited by Maven Central
pom {
name.set("MOKO parcelize")
description.set("@Parcelize support for android from common code in Kotlin Multiplatform")
url.set("https://github.com/icerockdev/moko-parcelize")
licenses {
license {
url.set("https://github.com/icerockdev/moko-parcelize/blob/master/LICENSE.md")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("[email protected]")
}
developer {
id.set("nrobi144")
name.set("Nagy Robert")
email.set("[email protected]")
}
}

scm {
connection.set("scm:git:ssh://github.com/icerockdev/moko-parcelize.git")
developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-parcelize.git")
url.set("https://github.com/icerockdev/moko-parcelize")
}
}
}

signing {
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
String(Base64.getDecoder().decode(base64Key))
}
if (signingKeyId != null) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}
}
}

0 comments on commit 7957f46

Please sign in to comment.