Skip to content

Commit

Permalink
Publish BlueMapCore and BlueMapCommon to BlueColored repo
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Apr 4, 2024
1 parent ee3ab6f commit f097517
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 141 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
with:
distribution: 'temurin'
java-version: |
11
16
17
cache: 'gradle'
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Publish
name: Build

on:
workflow_dispatch:
push:
tags:
- "**"

jobs:
publish:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -16,12 +19,11 @@ jobs:
with:
distribution: 'temurin'
java-version: |
11
16
17
cache: 'gradle'
- name: Build with Gradle
run: ./gradlew clean :BlueMapCore:publish :BlueMapCommon:publish
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew publish
BLUECOLORED_USERNAME: ${{ secrets.BLUECOLORED_USERNAME }}
BLUECOLORED_PASSWORD: ${{ secrets.BLUECOLORED_PASSWORD }}
2 changes: 1 addition & 1 deletion BlueMapAPI
35 changes: 26 additions & 9 deletions BlueMapCommon/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ plugins {
id ("com.github.node-gradle.node") version "3.5.0"
}

group = "de.bluecolored.bluemap.common"
version = "0.0.0"
group = "de.bluecolored.bluemap"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
val lastVersion = System.getProperty("bluemap.lastVersion") ?: "?" // set by BlueMapCore

val javaTarget = 16
java {
Expand All @@ -20,17 +21,13 @@ java {

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
maven ("https://libraries.minecraft.net")
maven ("https://repo.bluecolored.de/releases")
}

dependencies {
api ("com.mojang:brigadier:1.0.17")
api ("de.bluecolored.bluemap.core:BlueMapCore")
api ("de.bluecolored.bluemap:BlueMapCore")

compileOnly ("org.jetbrains:annotations:16.0.2")
compileOnly ("org.projectlombok:lombok:1.18.30")
Expand Down Expand Up @@ -102,13 +99,33 @@ 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()
artifactId = project.name
version = project.version.toString()

from(components["java"])

versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
}
}
}
}
31 changes: 25 additions & 6 deletions BlueMapCore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ val lastVersion = if (lastTag.isEmpty()) "dev" else lastTag.substring(1) // remo
val commits = "git rev-list --count $lastTag..HEAD".runCommand()
println("Git hash: $gitHash" + if (clean) "" else " (dirty)")

group = "de.bluecolored.bluemap.core"
group = "de.bluecolored.bluemap"
version = lastVersion +
(if (commits == "0") "" else "-$commits") +
(if (clean) "" else "-dirty")

System.setProperty("bluemap.version", version.toString())
System.setProperty("bluemap.lastVersion", lastVersion)
println("Version: $version")

val javaTarget = 16
Expand All @@ -54,9 +55,7 @@ java {

repositories {
mavenCentral()
maven {
setUrl("https://jitpack.io")
}
maven ("https://repo.bluecolored.de/releases")
}

@Suppress("GradlePackageUpdate")
Expand All @@ -66,12 +65,12 @@ dependencies {
api ("commons-io:commons-io:2.5")
api ("org.spongepowered:configurate-hocon:4.1.2")
api ("org.spongepowered:configurate-gson:4.1.2")
api ("com.github.BlueMap-Minecraft:BlueNBT:v1.3.0")
api ("de.bluecolored.bluenbt:BlueNBT:2.2.1")
api ("org.apache.commons:commons-dbcp2:2.9.0")
api ("io.airlift:aircompressor:0.24")
api ("org.lz4:lz4-java:1.8.0")

api ("de.bluecolored.bluemap.api:BlueMapAPI")
api ("de.bluecolored.bluemap:BlueMapAPI")

compileOnly ("org.jetbrains:annotations:23.0.0")
compileOnly ("org.projectlombok:lombok:1.18.30")
Expand Down Expand Up @@ -152,13 +151,33 @@ 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()
artifactId = project.name
version = project.version.toString()

from(components["java"])

versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
}
}
}
}
12 changes: 4 additions & 8 deletions implementations/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id ("com.github.johnrengelman.shadow") version "7.1.2"
}

group = "de.bluecolored.bluemap.cli"
group = "de.bluecolored.bluemap"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore

val javaTarget = 16
Expand All @@ -17,16 +17,12 @@ java {

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
maven ("https://libraries.minecraft.net")
maven ("https://repo.bluecolored.de/releases")
}

