diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a69029e6..15ae91e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew - name: build - run: ./gradlew build --stacktrace + run: ./gradlew build - name: capture build artifacts if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS uses: actions/upload-artifact@v3 diff --git a/buildSrc/src/main/kotlin/shared.conventions.gradle.kts b/buildSrc/src/main/kotlin/shared.conventions.gradle.kts index d231f3c7..68cb0f0a 100644 --- a/buildSrc/src/main/kotlin/shared.conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/shared.conventions.gradle.kts @@ -77,26 +77,32 @@ tasks.withType().configureEach { // enabled = false //} -publishing { - repositories { - maven { - name = "Local" - url = uri("file://" + findProperty("local_maven")) - } - maven { - name = "Maven" - url = findProperty("mavenUrl")?.let { uri(it) }!! - credentials(PasswordCredentials::class) { - username = findProperty("mavenUsername")?.toString() - password = findProperty("mavenPassword")?.toString() +if (hasProperty("publisher")) { + publishing { + repositories { + maven { + name = "Local" + url = uri("file://" + findProperty("local_maven")) } - } - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/dhyces/trimmed") - credentials { - username = (project.findProperty("gpr.user") ?: System.getenv("USERNAME")) as String - password = (project.findProperty("gpr.key") ?: System.getenv("TOKEN")) as String + if (hasProperty("mavenUrl")) { + maven { + name = "Maven" + url = findProperty("mavenUrl")?.let { uri(it) }!! + credentials(PasswordCredentials::class) { + username = findProperty("mavenUsername")?.toString() + password = findProperty("mavenPassword")?.toString() + } + } + } + if (hasProperty("trimmedGithubPackages")) { + maven { + name = "GitHubPackages" + url = uri(findProperty("trimmedGithubPackages")?.let { uri(it) }!!) + credentials { + username = (project.findProperty("gpr.user") ?: System.getenv("USERNAME")) as String + password = (project.findProperty("gpr.key") ?: System.getenv("TOKEN")) as String + } + } } } }