Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,52 @@
# against bad commits.

name: build
on: [pull_request, push]

on:
pull_request:
paths: &build_paths
- '.github/workflows/build.yml'
- 'build.gradle'
- 'gradle.properties'
- 'gradle/**'
- 'gradlew'
- 'gradlew.bat'
- 'settings.gradle'
- 'src/**'

push:
branches: [main]
paths: *build_paths

concurrency:
group: "java-build-${{ github.ref }}"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
# Use these Java versions
java: [
25, # Current Java LTS
]
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: setup jdk
uses: gradle/wrapper-validation-action@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ matrix.java == '25' }} # Only upload artefacts built from latest java
uses: actions/upload-artifact@v4
with:
name: Artifacts
Expand Down
21 changes: 7 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version "${loom_version}"
id 'net.fabricmc.fabric-loom' version "${loom_version}"
id 'maven-publish'
}

Expand All @@ -21,11 +21,11 @@ repositories {
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// NOTE: Not all projects use Fabric API, but there's no telling that we won't need it later.
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"

}

Expand All @@ -38,17 +38,14 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
it.options.release = 25
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}

jar {
Expand All @@ -68,11 +65,7 @@ publishing {
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
18 changes: 7 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Done to increase the memory available to Gradle.
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# IntelliJ IDEA is not yet fully compatible with configuration cache, see: https://github.com/FabricMC/fabric-loom/issues/1349
org.gradle.configuration-cache=false

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.10
yarn_mappings=1.21.10+build.2
loader_version=0.17.3
loom_version=1.12-SNAPSHOT
minecraft_version=26.1-snapshot-4
loader_version=0.18.4
loom_version=1.14-SNAPSHOT

# Mod Properties
mod_version=1.0.0+1.21.10
mod_version=1.0.1-beta+26.1-snapshots_fabric
maven_group=me.imgalvin
archives_base_name=auto-lan

# Dependencies
fabric_version=0.137.0+1.21.10
fabric_api_version=0.142.2+26.1
Loading