dependencies {
api ("de.bluecolored.bluemap.common:BlueMapCommon")
api ("de.bluecolored.bluemap:BlueMapCommon")

@Suppress("GradlePackageUpdate")
implementation ("commons-cli:commons-cli:1.5.0")
Expand Down
20 changes: 6 additions & 14 deletions implementations/fabric-1.18/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
id ("com.matthewprenger.cursegradle") version "1.4.0"
}

group = "de.bluecolored.bluemap.fabric"
group = "de.bluecolored.bluemap"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore

val javaTarget = 17
Expand All @@ -28,18 +28,10 @@ java {

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
maven {
setUrl("https://maven.fabricmc.net/")
}
maven {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
}
maven ("https://libraries.minecraft.net")
maven ("https://maven.fabricmc.net/")
maven ("https://oss.sonatype.org/content/repositories/snapshots")
maven ("https://repo.bluecolored.de/releases")
}

val shadowInclude: Configuration by configurations.creating
Expand All @@ -49,7 +41,7 @@ configurations {
}

dependencies {
shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
shadowInclude ("de.bluecolored.bluemap:BlueMapCommon") {
//exclude dependencies provided by fabric
exclude (group = "com.google.guava", module = "guava")
exclude (group = "com.google.code.gson", module = "gson")
Expand Down
20 changes: 6 additions & 14 deletions implementations/fabric-1.19.4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
id ("com.matthewprenger.cursegradle") version "1.4.0"
}

group = "de.bluecolored.bluemap.fabric"
group = "de.bluecolored.bluemap"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore

val javaTarget = 17
Expand All @@ -28,18 +28,10 @@ java {

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
maven {
setUrl("https://maven.fabricmc.net/")
}
maven {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
}
maven ("https://libraries.minecraft.net")
maven ("https://maven.fabricmc.net/")
maven ("https://oss.sonatype.org/content/repositories/snapshots")
maven ("https://repo.bluecolored.de/releases")
}

val shadowInclude: Configuration by configurations.creating
Expand All @@ -49,7 +41,7 @@ configurations {
}

dependencies {
shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
shadowInclude ("de.bluecolored.bluemap:BlueMapCommon") {
//exclude dependencies provided by fabric
exclude (group = "com.google.guava", module = "guava")
exclude (group = "com.google.code.gson", module = "gson")
Expand Down
20 changes: 6 additions & 14 deletions implementations/fabric-1.20/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
id ("com.matthewprenger.cursegradle") version "1.4.0"
}

group = "de.bluecolored.bluemap.fabric"
group = "de.bluecolored.bluemap"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore

val javaTarget = 17
Expand All @@ -28,18 +28,10 @@ java {

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
maven {
setUrl("https://maven.fabricmc.net/")
}
maven {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
}
maven ("https://libraries.minecraft.net")
maven ("https://maven.fabricmc.net/")
maven ("https://oss.sonatype.org/content/repositories/snapshots")
maven ("https://repo.bluecolored.de/releases")
}

val shadowInclude: Configuration by configurations.creating
Expand All @@ -49,7 +41,7 @@ configurations {
}

dependencies {
shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
shadowInclude ("de.bluecolored.bluemap:BlueMapCommon") {
//exclude dependencies provided by fabric
exclude (group = "com.google.guava", module = "guava")
exclude (group = "com.google.code.gson", module = "gson")
Expand Down
12 changes: 4 additions & 8 deletions implementations/forge-1.18.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {

apply plugin: "net.minecraftforge.gradle"

group = "de.bluecolored.bluemap.forge"
group = "de.bluecolored.bluemap"
version = System.getProperty("bluemap.version") ?: "?" // set by BlueMapCore
archivesBaseName = 'bluemap'

Expand Down Expand Up @@ -53,12 +53,8 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
mavenCentral()
maven {
setUrl("https://libraries.minecraft.net")
}
maven {
setUrl("https://jitpack.io")
}
maven { url = "https://libraries.minecraft.net" }
maven { url = "https://repo.bluecolored.de/releases" }
}

configurations {
Expand All @@ -68,7 +64,7 @@ configurations {
dependencies {
minecraft 'net.minecraftforge:forge:1.18.1-39.0.19'

shadowInclude ("de.bluecolored.bluemap.common:BlueMapCommon") {
shadowInclude ("de.bluecolored.bluemap:BlueMapCommon") {
//exclude dependencies provided by forge
exclude (group: "com.google.guava", module: "guava")
exclude (group: "com.google.code.gson", module: "gson")
Expand Down
Loading

0 comments on commit f097517

Please sign in to comment.