Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…rage-kt

# Conflicts:
#	jvmcredentials/build.gradle.kts
  • Loading branch information
y9vad9 committed Nov 6, 2023
2 parents 28948b6 + 923fa66 commit 6232397
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Gradle Publish Release

on:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'corretto'

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}

- name: Set Gradle executable permissions
run: chmod +x ./gradlew

- name: Build and Publish
env:
LIB_VERSION: ${{ github.ref_name }}
SSH_DEPLOY_PATH: ${{ secrets.SSH_DEPLOY_PATH }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
SSH_USER: ${{ secrets.SSH_USER }}
run: ./gradlew publish
1 change: 1 addition & 0 deletions build-conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ kotlin {
dependencies {
api(libs.kotlin.plugin)
api(libs.android.plugin)
api(libs.vanniktech.maven.publish)
}
2 changes: 0 additions & 2 deletions build-conventions/src/main/kotlin/jvm-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.dsl.*

plugins {
kotlin("jvm")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,66 @@ import org.jetbrains.kotlin.gradle.dsl.*

plugins {
id("multiplatform-convention")
id("com.vanniktech.maven.publish")
}

kotlin {
explicitApi = ExplicitApiMode.Strict
}

mavenPublishing {
pom {
url.set("https://github.com/timemates/credentials-storage-kt")
inceptionYear.set("2023")

licenses {
license {
name.set("The MIT License")
url.set("https://opensource.org/licenses/MIT")
distribution.set("https://opensource.org/licenses/MIT")
}
}

developers {
developer {
id.set("kotleni")
name.set("Viktor Varenik")
url.set("https://github.com/kotleni")
}

developer {
id.set("y9vad9")
name.set("Vadym Yaroshchuk")
url.set("https://github.com/y9vad9/")
}
}

scm {
url.set("https://github.com/timemates/credentials-storage-kt")
connection.set("scm:git:git://github.com/timemates/credentials-storage-kt.git")
developerConnection.set("scm:git:ssh://[email protected]/timemates/credentials-storage-kt.git")
}

issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/timemates/credentials-storage-kt/issues")
}
}
}

publishing {
repositories {
maven {
name = "TimeMates"

url = uri(
"sftp://${System.getenv("SSH_HOST")}:22/${System.getenv("SSH_DEPLOY_PATH")}"
)

credentials {
username = System.getenv("SSH_USER")
password = System.getenv("SSH_PASSWORD")
}
}
}
}
14 changes: 13 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
}

group = "com.timemates.credentials"
version = "1.0-SNAPSHOT"

kotlin {
sourceSets {
Expand Down Expand Up @@ -59,4 +58,17 @@ android {
isIncludeAndroidResources = true
}
}
}

mavenPublishing {
coordinates(
groupId = "io.timemates.credentials",
artifactId = "credentials-manager",
version = System.getenv("LIB_VERSION") ?: return@mavenPublishing,
)

pom {
name.set("CredentialsManager")
description.set("Multiplatform Kotlin library for storing key-value credentials.")
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ accompanist-systemUiController = { module = "com.google.accompanist:accompanist-
# Plugin classpaths
kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
android-plugin = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
vanniktech-maven-publish = { module = "com.vanniktech.maven.publish:com.vanniktech.maven.publish.gradle.plugin", version.require = "0.25.3" }

# Desktop
microsoft-credential-storage = { module = "com.microsoft:credential-secure-storage", version.require = "1.0.0" }
Expand Down

0 comments on commit 6232397

Please sign in to comment.