Skip to content

Commit

Permalink
Build: Enable GitHub Actions based CI
Browse files Browse the repository at this point in the history
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]: architectury/architectury-loom#151

GitHub: #55
  • Loading branch information
Johni0702 authored Sep 13, 2023
1 parent 7d0c9f4 commit fd989a7
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 19 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 1 addition & 3 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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"))
}
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 6 additions & 11 deletions versions/1.15.2-1.12.2.txt → versions/1.16.2-1.12.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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





4 changes: 0 additions & 4 deletions versions/1.16.2-1.15.2.txt

This file was deleted.

0 comments on commit fd989a7

Please sign in to comment.