Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Maven publishing #38

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release

# TODO make run only on tags.
on:
pull_request: {}
push:
branches:
- trunk

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
publish:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4.0.0
with:
distribution: 'zulu'
java-version: 19

- name: Build and publish artifacts
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}
run: ./gradlew publish

# - name: Deploy docs to website
# uses: JamesIves/github-pages-deploy-action@releases/v3
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# BRANCH: site
# FOLDER: build/dokka/html
# TARGET_FOLDER: docs/0.x/
# CLEAN: true
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.publish) apply false
}

allprojects {
Expand Down
1 change: 1 addition & 0 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.compose.plugin)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
3 changes: 3 additions & 0 deletions compose/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=compose
POM_NAME=Monarch Jetpack Compose Integration
POM_DESCRIPTION=Collect feature flags as Jetpack Compose State
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
3 changes: 3 additions & 0 deletions core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=core
POM_NAME=Monarch core feature flagging
POM_DESCRIPTION=Multiplatform core abstraction over feature flags
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
kotlin.code.style=official

GROUP=io.github.kevincianfarini.monarch
POM_ARTIFACT_ID=monarch
VERSION_NAME=0.1.0-SNAPSHOT

POM_NAME=Monarch
POM_DESCRIPTION=Kotlin Multiplatform feature flagging
POM_INCEPTION_YEAR=2024

POM_URL=https://github.com/kevincianfarini/monarch
Expand All @@ -23,5 +20,8 @@ POM_DEVELOPER_URL=https://github.com/kevincianfarini

SONATYPE_CONNECT_TIMEOUT_SECONDS=120
SONATYPE_CLOSE_TIMEOUT_SECONDS=900
SONATYPE_AUTOMATIC_RELEASE=true
SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true

android.useAndroidX=true
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ kotlin = "1.9.22"
kotlinx-coroutines = "1.8.0"
kotlinx-serialization = "1.6.2"
launchdarkly-android = "5.0.0"
publish = "0.27.0"
turbine = "1.0.0"

[libraries]
Expand All @@ -23,4 +24,5 @@ turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }
android-library = { id = "com.android.library", version.ref = "agp" }
compose-plugin = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
1 change: 1 addition & 0 deletions integrations/launch-darkly/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.publish)
}

android {
Expand Down
3 changes: 3 additions & 0 deletions integrations/launch-darkly/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=launch-darkly-integration
POM_NAME=Monarch Launch Darkly Integration
POM_DESCRIPTION=Multiplatform integration with Launch Darkly feature flag SDKs
1 change: 1 addition & 0 deletions mixins/kotlinx-serialization-json/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
3 changes: 3 additions & 0 deletions mixins/kotlinx-serialization-json/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=kotlinx-serialization-mixin
POM_NAME=Monarch kotlinx-serialzation Mixin
POM_DESCRIPTION=Multiplatform mixin that decode JSON feature flags
1 change: 1 addition & 0 deletions test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
3 changes: 3 additions & 0 deletions test/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=test
POM_NAME=Monarch Testing Support
POM_DESCRIPTION=Monarch testing facilities