···11+# Automatically build the project and run any configured tests for every push
22+# and submitted pull request. This can help catch issues that only occur on
33+# certain platforms or Java versions, and provides a first line of defence
44+# against bad commits.
55+66+name: build
77+on: [pull_request, push]
88+99+jobs:
1010+ build:
1111+ runs-on: ubuntu-24.04
1212+ steps:
1313+ - name: checkout repository
1414+ uses: actions/checkout@v4
1515+ - name: validate gradle wrapper
1616+ uses: gradle/actions/wrapper-validation@v4
1717+ - name: setup jdk
1818+ uses: actions/setup-java@v4
1919+ with:
2020+ java-version: '21'
2121+ distribution: 'microsoft'
2222+ - name: make gradle wrapper executable
2323+ run: chmod +x ./gradlew
2424+ - name: build
2525+ run: ./gradlew build
2626+ - name: capture build artifacts
2727+ uses: actions/upload-artifact@v4
2828+ with:
2929+ name: Artifacts
3030+ path: build/libs/
+7-26
build.gradle
···11plugins {
22- id 'fabric-loom' version '1.6-SNAPSHOT'
22+ id 'fabric-loom' version "${loom_version}"
33 id 'maven-publish'
44}
55···1010 archivesName = project.archives_base_name
1111}
12121313-repositories {
1414- // Add repositories to retrieve artifacts from in here.
1515- // You should only use this when depending on other mods because
1616- // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
1717- // See https://docs.gradle.org/current/userguide/declaring_repositories.html
1818- // for more information about repositories.
1919-}
2020-2121-loom {
2222- splitEnvironmentSourceSets()
2323-2424- mods {
2525- "breakfree" {
2626- sourceSet sourceSets.main
2727- sourceSet sourceSets.client
2828- }
2929- }
3030-}
3131-3213dependencies {
3314 // To change the versions see the gradle.properties file
3415 minecraft "com.mojang:minecraft:${project.minecraft_version}"
3516 mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
3617 modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
3737-3838- // Fabric API. This is technically optional, but you probably want it anyway.
3939- //modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
4018}
41194220processResources {
4321 inputs.property "version", project.version
2222+ inputs.property "minecraft_version", project.minecraft_version
44234524 filesMatching("fabric.mod.json") {
4646- expand "version": project.version
2525+ expand "version": inputs.properties.version, "minecraft_version": inputs.properties.minecraft_version
4726 }
4827}
4928···6241}
63426443jar {
4444+ inputs.property "archivesName", project.base.archivesName
4545+6546 from("LICENSE") {
6666- rename { "${it}_${project.archivesBaseName}"}
4747+ rename { "${it}_${inputs.properties.archivesName}"}
6748 }
6849}
6950···8364 // The repositories here will be used for publishing your artifact, not for
8465 // retrieving dependencies.
8566 }
8686-}6767+}
+5-8
gradle.properties
···4455# Fabric Properties
66# check these on https://fabricmc.net/versions.html
77-minecraft_version=1.21
88-yarn_mappings=1.21+build.1
99-loader_version=0.15.11
77+minecraft_version=1.21.6
88+yarn_mappings=1.21.6+build.1
99+loader_version=0.16.14
1010+loom_version=1.10-SNAPSHOT
10111112# Mod Properties
1212-mod_version=1.3.0
1313+mod_version=1.3.0+1.21.6
1314maven_group=io.github.justapotota
1415archives_base_name=breakfree
1515-1616-# Dependencies
1717-# check this on https://fabricmc.net/versions.html
1818-fabric_version=0.100.1+1.21
···1515# See the License for the specific language governing permissions and
1616# limitations under the License.
1717#
1818+# SPDX-License-Identifier: Apache-2.0
1919+#
18201921##############################################################################
2022#
···5557# Darwin, MinGW, and NonStop.
5658#
5759# (3) This script is generated from the Groovy template
5858-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
6060+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961# within the Gradle project.
6062#
6163# You can find Gradle at https://github.com/gradle/gradle/.
···8486# shellcheck disable=SC2034
8587APP_BASE_NAME=${0##*/}
8688# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
8787-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8989+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
88908991# Use the maximum available, or set MAX_FD != -1 to use that value.
9092MAX_FD=maximum
+2
gradlew.bat
···1313@rem See the License for the specific language governing permissions and
1414@rem limitations under the License.
1515@rem
1616+@rem SPDX-License-Identifier: Apache-2.0
1717+@rem
16181719@if "%DEBUG%"=="" @echo off
1820@rem ##########################################################################