Skip to content

Commit

Permalink
Build: fix publication.
Browse files Browse the repository at this point in the history
  • Loading branch information
driessamyn committed Jan 31, 2025
1 parent 509d88f commit 95c3eae
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 20 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/mc-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@ jobs:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Show changes
run: git status
- name: History
run: git --no-pager log -n 100 --oneline
- name: Tags
run: git show-ref --tags
- name: Print version
run: ./gradlew printSemVersion --info
# TODO: remove the noDirtyCheck property once figured out why this thinks the working directory is dirty
- name: Print version (no dirty check)
run: ./gradlew -PnoDirtyCheck=true printSemVersion --info
- name: Publish package
run: ./gradlew deployCentralPortal
run: ./gradlew -PnoDirtyCheck=true deployCentralPortal
13 changes: 12 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
// alias(libs.plugins.git.semver)
kotlin("jvm")
id("org.jetbrains.kotlinx.kover")
alias(libs.plugins.sonar)
alias(libs.plugins.git.semver)
}

repositories {
Expand All @@ -14,6 +14,17 @@ dependencies {
kover(project(":kapper-coroutines"))
}

semver {
changeLogFormat = git.semver.plugin.changelog.ChangeLogFormat.defaultChangeLog
releasePattern = "\\\\ABuild: release(?:\\\\([^()]+\\\\))?:"
}

val projectVersion = semver.version
subprojects {
group = "net.samyn"
version = projectVersion
}

tasks.build {
dependsOn(":koverHtmlReport")
dependsOn(":koverXmlReport")
Expand Down
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies {
implementation(libs.deployer.plugin)
implementation(libs.dokka.plugin)
implementation(libs.dokka.javadoc.plugin)
implementation(libs.git.semver.plugin)
implementation(libs.ktlint.plugin)
implementation(libs.kotlin.jvm.plugin)
implementation(libs.kover.plugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ plugins {
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.dokka")
id("org.jetbrains.dokka-javadoc")
id("com.github.jmongard.git-semver-plugin")
}

repositories {
Expand Down Expand Up @@ -45,21 +44,13 @@ kover {
}
}

semver {
changeLogFormat = git.semver.plugin.changelog.ChangeLogFormat.defaultChangeLog
releasePattern = "\\Abuild: release(?:\\([^()]+\\))?:"
}

sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}

group = "net.samyn"
version = semver.version

tasks.jar {
manifest {
attributes(
Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/kapper.library-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ publishing {
from(components["kotlin"])
artifact(tasks["sourcesJar"])
artifact(tasks["dokkaJavadocJar"])
artifact(tasks["dokkaHtmlJar"])
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion create_release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash

# tag first
# Create a release commit first:
# git commit --allow-empty -m "build: release <version>"
# Then tag
# git tag <version>
# remember to push the tag
# git push origin <version>

tag=$(git describe --tags --abbrev=0)
version=$(./gradlew -q printVersion)
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[versions]
dokka = "2.0.0"
git-semver = "0.14.0"
junit-jupiter = "5.11.4"
kotest = "6.0.0.M1"
kotlin = "2.1.0"
Expand Down Expand Up @@ -32,7 +33,6 @@ test-containers-junit-postgresql = { module = "org.testcontainers:postgresql", v
deployer-plugin = { module = "io.deepmedia.tools.deployer:io.deepmedia.tools.deployer.gradle.plugin", version = "0.17.0" }
dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
dokka-javadoc-plugin = { module = "org.jetbrains.dokka-javadoc:org.jetbrains.dokka-javadoc.gradle.plugin", version.ref = "dokka" }
git-semver-plugin = { module = "com.github.jmongard:git-semver-plugin", version = "0.14.0" }
ktlint-plugin = { module = "org.jlleitschuh.gradle:ktlint-gradle", version = "12.1.2" }
kotlin-jvm-plugin = { module = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin", version.ref = "kotlin" }
kover-plugin = { module = "org.jetbrains.kotlinx:kover-gradle-plugin", version = "0.9.1" }
Expand All @@ -44,6 +44,8 @@ test-dbs = ["mysql-driver", "postgresql-driver"]

[plugins]
sonar = { id = "org.sonarqube", version = "6.0.1.5171" }
git-semver = { id = "com.github.jmongard.git-semver-plugin", version.ref = "git-semver" }




0 comments on commit 95c3eae

Please sign in to comment.