-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d37a650
commit 4ec1c47
Showing
59 changed files
with
845 additions
and
3,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 17 | ||
|
||
- uses: gradle/[email protected] | ||
with: | ||
gradle-home-cache-cleanup: true | ||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
- name: Assemble | ||
run: ./gradlew assemble --stacktrace | ||
- name: Publish | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: ./gradlew publish | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
GPG_KEY: ${{ secrets.GPG_KEY }} | ||
GPG_KEY_PWD: ${{ secrets.GPG_KEY_PWD }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
@file: Suppress("DSL_SCOPE_VIOLATION") | ||
|
||
import org.jetbrains.compose.internal.utils.localPropertiesFile | ||
import java.util.Properties | ||
import java.util.Base64 | ||
|
||
plugins { | ||
alias(libs.plugins.android.library) | ||
alias(libs.plugins.kotlin.multiplatform) | ||
alias(libs.plugins.android.application).apply(false) | ||
alias(libs.plugins.compose).apply(false) | ||
alias(libs.plugins.dokka).apply(false) | ||
id("maven-publish") | ||
id("signing") | ||
} | ||
|
||
//tasks.register("clean", Delete::class) { | ||
|
@@ -19,13 +26,29 @@ val composePlugin = libs.plugins.compose | |
|
||
val ver = libs.versions.qrose.get() | ||
|
||
if (System.getenv("OSSRH_PASSWORD") != null){ | ||
ext["OSSRH_USERNAME"] = System.getenv("OSSRH_USERNAME") | ||
ext["OSSRH_PASSWORD"] = System.getenv("OSSRH_PASSWORD") | ||
ext["GPG_KEY"] = System.getenv("GPG_KEY") | ||
ext["GPG_KEY_PWD"] = System.getenv("GPG_KEY_PWD") | ||
} else { | ||
val properties = Properties().apply { | ||
load(localPropertiesFile.inputStream()) | ||
} | ||
properties.forEach { | ||
ext[it.key.toString()] = it.value.toString() | ||
} | ||
} | ||
|
||
subprojects { | ||
if (!name.startsWith("qrose")) | ||
return@subprojects | ||
|
||
this.group = "io.github.alexzhirkevich" | ||
this.version = ver | ||
|
||
plugins.apply("maven-publish") | ||
plugins.apply("signing") | ||
plugins.apply(kmpPlugin.get().pluginId) | ||
plugins.apply(androidLibPlugin.get().pluginId) | ||
plugins.apply(composePlugin.get().pluginId) | ||
|
@@ -95,6 +118,81 @@ subprojects { | |
targetCompatibility = JavaVersion.toVersion(_jvmTarget) | ||
} | ||
} | ||
|
||
val javadocJar by tasks.registering(Jar::class) { | ||
archiveClassifier.set("javadoc") | ||
} | ||
|
||
val signingTasks = tasks.withType<Sign>() | ||
|
||
tasks.withType<AbstractPublishToMaven>().configureEach { | ||
dependsOn(signingTasks) | ||
} | ||
|
||
publishing { | ||
|
||
repositories.maven { | ||
val releasesRepoUrl = | ||
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
val snapshotsRepoUrl = | ||
"https://s01.oss.sonatype.org/content/repositories/snapshots/" | ||
url = if (version.toString().endsWith("SNAPSHOT")) { | ||
uri(snapshotsRepoUrl) | ||
} else { | ||
uri(releasesRepoUrl) | ||
} | ||
credentials { | ||
if (rootProject.ext.has("OSSRH_PASSWORD")) { | ||
password = rootProject.ext["OSSRH_PASSWORD"] as String | ||
} | ||
if (rootProject.ext.has("OSSRH_USERNAME")) { | ||
username = rootProject.ext["OSSRH_USERNAME"] as String | ||
} | ||
} | ||
} | ||
|
||
val publishProperties = Properties().apply { | ||
load(file("publish.properties").inputStream()) | ||
} | ||
|
||
publications.withType<MavenPublication> { | ||
artifact(javadocJar) | ||
pom { | ||
name.set(this@subprojects.name) | ||
description.set(publishProperties.getProperty("description")) | ||
url.set("https://github.com/alexzhirkevich/qrose") | ||
|
||
licenses { | ||
license { | ||
name.set("MIT") | ||
url.set("https://opensource.org/licenses/MIT") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("alexzhirkevich") | ||
name.set("Alexander Zhirkevich") | ||
email.set("[email protected]") | ||
} | ||
} | ||
scm { | ||
url.set("https://github.com/alexzhirkevich/qrose") | ||
connection.set("scm:git:git://github.com/alexzhirkevich/qrose.git") | ||
developerConnection.set("scm:git:git://github.com/alexzhirkevich/qrose.git") | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (rootProject.ext.has("GPG_KEY") && rootProject.ext.has("GPG_KEY_PWD") ) { | ||
signing { | ||
useInMemoryPgpKeys( | ||
Base64.getDecoder().decode(rootProject.ext["GPG_KEY"] as String).decodeToString(), | ||
rootProject.ext["GPG_KEY_PWD"] as String, | ||
) | ||
sign(publishing.publications) | ||
} | ||
} | ||
} | ||
android { | ||
namespace = "io.github.alexzhirkevich.qrose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.