Skip to content

Commit

Permalink
Remake publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Com6235 committed Apr 28, 2024
1 parent 0662993 commit df2be4e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish package to the Github Pages
name: Publish package to the Github Packages
on:
push:
branches:
Expand Down
20 changes: 19 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,37 @@ kotlin {
jvmToolchain(21)
}

tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}

idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}

configurations {
create("javadoc")
}

val jdFile = layout.buildDirectory.file("libs/$name-$version-javadoc.jar")
val jdArtifact = artifacts.add("javadoc", jdFile.get().asFile) {
type = "jar"
builtBy("dokkaJavadocJar")
}

publishing {
publications {
create<MavenPublication>("maven") {
create<MavenPublication>("kotlin") {
from(components["kotlin"])
artifact(jdArtifact)
}
}

repositories {
maven {
name = "GitHubPackages"
Expand Down

0 comments on commit df2be4e

Please sign in to comment.