From fd989a7686904e69bff72e0c423dc3c62e159b81 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Wed, 13 Sep 2023 13:56:40 +0200 Subject: [PATCH] Build: Enable GitHub Actions based CI Also removes 1.15 because of a bug in archloom ([1]). Diff between 1.16.2-forge before and after the removal shows no significant changes. [1]: https://github.com/architectury/architectury-loom/issues/151 GitHub: #55 --- .github/workflows/main.yml | 66 +++++++++++++++++++ root.gradle.kts | 4 +- settings.gradle.kts | 1 - .../{1.15.2-1.12.2.txt => 1.16.2-1.12.2.txt} | 17 ++--- versions/1.16.2-1.15.2.txt | 4 -- 5 files changed, 73 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/main.yml rename versions/{1.15.2-1.12.2.txt => 1.16.2-1.12.2.txt} (85%) delete mode 100644 versions/1.16.2-1.15.2.txt diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d45d797 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,66 @@ +name: Build & Publish + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + env: + ORG_GRADLE_PROJECT_branch: ${{ github.head_ref || github.ref_name }} + steps: + - uses: actions/checkout@v1 + + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: | + 8 + 16 + 17 + + # Can't use setup-java for this because https://github.com/actions/setup-java/issues/366 + - uses: actions/cache@v3 + with: + path: ~/.gradle/wrapper + key: gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }} + - uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + **/loom-cache + key: gradle-caches-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle.properties', 'gradle/*.versions.toml') }} + restore-keys: | + gradle-caches-${{ hashFiles('**/*.gradle*') }} + gradle-caches- + + - name: Setup environment + run: | + echo "ORG_GRADLE_PROJECT_BUILD_ID=$(expr ${{ github.run_number }} + 290)" >> "$GITHUB_ENV" + # GitHub runners are limited to 7GB of RAM, so we'll limit our Gradle Daemon process to about half of that + # which is enough so long as parallel task execution is limited. + # We also need to limit the Kotlin Compiler Daemon to its default value (which it seems to be perfectly + # fine with) as otherwise it inherits the Gradle Daemon's jvmargs putting us above the runner limit. + # We also pin the amount of workers, so it doesn't break should GitHub increase the default available vCPUs. + # We write these to GRADLE_USER_HOME to overrule the local "gradle.properties" of the project. + mkdir -p "${GRADLE_USER_HOME:=~/.gradle}" + echo "org.gradle.jvmargs=-Xmx2G -Dkotlin.daemon.jvm.options=-Xmx512M" >> "$GRADLE_USER_HOME/gradle.properties" + echo "org.gradle.workers.max=2" >> "$GRADLE_USER_HOME/gradle.properties" + + - name: Build + # Split into multiple Gradle invocations because Loom's remapJar task (specifically the + # BuildSharedServiceManager) will not release any memory until all scheduled remapJar tasks have complete. + run: | + ./gradlew jar --stacktrace + ./gradlew :{1.{8.9,12.2}-forge,1.{19,19.1}-fabric,1.{16.2,17.1,18.1}-{forge,fabric}}:build --stacktrace + ./gradlew build --stacktrace + + - name: Publish + run: ./gradlew publish --stacktrace + if: env.ORG_GRADLE_PROJECT_nexus_user != null + env: + ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }} + ORG_GRADLE_PROJECT_nexus_password: ${{ secrets.NEXUS_PASSWORD }} diff --git a/root.gradle.kts b/root.gradle.kts index e4af8c7..ae46b96 100644 --- a/root.gradle.kts +++ b/root.gradle.kts @@ -26,7 +26,6 @@ preprocess { val fabric11701 = createNode("1.17.1-fabric", 11701, "yarn") val fabric11602 = createNode("1.16.2-fabric", 11602, "yarn") val forge11602 = createNode("1.16.2-forge", 11602, "srg") - val forge11502 = createNode("1.15.2-forge", 11502, "srg") val forge11202 = createNode("1.12.2-forge", 11202, "srg") val forge10809 = createNode("1.8.9-forge", 10809, "srg") @@ -46,7 +45,6 @@ preprocess { forge11701.link(fabric11701) fabric11701.link(fabric11602, file("versions/1.17.1-1.16.2.txt")) fabric11602.link(forge11602) - forge11602.link(forge11502, file("versions/1.16.2-1.15.2.txt")) - forge11502.link(forge11202, file("versions/1.15.2-1.12.2.txt")) + forge11602.link(forge11202, file("versions/1.16.2-1.12.2.txt")) forge11202.link(forge10809, file("versions/1.12.2-1.8.9.txt")) } diff --git a/settings.gradle.kts b/settings.gradle.kts index b6dc8e5..f1e8044 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,7 +20,6 @@ rootProject.buildFileName = "root.gradle.kts" listOf( "1.8.9-forge", "1.12.2-forge", - "1.15.2-forge", "1.16.2-forge", "1.16.2-fabric", "1.17.1-fabric", diff --git a/versions/1.15.2-1.12.2.txt b/versions/1.16.2-1.12.2.txt similarity index 85% rename from versions/1.15.2-1.12.2.txt rename to versions/1.16.2-1.12.2.txt index a6257cf..5971266 100644 --- a/versions/1.15.2-1.12.2.txt +++ b/versions/1.16.2-1.12.2.txt @@ -5,12 +5,12 @@ net.minecraft.util.SoundEvents net.minecraft.init.SoundEvents net.minecraft.client.renderer.texture.Texture net.minecraft.client.renderer.texture.AbstractTexture net.minecraft.resources.IResourceManager net.minecraft.client.resources.IResourceManager net.minecraft.client.renderer.texture.TextureUtil prepareImage() allocateTexture() -net.minecraft.client.renderer.Matrix3f org.lwjgl.util.vector.Matrix3f -net.minecraft.client.renderer.Matrix4f org.lwjgl.util.vector.Matrix4f -net.minecraft.client.renderer.Matrix4f write() org.lwjgl.util.vector.Matrix4f store() -net.minecraft.client.renderer.Quaternion org.lwjgl.util.vector.Quaternion -net.minecraft.client.renderer.Vector3f org.lwjgl.util.vector.Vector3f -net.minecraft.client.renderer.Vector4f org.lwjgl.util.vector.Vector4f +net.minecraft.util.math.vector.Matrix3f org.lwjgl.util.vector.Matrix3f +net.minecraft.util.math.vector.Matrix4f org.lwjgl.util.vector.Matrix4f +net.minecraft.util.math.vector.Matrix4f write() org.lwjgl.util.vector.Matrix4f store() +net.minecraft.util.math.vector.Quaternion org.lwjgl.util.vector.Quaternion +net.minecraft.util.math.vector.Vector3f org.lwjgl.util.vector.Vector3f +net.minecraft.util.math.vector.Vector4f org.lwjgl.util.vector.Vector4f net.minecraft.client.gui.screen.Screen net.minecraft.client.gui.GuiScreen net.minecraft.client.gui.widget.Widget net.minecraft.client.gui.GuiButton net.minecraft.client.renderer.entity.RenderPlayer net.minecraft.client.renderer.entity.PlayerRenderer @@ -32,8 +32,3 @@ net.minecraft.client.GameSettings net.minecraft.client.settings.GameSettings net.minecraft.client.gui.NewChatGui net.minecraft.client.gui.GuiNewChat net.minecraft.client.gui.screen.MainMenuScreen net.minecraft.client.gui.GuiMainMenu net.minecraft.network.play.server.SChatPacket net.minecraft.network.play.server.SPacketChat - - - - - diff --git a/versions/1.16.2-1.15.2.txt b/versions/1.16.2-1.15.2.txt deleted file mode 100644 index 4eab6c5..0000000 --- a/versions/1.16.2-1.15.2.txt +++ /dev/null @@ -1,4 +0,0 @@ -net.minecraft.util.math.vector.Matrix3f net.minecraft.client.renderer.Matrix3f -net.minecraft.util.math.vector.Matrix4f net.minecraft.client.renderer.Matrix4f -net.minecraft.util.math.vector.Quaternion net.minecraft.client.renderer.Quaternion -net.minecraft.util.math.vector.Vector3f net.minecraft.client.renderer.Vector3f