Skip to content

Commit

Permalink
Kotlin 1.4.31, publish Maven Central, release 0.6.0 (#33)
Browse files Browse the repository at this point in the history
* Publish to Maven Central, publish snapshots, update to Kotlin 1.4.31, release v0.6.0

* Turn snapshots off, can't work right now

* Improve changelog
  • Loading branch information
natario1 committed Mar 10, 2021
1 parent 24470d4 commit 124db09
Show file tree
Hide file tree
Showing 11 changed files with 164 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
with:
java-version: 1.8
- name: Perform base checks
run: ./gradlew demo:assembleDebug library:publishAllDirectory
run: ./gradlew demo:assembleDebug library:deployLocally
16 changes: 8 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ on:
release:
types: [published]
jobs:
BINTRAY_UPLOAD:
name: Bintray Upload
MAVEN_UPLOAD:
name: Maven Upload
runs-on: ubuntu-latest
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
BINTRAY_REPO: ${{ secrets.BINTRAY_REPO }}
BINTRAY_REPO_LEGACY: ${{ secrets.BINTRAY_REPO_LEGACY }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Perform bintray upload
run: ./gradlew library:publishAllBintray
- name: Perform maven upload
run: ./gradlew library:deploySonatypeReleases
23 changes: 23 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
# Renaming ? Change the README badge.
name: Snapshot
on:
push:
branches:
- main
jobs:
SNAPSHOT:
name: Publish Snapshots
runs-on: ubuntu-latest
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish sonatype snapshots
run: ./gradlew library:deploySonatypeSnapshots
21 changes: 21 additions & 0 deletions .run/deploySonatypeReleases.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="deploySonatypeReleases" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/library" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--stacktrace" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="deploySonatypeReleases" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="publishAllDirectory" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="deploySonatypeSnapshots" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/library" />
Expand All @@ -10,7 +10,7 @@
</option>
<option name="taskNames">
<list>
<option value="publishAllDirectory" />
<option value="deploySonatypeSnapshots" />
</list>
</option>
<option name="vmOptions" value="" />
Expand Down
4 changes: 2 additions & 2 deletions .run/publishAllBintray.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="publishAllBintray" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="deployLocally" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/library" />
Expand All @@ -10,7 +10,7 @@
</option>
<option name="taskNames">
<list>
<option value="publishAllBintray" />
<option value="deployLocally" />
</list>
</option>
<option name="vmOptions" value="" />
Expand Down
15 changes: 12 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ buildscript {
mavenCentral()
jcenter()
mavenLocal()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}

configurations.configureEach {
resolutionStrategy {
cacheChangingModulesFor(0, TimeUnit.SECONDS)
}
}

dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
classpath("com.android.tools.build:gradle:4.1.1")
classpath("io.deepmedia.tools:publisher:0.4.1")
classpath("io.deepmedia.tools:publisher:latest-SNAPSHOT") {
isChanging = true
}
}
}

Expand All @@ -22,7 +31,7 @@ allprojects {
google()
mavenCentral()
jcenter()
maven("https://dl.bintray.com/natario/multiplatform")
// maven("https://dl.bintray.com/natario/multiplatform")
}
}

