Compare commits

..

3 commits

Author SHA1 Message Date
ed38972725 added forgejo workflows script
All checks were successful
build-java / build (push) Successful in 1m16s
2025-06-09 23:23:50 +02:00
b977547ad5 updated workflow script 2025-06-09 23:23:39 +02:00
67695bbb41 version bump 2025-06-09 23:23:15 +02:00
8 changed files with 66 additions and 28 deletions

View file

@ -0,0 +1,41 @@
name: build-java
on: [ push, pull_request ]
jobs:
build:
runs-on: docker
steps:
- name: checkout repository
uses: https://code.forgejo.org/actions/checkout@v4
- name: setup jdk
uses: https://github.com/actions/setup-java@v4
with:
java-version: |
8
21
distribution: temurin
- name: restore cached dependencies
uses: https://code.forgejo.org/actions/cache/restore@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-Gradle
- name: build
run: ./gradlew build --no-daemon --warning-mode=all
- name: capture build artifacts
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: build-artifacts.zip
path: |
build/libs
!build/libs/*-all.jar
if-no-files-found: error
- name: cache downloaded dependencies
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: https://code.forgejo.org/actions/cache/save@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-Gradle

View file

@ -8,33 +8,23 @@ on: [pull_request, push]
jobs: jobs:
build: build:
strategy: runs-on: ubuntu-24.04
matrix:
# Use these Java versions
java: [
21, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps: steps:
- name: checkout repository - name: checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: validate gradle wrapper - name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1 uses: gradle/actions/wrapper-validation@v4
- name: setup jdk ${{ matrix.java }} - name: setup jdk
uses: actions/setup-java@v3 uses: actions/setup-java@v4
with: with:
java-version: ${{ matrix.java }} java-version: '21'
distribution: 'microsoft' distribution: 'microsoft'
- name: make gradle wrapper executable - name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew run: chmod +x ./gradlew
- name: build - name: build
run: ./gradlew build run: ./gradlew build
- name: capture build artifacts - name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
with: with:
name: Artifacts name: Artifacts
path: build/libs/ path: build/libs/

View file

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.6-SNAPSHOT' id 'fabric-loom' version '1.10-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -19,7 +19,7 @@ repositories {
} }
loom { loom {
splitEnvironmentSourceSets() splitEnvironmentSourceSets()
mods { mods {
"modid" { "modid" {
@ -45,7 +45,7 @@ processResources {
inputs.property "version", project.version inputs.property "version", project.version
filesMatching("fabric.mod.json") { filesMatching("fabric.mod.json") {
expand "version": project.version expand "version": inputs.properties.version
} }
} }
@ -64,8 +64,10 @@ java {
} }
jar { jar {
inputs.property "archivesName", project.base.archivesName
from("LICENSE") { from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"} rename { "${it}_${inputs.properties.archivesName}"}
} }
} }

View file

@ -4,9 +4,10 @@ org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.21 minecraft_version=1.21.5
yarn_mappings=1.21+build.2 yarn_mappings=1.21.5+build.1
loader_version=0.15.11 loader_version=0.16.14
loom_version=1.10-SNAPSHOT
# Mod Properties # Mod Properties
mod_version=1.0.3-1.19.x-1.21 mod_version=1.0.3-1.19.x-1.21
@ -14,4 +15,4 @@ maven_group=dev.jonasjones.ticktocktracker
archives_base_name=ticktocktracker archives_base_name=ticktocktracker
# Dependencies # Dependencies
fabric_version=0.100.3+1.21 fabric_version=0.126.0+1.21.5

Binary file not shown.

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

6
gradlew vendored
View file

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# SPDX-License-Identifier: Apache-2.0
#
############################################################################## ##############################################################################
# #
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop. # Darwin, MinGW, and NonStop.
# #
# (3) This script is generated from the Groovy template # (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project. # within the Gradle project.
# #
# You can find Gradle at https://github.com/gradle/gradle/. # You can find Gradle at https://github.com/gradle/gradle/.
@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum

2
gradlew.bat vendored
View file

@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and @rem See the License for the specific language governing permissions and
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################