Skip to content

Commit

Permalink
Merge pull request #11 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.2.1
  • Loading branch information
Alex009 authored Mar 29, 2021
2 parents 9fe74c2 + 441f946 commit ef9e539
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 40 deletions.
54 changes: 40 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
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:
runs-on: macOS-latest

publish:
name: Publish library at mavenCentral
runs-on: macOS-latest
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 }}
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cocoapods install
run: (cd sample/ios-app && pod install)
- name: Publish library
run: ./gradlew publish
release:
name: Create release
needs: publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
java-version: 1.8
- name: Cocoapods install
run: (cd sample/ios-app && pod install)
- name: Publish library
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
commitish: ${{ github.ref }}
tag_name: release/${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
body: "Will be filled later"
draft: true
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![moko-socket-io](https://user-images.githubusercontent.com/5010169/80988267-712b7e80-8e5d-11ea-955e-c788a567c64e.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-socket-io/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-socket-io/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.10-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/socket-io) ](https://repo1.maven.org/maven2/dev/icerock/moko/socket-io) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.31-orange)

# Mobile Kotlin socket io
This is a Kotlin MultiPlatform library that provides real-time, event-based communication for iOS and Android.
Expand All @@ -24,25 +24,29 @@ This is a Kotlin MultiPlatform library that provides real-time, event-based comm
- iOS version 9.0+

## Versions
### Bintray
- kotlin 1.3.72
- 0.1.0
- kotlin 1.4.10
- 0.2.0
### mavenCentral
- kotlin 1.4.31
- 0.2.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:socket-io:0.2.0")
commonMainApi("dev.icerock.moko:socket-io:0.2.1")
commonMainApi("org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC")
}
Expand All @@ -55,7 +59,7 @@ cocoaPods {

Podfile
```ruby
pod 'mokoSocketIo', :git => 'https://github.com/icerockdev/moko-socket-io.git', :tag => 'release/0.2.0'
pod 'mokoSocketIo', :git => 'https://github.com/icerockdev/moko-socket-io.git', :tag => 'release/0.2.1'
```

## Usage
Expand Down
11 changes: 7 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ plugins {

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")
includeGroup("org.jetbrains.kotlinx")
}
}
}

apply(plugin = Deps.Plugins.detekt.id)
Expand Down
14 changes: 9 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
plugins {
id("org.jetbrains.kotlin.jvm") version("1.4.10")
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.7.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
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.0.1")
}
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

object Deps {

private const val kotlinVersion = "1.4.0"
private const val detektVersion = "1.7.4"
private const val kotlinVersion = "1.4.31"
private const val detektVersion = "1.15.0"

private const val androidAppCompatVersion = "1.1.0"
private const val androidSocketIoVersion = "1.0.0"
private const val kotlinxSerializationVersion = "1.0.0-RC"

const val mokoSocketIoVersion = "0.2.0"
const val mokoSocketIoVersion = "0.2.1"


object Android {
Expand All @@ -30,6 +30,7 @@ object Deps {

val mobileMultiplatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform")
val mavenPublish = GradlePlugin(id = "org.gradle.maven-publish")
val signing = GradlePlugin(id = "signing")

val detekt = GradlePlugin(id = "io.gitlab.arturbosch.detekt", version = detektVersion)
val iosFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.ios-framework")
Expand Down
6 changes: 1 addition & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ kotlin.native.enableDependencyPropagation=false
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
android.useAndroidX=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.6.1-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 socket-io/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
* Copyright 2020 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.kotlinAndroidExtensions)
plugin(Deps.Plugins.mobileMultiplatform)
plugin(Deps.Plugins.mavenPublish)
plugin(Deps.Plugins.signing)
}

group = "dev.icerock.moko"
Expand All @@ -22,13 +26,65 @@ dependencies {
}
}

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

publishing {
repositories.maven("https://api.bintray.com/maven/icerockdev/moko/moko-socket-io/;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")
}
}

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

// Provide artifacts information requited by Maven Central
pom {
name.set("MOKO socket io")
description.set("Socket.IO implementation Kotlin Multiplatform library")
url.set("https://github.com/icerockdev/moko-socket-io")
licenses {
license {
url.set("https://github.com/icerockdev/moko-socket-io/blob/master/LICENSE.md")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("[email protected]")
}
developer {
id.set("Dorofeev")
name.set("Andrey Dorofeef")
email.set("[email protected]")
}
}

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

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)
}
}
}
Expand Down

0 comments on commit ef9e539

Please sign in to comment.