From aefda6a38159ef0ec4122615dc36fc96aa7e0445 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 1 Nov 2022 21:52:49 +0000 Subject: [PATCH] Fix a couple of issues with the release process Only way to test these is in prod, alas :D: --- build.gradle.kts | 4 +++- .../src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 5691dc3c0..5a8887360 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -364,7 +364,7 @@ val publishCurseForge by tasks.registering(TaskPublishCurseForge::class) { apiToken = findProperty("curseForgeApiKey") ?: "" enabled = apiToken != "" - val mainFile = upload("282001", tasks.shadowJar) + val mainFile = upload("282001", tasks.shadowJar.get().archiveFile) dependsOn(tasks.shadowJar) // Ughr. mainFile.changelog = "Release notes can be found on the [GitHub repository](https://github.com/cc-tweaked/CC-Tweaked/releases/tag/v$mcVersion-$modVersion)." mainFile.changelogType = "markdown" @@ -445,6 +445,8 @@ publishing { repositories { maven("https://squiddev.cc/maven") { name = "SquidDev" + + credentials(PasswordCredentials::class) } } } diff --git a/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt b/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt index 51bc297ad..e87d3acab 100644 --- a/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt +++ b/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt @@ -26,12 +26,12 @@ abstract class CCTweakedExtension( ) { /** Get the hash of the latest git commit. */ val gitHash: Provider = gitProvider(project, "") { - ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "HEAD") + ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "HEAD").trim() } /** Get the current git branch. */ val gitBranch: Provider = gitProvider(project, "") { - ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "--abbrev-ref", "HEAD") + ProcessHelpers.captureOut("git", "-C", project.projectDir.absolutePath, "rev-parse", "--abbrev-ref", "HEAD").trim() } /** Get a list of all contributors to the project. */