Compare commits

...

5 Commits

Author SHA1 Message Date
Lukas Rieger (Blue) 030f29e7f3
Change project group 2024-04-03 23:02:41 +02:00
Lukas Rieger (Blue) f5709ce836
Fix credentials problems 2024-04-03 22:55:28 +02:00
Lukas Rieger (Blue) 9d37bdeb15
Fix workflow syntax 2024-04-03 22:46:53 +02:00
Lukas Rieger (Blue) baeef5994e
Publish to BlueColored Maven Repo 2024-04-03 22:45:31 +02:00
Lukas Rieger (Blue) e7e32301f2
Require Java 16 2024-04-03 21:58:13 +02:00
3 changed files with 45 additions and 3 deletions

View File

@ -14,7 +14,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 16
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew clean build test

26
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Publish
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # needed for versioning
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 16
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew publish
env:
BLUECOLORED_USERNAME: ${{ secrets.BLUECOLORED_USERNAME }}
BLUECOLORED_PASSWORD: ${{ secrets.BLUECOLORED_PASSWORD }}

View File

@ -33,14 +33,14 @@ val lastVersion = lastTag.substring(1) // remove the leading 'v'
val commits = "git rev-list --count $lastTag..HEAD".runCommand()
println("Git hash: $gitHash" + if (clean) "" else " (dirty)")
group = "de.bluecolored.bluemap.api"
group = "de.bluecolored.bluemap"
version = lastVersion +
(if (commits == "0") "" else "-$commits") +
(if (clean) "" else "-dirty")
println("Version: $version")
val javaTarget = 11
val javaTarget = 16
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
@ -89,6 +89,8 @@ tasks.javadoc {
"https://javadoc.io/doc/com.flowpowered/flow-math/1.0.3/",
"https://javadoc.io/doc/com.google.code.gson/gson/2.8.0/",
)
if (JavaVersion.current().isJava9Compatible)
addBooleanOption("html5", true)
}
}
}
@ -106,6 +108,20 @@ tasks.processResources {
}
publishing {
repositories {
maven {
name = "bluecolored"
val releasesRepoUrl = "https://repo.bluecolored.de/releases"
val snapshotsRepoUrl = "https://repo.bluecolored.de/snapshots"
url = uri(if (version == lastVersion) releasesRepoUrl else snapshotsRepoUrl)
credentials {
username = project.findProperty("bluecoloredUsername") as String? ?: System.getenv("BLUECOLORED_USERNAME")
password = project.findProperty("bluecoloredPassword") as String? ?: System.getenv("BLUECOLORED_PASSWORD")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()