Skip to content

Commit

Permalink
Merge pull request #32 from icerockdev/develop
Browse files Browse the repository at this point in the history
mavenCentral release
  • Loading branch information
Alex009 authored Jul 8, 2021
2 parents f2b3d88 + 49b4bac commit 45515b8
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 7 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create release

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
default: '0.1.0'
required: true

jobs:
publish:
name: Publish library at mavenCentral
runs-on: macos-latest
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_KEY: ${{ secrets.OSSRH_KEY }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Publish
run: ./gradlew publish
release:
name: Create release
needs: publish
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ github.ref }}
tag_name: release/${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body: "Will be filled later"
draft: true
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ Handlebars) and configuration.

`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/icerockdev/shaper/master/install-shaper.sh)"`

## Core library
```kotlin
repositories {
mavenCentral()
}

dependencies {
implementation("dev.icerock.tools:shaper-core:0.4.0")
}
```

# Usage

## CLI
Expand Down
14 changes: 14 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
google()

gradlePluginPortal()
}

dependencies {
api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20")
}
17 changes: 17 additions & 0 deletions build-logic/src/main/kotlin/jvm-publication-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("java")
id("org.gradle.maven-publish")
}

java {
withJavadocJar()
withSourcesJar()
}

publishing.publications.register("mavenJava", MavenPublication::class) {
from(components["java"])
}
79 changes: 79 additions & 0 deletions build-logic/src/main/kotlin/publication-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

import java.util.Base64

plugins {
id("org.gradle.maven-publish")
id("signing")
}

publishing {
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
name = "OSSRH"

credentials {
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_KEY")
}
}

publications.withType<MavenPublication> {
// Provide artifacts information requited by Maven Central
pom {
name.set("Shaper")
description.set("File structure generation tool from templates on Handlebars")
url.set("https://github.com/icerockdev/shaper")
licenses {
license {
name.set("Apache-2.0")
distribution.set("repo")
url.set("https://github.com/icerockdev/shaper/blob/master/LICENSE.md")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("[email protected]")
}
developer {
id.set("oyakovlev")
name.set("Oleg Yakovlev")
email.set("[email protected]")
}
developer {
id.set("ATchernov")
name.set("Andrey Tchernov")
email.set("[email protected]")
}
developer {
id.set("RezMike")
name.set("Mikhail Reznichenko")
email.set("[email protected]")
}
}

scm {
connection.set("scm:git:ssh://github.com/icerockdev/shaper.git")
developerConnection.set("scm:git:ssh://github.com/icerockdev/shaper.git")
url.set("https://github.com/icerockdev/shaper")
}
}
}
}


signing {
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
String(Base64.getDecoder().decode(base64Key))
}
if (signingKeyId != null) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publishing.publications)
}
}
18 changes: 14 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.31" apply false
/*
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

buildscript {
repositories {
mavenCentral()
google()

gradlePluginPortal()
}
dependencies {
classpath(":build-logic")
}
}

subprojects {
group = "dev.icerock.tools"
version = "0.4.0"

apply(plugin = "org.jetbrains.kotlin.jvm")
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 6 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/*
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

rootProject.name = "shaper"

dependencyResolutionManagement {
repositories {
mavenCentral()

maven { url = uri("https://kotlin.bintray.com/kotlinx") }
}
}

includeBuild("build-logic")

include("shaper-core")
include("shaper-cli")
1 change: 1 addition & 0 deletions shaper-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

plugins {
id("org.jetbrains.kotlin.jvm")
id("application")
}

Expand Down
6 changes: 6 additions & 0 deletions shaper-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("org.jetbrains.kotlin.jvm")
id("publication-convention")
id("jvm-publication-convention")
}

dependencies {
implementation("com.github.jknack:handlebars:4.2.0")
implementation("org.yaml:snakeyaml:1.21")
Expand Down

0 comments on commit 45515b8

Please sign in to comment.