From 84ace2a6a36b33c4756fa778c7df28e8baa20721 Mon Sep 17 00:00:00 2001 From: Rhys <98863820+rhysdh540@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:03:22 -0400 Subject: [PATCH] skill issue fixes --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ .gitignore | 11 ++++++----- build.gradle.kts | 23 ++++++++++++----------- gradle.properties | 7 +------ 4 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..fa53c42c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: build +on: [ workflow_dispatch, push, pull_request ] + +jobs: + build: + if: !contains(github.event.head_commit.message, '[skip]') + runs-on: ubuntu-20.04 + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: setup java + uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: 17 + + - name: setup gradle + uses: gradle/gradle-build-action@v2.4.2 + with: + cache-read-only: false + + - name: do the build + run: ./gradlew assemble + continue-on-error: true + + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: interiors-artifacts #-v${{ github.run_number }} <-- doesnt work with nightly.link + path: | + */build/libs/*.jar \ No newline at end of file diff --git a/.gitignore b/.gitignore index ef1a98f2..1907012b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -.idea -build -.gradle -run +.idea/ +build/ +.gradle/ +run/ .DS_Store -src/main/resources/assets/create +src/main/resources/assets/create/ +.architectury-transformer/ diff --git a/build.gradle.kts b/build.gradle.kts index c9420be9..d41f1296 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,8 +13,8 @@ import java.util.zip.Deflater plugins { java - id("architectury-plugin") version "3.4-SNAPSHOT" apply false - id("dev.architectury.loom") version "1.4.+" apply false + id("architectury-plugin") version "3.4.155" apply false + id("dev.architectury.loom") version "1.4.380" apply false id("com.github.johnrengelman.shadow") version "8.1.1" apply false } @@ -29,9 +29,7 @@ val isRelease = System.getenv("RELEASE_BUILD")?.toBoolean() ?: false val buildNumber = System.getenv("GITHUB_RUN_NUMBER")?.toInt() val gitHash = "\"${calculateGitHash() + (if (hasUnstaged()) "-modified" else "")}\"" -tasks.jar { - enabled = false -} +tasks.jar { enabled = false } allprojects { apply(plugin = "java") @@ -44,14 +42,17 @@ allprojects { // example: 1.0.0+fabric-1.19.2-build.100 (or -local) val build = buildNumber?.let { "-build.${it}" } ?: "-local" - version = "${"mod_version"()}+${project.name}-mc${"minecraft_version"() + if (isRelease) "" else build}" + version = "${"mod_version"()}+${project.name}-mc${"minecraft_version"()}${if (isRelease) "" else build}" tasks.withType().configureEach { + options.release = 17 options.encoding = "UTF-8" } java { withSourcesJar() + targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 } } @@ -110,7 +111,7 @@ subprojects { dependsOn(shadowJar) archiveClassifier = null doLast { - squishJar(outputs.files.singleFile) + squishJar(archiveFile.get().asFile) } } @@ -148,9 +149,9 @@ subprojects { "minecraft_version" to "minecraft_version"(), "fabric_api_version" to "fabric_api_version"(), "fabric_loader_version" to "fabric_loader_version"(), - "forge_version" to "forge_version"().split(".")[0], // only specify major version of forge - "create_forge_version" to "create_forge_version"().split("-")[0], // cut off build number - "create_fabric_version" to "create_fabric_version"().split("+")[0] // Trim +mcX.XX.X from version string + "forge_version" to "forge_version"().substringBefore("."), // only specify major version of forge + "create_forge_version" to "create_forge_version"().substringBefore("-"), // cut off build number + "create_fabric_version" to "create_fabric_version"().substringBefore("+") // Trim +mcX.XX.X from version string ) inputs.properties(properties) @@ -200,7 +201,7 @@ fun squishJar(jar: File) { JarOutputStream(jar.outputStream()).use { out -> out.setLevel(Deflater.BEST_COMPRESSION) contents.forEach { var (name, data) = it - if(name.startsWith("architectury_inject_${project.name}_common")) + if(name.startsWith("architectury_inject_")) return@forEach if (name.endsWith(".json") || name.endsWith(".mcmeta")) { diff --git a/gradle.properties b/gradle.properties index 2f8c6a08..4b69f1f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,14 +7,9 @@ org.gradle.caching = true fabric.loom.disableProjectDependentMods = true fabric.loom.multiProjectOptimisation = true -## Gradle Plugins -arch_plugin_version = 3.4.151 -loom_version = 1.4.380 -shadow_version = 8.1.1 - ## Mod Info archives_base_name = interiors -mod_version=0.5.2 +mod_version=0.5.3 maven_group = com.sudolev mixin_extras_version = 0.3.5