Skip to content

Commit

Permalink
Merge branch 'main' into twyatt/gradle-config
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrickcooke authored Feb 28, 2024
2 parents 648a3df + 0463e9d commit 4b53674
Show file tree
Hide file tree
Showing 13 changed files with 170 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://help.github.com/articles/about-codeowners/

* @JuulLabs/conx-kotlin-reviewers @cedrickcooke @twyatt
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
pull_request:
# Trigger on merges to `main` to allow `gradle/gradle-build-action` runs to write their caches.
# https://github.com/gradle/gradle-build-action#using-the-caches-read-only
push:
branches:
- main

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble check jacocoTestReport

- uses: codecov/codecov-action@v4

- name: publishToMavenLocal
uses: gradle/gradle-build-action@v2
with:
arguments: |
-PRELEASE_SIGNING_ENABLED=false
publishToMavenLocal
26 changes: 26 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Documentation
on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: dokkaHtmlMultiModule
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true
arguments: dokkaHtmlMultiModule

- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/dokkaHtmlMultiModule
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish
on:
release:
types:
- published

jobs:
publish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: check
uses: gradle/gradle-build-action@v2
with:
arguments: check

- name: publish
uses: gradle/gradle-build-action@v2
with:
arguments: |
-PVERSION_NAME=${{ github.ref_name }}
-PsigningInMemoryKey=${{ secrets.SIGNING_KEY }}
-PsigningInMemoryKeyPassword=${{ secrets.SIGNING_PASSWORD }}
-PmavenCentralUsername=${{ secrets.OSS_SONATYPE_NEXUS_USERNAME }}
-PmavenCentralPassword=${{ secrets.OSS_SONATYPE_NEXUS_PASSWORD }}
publish
18 changes: 18 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Drafter
# https://github.com/release-drafter/release-drafter#usage

on:
push:
branches:
- main

jobs:
update-release-draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/signing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Validate Maven Signing
on:
push:
branches:
- main

jobs:
signing:
if: github.repository_owner == 'JuulLabs'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: publishToMavenLocal
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true
arguments: |
-PsigningInMemoryKey=${{ secrets.SIGNING_KEY }}
-PsigningInMemoryKeyPassword=${{ secrets.SIGNING_PASSWORD }}
publishToMavenLocal
13 changes: 13 additions & 0 deletions .github/workflows/version-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Version Labels
on:
pull_request:
types: [opened, labeled, unlabeled, synchronize]
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
labels: "patch, minor, major, maintenance, renovate"
19 changes: 18 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,31 @@ allprojects {
}

withPluginWhenEvaluated("jacoco") {
tasks.register<JacocoReport>("jacocoTestReport") {
group = "Verification"
description = "Generate JaCoCo test coverage report"

reports {
csv.required.set(false)
html.required.set(true)
xml.required.set(true)
}

classDirectories.setFrom(layout.buildDirectory.file("classes/kotlin/jvm/main"))
sourceDirectories.setFrom(layout.projectDirectory.files("src/commonMain", "src/jvmMain"))
executionData.setFrom(layout.buildDirectory.file("jacoco/jvmTest.exec"))

dependsOn("jvmTest")
}

configure<JacocoPluginExtension> {
toolVersion = libs.versions.jacoco.get()
}
}
}

tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(buildDir.resolve("gh-pages"))
outputDirectory.fileProvider(layout.buildDirectory.file("gh-pages").map { it.asFile })
}

fun Project.withPluginWhenEvaluated(plugin: String, action: Project.() -> Unit) {
Expand Down
13 changes: 0 additions & 13 deletions gradle/jacoco.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kotlin = "1.9.22"
ktor = "2.3.8"

[libraries]
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version = "1.7.3" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version = "1.8.0" }
ktor-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" }
ktor-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" }
Expand Down
2 changes: 0 additions & 2 deletions khronicle-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {
id("com.vanniktech.maven.publish")
}

apply(from = rootProject.file("gradle/jacoco.gradle.kts"))

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())
Expand Down
2 changes: 0 additions & 2 deletions khronicle-ktor-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {
id("com.vanniktech.maven.publish")
}

apply(from = rootProject.file("gradle/jacoco.gradle.kts"))

kotlin {
explicitApi()
jvmToolchain(libs.versions.jvm.toolchain.get().toInt())
Expand Down

0 comments on commit 4b53674

Please sign in to comment.