Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: publish

on:
workflow_dispatch:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

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

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true

- name: Verify build
run: ./gradlew check

- name: Extract version from tag
id: extract_version
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Publish to Maven Central
env:
ORG_GRADLE_PROJECT_version: ${{ steps.extract_version.outputs.VERSION }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
./gradlew publishAndReleaseToMavenCentral --no-parallel --no-configuration-cache
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.vanniktech.maven.publish) apply false
}
10 changes: 7 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[versions]
kotlin = "2.1.0"
ksp = "2.2.21-2.0.5"
ksp-plugin = "2.1.0-1.0.29"
kotlin = "2.2.0"
ksp = "2.3.6"
ksp-plugin = "2.3.6"
assertj = "3.27.3"
dokka = "2.1.0"
junit-jupiter = "5.11.4"
kotlinpoet = "2.2.0"
vanniktech-maven-publish = "0.36.0"

[libraries]
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
Expand All @@ -17,5 +19,7 @@ junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "jun
kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }

[plugins]
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-plugin" }
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-maven-publish" }
59 changes: 59 additions & 0 deletions ksp-test-fixtures/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SourcesJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("jvm")
alias(libs.plugins.dokka)
alias(libs.plugins.ksp)
alias(libs.plugins.vanniktech.maven.publish)
}

group = "com.faire.ksp-reflection-testing"
Expand Down Expand Up @@ -50,3 +56,56 @@ dependencies {
testImplementation(libs.assertj)
testImplementation(libs.junit.jupiter)
}

extensions.configure<MavenPublishBaseExtension> {
configure(
KotlinJvm(
javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"),
sourcesJar = SourcesJar.Sources()
)
)

publishToMavenCentral(automaticRelease = true)
signAllPublications()

pom {
name.set("${project.group}:${project.name}")
description.set(
"""
Reflection-based test harness for KSP
""".trimIndent()
)
url.set("https://github.com/faire/ksp-reflection-testing")

licenses {
license {
name.set("MIT License")
url.set("https://github.com/faire/ksp-reflection-testing/blob/main/LICENSE")
}
}

developers {
developer {
id.set("james")
name.set("James Oliver")
email.set("james.oliver@faire.com")
}
developer {
id.set("luan")
name.set("Luan Nico")
email.set("luan@faire.com")
}
developer {
id.set("quinn")
name.set("Quinn Budan")
email.set("quinn.budan@faire.com")
}
}

scm {
connection.set("scm:git:https://github.com/faire/ksp-reflection-testing.git")
developerConnection.set("scm:git:git@github.com:faire/ksp-reflection-testing.git")
url.set("https://github.com/faire/ksp-reflection-testing")
}
}
}