Skip to content

Commit

Permalink
Publish to BlueColored Maven Repo
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Apr 3, 2024
1 parent e7e3230 commit baeef59
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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:
bluecoloredUsername: ${{ secrets.BLUECOLORED_USERNAME }}
bluecoloredPassword: ${{ secrets.BLUECOLORED_PASSWORD }}
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand All @@ -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(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
Expand Down

0 comments on commit baeef59

Please sign in to comment.