From baeef5994ea4e7c0b9e218fb6c11b9a85d62fd54 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Wed, 3 Apr 2024 22:45:31 +0200 Subject: [PATCH] Publish to BlueColored Maven Repo --- .github/workflows/gradle.yml | 2 +- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ build.gradle.kts | 16 ++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2a470da..52c86bb 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ca09d7f --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} diff --git a/build.gradle.kts b/build.gradle.kts index e9ff6c0..2aa98f8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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(PasswordCredentials::class) + authentication { + create("basic") + } + } + } publications { create("maven") { groupId = project.group.toString()