Skip to content

Commit

Permalink
Publish to BlueColored repo
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Apr 4, 2024
1 parent 87ec6cd commit a636f39
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Java CI

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # needed for versioning
- name: Set up Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build with Gradle
run: ./gradlew clean publish
env:
BLUECOLORED_USERNAME: ${{ secrets.BLUECOLORED_USERNAME }}
BLUECOLORED_PASSWORD: ${{ secrets.BLUECOLORED_PASSWORD }}
22 changes: 21 additions & 1 deletion bluecommands-brigadier/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repositories {
}

dependencies {
implementation ( project(":bluecommands-core") )
api ( project(":bluecommands-core") )
implementation ("com.mojang:brigadier:1.0.17")

compileOnly ("org.jetbrains:annotations:24.0.1")
Expand Down Expand Up @@ -114,13 +114,33 @@ tasks.javadoc {
}

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")
}
}
}
}
}
14 changes: 14 additions & 0 deletions bluecommands-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ tasks.javadoc {
}

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()
Expand Down

0 comments on commit a636f39

Please sign in to comment.