Skip to content

Commit

Permalink
Merge pull request #16 from mori-atsushi/publish
Browse files Browse the repository at this point in the history
Setup for publish
  • Loading branch information
mori-atsushi authored Sep 16, 2023
2 parents dbe4029 + a037098 commit 0ff66fc
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish

on:
push:
tags:
- 'v*'

jobs:
publish:
runs-on: macos-latest # to publish for Kotlin/Native
timeout-minutes: 90

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Publish
run: ./gradlew publishAllPublicationsToMavenCentral --no-build-cache
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}

- name: Close and release
run: ./gradlew closeAndReleaseRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}

release_draft:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: read

steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: create release draft
uses: release-drafter/release-drafter@v5
with:
name: ${{ env.RELEASE_VERSION }}
tag: ${{ env.RELEASE_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.publish)
alias(libs.plugins.dokka)
}

Expand Down
23 changes: 23 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,26 @@ kotlin.mpp.androidSourceSetLayoutVersion=2
# Android
android.nonTransitiveRClass=true
android.useAndroidX=true

# Maven Central
SONATYPE_HOST=S01
RELEASE_SIGNING_ENABLED=true
GROUP=com.moriatsushi.kredux
VERSION_NAME=1.0.0-alpha01

POM_NAME=KRedux
POM_DESCRIPTION=Simple implementation of Redux in Kotlin
POM_INCEPTION_YEAR=2023
POM_URL=https://github.com/mori-atsushi/kredux

POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENSE_DIST=repo

POM_SCM_URL=https://github.com/mori-atsushi/kredux
POM_SCM_CONNECTION=scm:git:https://github.com/mori-atsushi/kredux
POM_SCM_DEV_CONNECTION=scm:git:https://github.com/mori-atsushi/kredux

POM_DEVELOPER_ID=moriatsushi
POM_DEVELOPER_NAME=Mori Atsushi
POM_DEVELOPER_URL=https://github.com/mori-atsushi/
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dokka = "1.9.0"
kotlin = "1.9.10"
kotlinxCoroutines = "1.7.3"
ktlint = "0.48.1"
publish = "0.25.3"
spotless = "6.21.0"

[libraries]
Expand All @@ -17,4 +18,5 @@ android-library = { id = "com.android.library", version.ref = "androidGradlePlug
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
1 change: 1 addition & 0 deletions kredux-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.compose.multiplatform)
id("com.android.library")
alias(libs.plugins.dokka)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
4 changes: 4 additions & 0 deletions kredux-compose/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_ARTIFACT_ID=kredux-compose
POM_NAME=KRedux
POM_DESCRIPTION=Simple implementation of Redux in Kotlin
POM_PACKAGING=aar
1 change: 1 addition & 0 deletions kredux-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
kotlin("multiplatform")
alias(libs.plugins.dokka)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
4 changes: 4 additions & 0 deletions kredux-core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_ARTIFACT_ID=kredux-core
POM_NAME=KRedux
POM_DESCRIPTION=Simple implementation of Redux in Kotlin
POM_PACKAGING=jar
1 change: 1 addition & 0 deletions kredux-side-effect/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
kotlin("multiplatform")
alias(libs.plugins.dokka)
alias(libs.plugins.publish)
}

kotlin {
Expand Down
4 changes: 4 additions & 0 deletions kredux-side-effect/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_ARTIFACT_ID=kredux-side-effect
POM_NAME=KRedux
POM_DESCRIPTION=Simple implementation of Redux in Kotlin
POM_PACKAGING=jar

0 comments on commit 0ff66fc

Please sign in to comment.