Expand Down
4 changes: 2 additions & 2 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
dependencies {
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.core:core-ktx:1.3.2")
implementation("com.google.android.exoplayer:exoplayer-core:2.10.4")
implementation("com.google.android.exoplayer:exoplayer-ui:2.10.4")
implementation("com.google.android.exoplayer:exoplayer-core:2.13.2")
implementation("com.google.android.exoplayer:exoplayer-ui:2.13.2")
implementation(project(":library"))

// For testing, instead of the project dependency:
Expand Down
7 changes: 7 additions & 0 deletions docs/_about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ New versions are released through GitHub, so the reference page is the [GitHub R
Starting from v0.3.1, you can [support development](https://github.com/sponsors/natario1) through the GitHub Sponsors program.
Companies can share a tiny part of their revenue and get private support hours in return. Thanks!

### v0.6.0

- Upgrade to Kotlin 1.4.31 ([#33][33])
- Publish to Maven Central ([#33][33])

### v0.5.4

- Upgrade to Kotlin 1.4.21 ([#31][31])
Expand Down Expand Up @@ -81,3 +86,5 @@ First versioned release.
[20]: https://github.com/natario1/Egloo/pull/20
[22]: https://github.com/natario1/Egloo/pull/22
[23]: https://github.com/natario1/Egloo/pull/23
[31]: https://github.com/natario1/Egloo/pull/31
[33]: https://github.com/natario1/Egloo/pull/33
20 changes: 17 additions & 3 deletions docs/_about/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ description: "Integrate in your project"
order: 1
---

Egloo is publicly hosted on [JCenter](https://bintray.com/natario/android/Egloo), where you
Egloo is publicly hosted on Maven Central repository, where you
can download the AAR package and other artifacts. To fetch with Gradle, make sure you add the
JCenter repository in your root projects `build.gradle` file:

```groovy
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
```
Expand All @@ -36,7 +36,21 @@ implementation("com.otaliastudios.opengl:egloo-androidnativex86:{{ site.github_v
implementation("com.otaliastudios.opengl:egloo-androidnativex64:{{ site.github_version }}") // Android Native KLib
implementation("com.otaliastudios.opengl:egloo-androidnativearm32:{{ site.github_version }}") // Android Native KLib
implementation("com.otaliastudios.opengl:egloo-androidnativearm64:{{ site.github_version }}") // Android Native KLib
```

> The Android version works on API 18+, which is the only requirement and should be met by many projects nowadays.
### Snapshots

We deploy snapshots on each push to the main branch. If you want to use the latest, unreleased features,
you can do so (at your own risk) by adding the snapshot repository:

```groovy
allprojects {
repositories {
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
```

> The Android version works on API 18+, which is the only requirement and should be met by many projects nowadays.
and changing the library version from `{{ site.github_version }}` to `latest-SNAPSHOT`.
100 changes: 69 additions & 31 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import com.android.build.gradle.internal.tasks.factory.dependsOn
import io.deepmedia.tools.publisher.common.GithubScm
import io.deepmedia.tools.publisher.common.License
import io.deepmedia.tools.publisher.common.Release
import io.deepmedia.tools.publisher.sonatype.Sonatype
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
Expand Down Expand Up @@ -79,7 +82,7 @@ android {
defaultConfig {
setMinSdkVersion(property("androidMinSdkVersion") as Int)
setTargetSdkVersion(property("androidTargetSdkVersion") as Int)
versionName = "0.5.4"
versionName = "0.6.0"
}
buildTypes["release"].consumerProguardFile("proguard-rules.pro")
sourceSets["main"].java.srcDirs("src/androidJvmMain/kotlin")
Expand All @@ -88,37 +91,25 @@ android {

// Publishing

val deploySonatypeSnapshots by tasks.registering
val deploySonatypeReleases by tasks.registering
val deployLocally by tasks.registering

publisher {
// Common parameters.
project.group = "com.otaliastudios.opengl"
project.description = "Simple and lightweight OpenGL ES drawing and EGL management for Android, with object-oriented components based on Google's Grafika."
project.url = "https://github.com/natario1/Egloo"
project.vcsUrl = "https://github.com/natario1/Egloo.git"
project.scm = GithubScm("natario1", "Egloo")
project.addLicense(License.MIT)
project.addDeveloper("natario1", "mat.iavarone@gmail.com")
release.docs = Release.DOCS_AUTO
val dir = "../prebuilt"

// Legacy android release (:egloo)
bintray("legacy") {
auth.user = "BINTRAY_USER"
auth.key = "BINTRAY_KEY"
auth.repo = "BINTRAY_REPO_LEGACY"
component = "release"
project.name = "Egloo"
project.artifact = "egloo"
release.sources = Release.SOURCES_AUTO
release.docs = Release.DOCS_AUTO
}
directory("legacy") {
directory = dir
component = "release"
project.name = "Egloo"
project.artifact = "egloo"
release.sources = Release.SOURCES_AUTO
release.docs = Release.DOCS_AUTO
}

// Kotlin creates MavenPublication objects with a specific name.
// Make sure to override the weird artifact name that KMP provides for these.
// Make also sure to not override the packaging, as some are klib, some pom, som aar...
// Recent kotlin versions automatically add the sources jar artifact, so we must not add it.
val multiplatformPublications = mapOf(
"androidJvmRelease" to "egloo-android",
"androidNativeArm32" to "egloo-androidnativearm32",
Expand All @@ -129,22 +120,69 @@ publisher {
// "metadata" to "egloo-metadata" - removed in Kotlin 1.4.20 or so
)
multiplatformPublications.forEach { (mavenPublication, artifactId) ->
bintray(mavenPublication) {
auth.user = "BINTRAY_USER"
auth.key = "BINTRAY_KEY"
auth.repo = "BINTRAY_REPO"
deployLocally.dependsOn("publishToDirectory${mavenPublication.capitalize()}")
directory(mavenPublication) {
directory = dir
publication = mavenPublication
project.name = artifactId
project.artifact = artifactId
if (artifactId == "egloo-android") {
release.docs = Release.DOCS_AUTO
}
}
directory(mavenPublication) {
directory = dir

deploySonatypeReleases.dependsOn("publishToSonatype${mavenPublication.capitalize()}")
sonatype(mavenPublication) {
auth.user = "SONATYPE_USER"
auth.password = "SONATYPE_PASSWORD"
signing.key = "SIGNING_KEY"
signing.password = "SIGNING_PASSWORD"
publication = mavenPublication
project.name = artifactId
project.artifact = artifactId
}

// TODO can't work, version overrides the other sonatype version! Need to fix this in publisher plugin
/* deploySonatypeSnapshots.dependsOn("publishToSonatype${mavenPublication.capitalize()}Snapshot")
sonatype(mavenPublication + "Snapshot") {
repository = Sonatype.OSSRH_SNAPSHOT_1
release.version = "latest-SNAPSHOT"
auth.user = "SONATYPE_USER"
auth.password = "SONATYPE_PASSWORD"
signing.key = "SIGNING_KEY"
signing.password = "SIGNING_PASSWORD"
publication = mavenPublication
project.name = artifactId
project.artifact = artifactId
} */
}

// Legacy android release (:egloo)
deployLocally.dependsOn("publishToDirectoryLegacy")
directory("legacy") {
directory = dir
component = "release"
project.name = "Egloo"
project.artifact = "egloo"
release.sources = Release.SOURCES_AUTO
}

deploySonatypeReleases.dependsOn("publishToSonatypeLegacy")
sonatype("legacy") {
auth.user = "SONATYPE_USER"
auth.password = "SONATYPE_PASSWORD"
signing.key = "SIGNING_KEY"
signing.password = "SIGNING_PASSWORD"
component = "release"
project.name = "Egloo"
project.artifact = "egloo"
release.sources = Release.SOURCES_AUTO
}
}

/* afterEvaluate {
val publishing = project.publishing
publishing.publications.filterIsInstance<MavenPublication>().forEach {
println("Analyzing publication ${it.name}...")
it.artifacts.forEach {
println(" - artifact ext=${it.extension} classifier=${it.classifier}")
}
}
} */

0 comments on commit 124db09

Please sign in to comment.