File tree Expand file tree Collapse file tree
RemotelyMod/build-logic/src/main/kotlin/redxax/remotelymod/buildlogic Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,15 +99,17 @@ jobs:
9999 chmod +x gradlew
100100 goal="${{ inputs.goal }}"
101101 confirm="${{ inputs.publish_confirm }}"
102+ publish_task=""
102103 echo "workflow goal=$goal publish_confirm=$confirm"
103104 if [[ "$confirm" == "PUBLISH" && "$goal" == "buildAllVersions" ]]; then
104- echo "publish_confirm=PUBLISH — running publishAllVersionsToModrinth after build."
105- goal="publishAllVersionsToModrinth"
105+ publish_task="publishAllVersionsToModrinth"
106+ elif [[ "$goal" == publish* ]]; then
107+ publish_task="$goal"
106108 fi
107- if [[ "$goal" == "buildAllVersions" ]]; then
109+ if [[ -n "$publish_task" ]]; then
110+ echo "Building all versions, then $publish_task (separate Gradle runs)."
108111 ./gradlew buildAllVersions --no-daemon --stacktrace
109- elif [[ "$goal" == publish* ]]; then
110- ./gradlew buildAllVersions "$goal" --no-daemon --stacktrace
112+ ./gradlew "$publish_task" --no-daemon --stacktrace
111113 else
112114 ./gradlew "$goal" --no-daemon --stacktrace
113115 fi
Original file line number Diff line number Diff line change @@ -435,14 +435,8 @@ private fun Project.publishingProperties(): Properties {
435435 }
436436}
437437
438- private fun Project.publishingArtifact () = rootProject.layout.buildDirectory.file(" versions/Remotely-${modVersion()} +$name .jar" ).also { artifact ->
439- gradle.taskGraph.whenReady {
440- val file = artifact.get().asFile
441- if (! file.isFile) {
442- throw GradleException (" Publishing artifact is missing: ${file.absolutePath} . Run buildAllVersions before publishing." )
443- }
444- }
445- }
438+ private fun Project.publishingArtifact () =
439+ rootProject.layout.buildDirectory.file(" versions/Remotely-${modVersion()} +$name .jar" )
446440
447441private fun Project.loaderDisplayName (): String {
448442 return when (loader()) {
You can’t perform that action at this time.
0 commit comments