Skip to content

Commit

Permalink
Prepare for some publication
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberdelia committed Dec 30, 2019
1 parent 0ca2cdc commit d1a1586
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish
on:
release:
types: [published]
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- name: Checkout latest code
uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
# So if we split on '/' and take the 3rd value, we can get the release name.
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
./gradlew -Pversion=${NEW_VERSION} publish
30 changes: 29 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.61"
kotlin("jvm") version "1.3.61"
`java-library`
`maven-publish`

id("org.jmailen.kotlinter") version "2.2.0"
id("org.jetbrains.dokka") version "0.10.0"
}

group = "com.lapanthere"

repositories {
jcenter()
}
Expand All @@ -31,10 +36,33 @@ dependencies {
testImplementation("io.mockk:mockk:1.9.3")
}

publishing {
repositories {
maven {
name = "Github"
url = uri("https://maven.pkg.github.com/cyberdelia/signals")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}

publications {
create<MavenPublication>("default") {
from(components["java"])
}
}
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}

tasks.withType<DokkaTask> {
outputFormat = "gfm"
}

kotlinter {
disabledRules = arrayOf("import-ordering")
}

0 comments on commit d1a1586

Please sign in to comment.