Skip to content
Merged
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
77 changes: 77 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Store and check out repository text as LF on every platform. Windows command
# files are the sole exception below.
* text=auto eol=lf

*.bat text eol=crlf
#*.bat text eol=lf
*.gradle text diff=java
mcmod.info text
*.java text
*.json text
*.lang text
*.mcmeta text
*.md text
*.properties text
gradlew text eol=lf
*.sh text eol=lf
*.txt text
*.xml text
*.yml text
*.yaml text
*.toml text

# Documents
*.pdf binary

# Graphics
*.eps binary
*.gif binary
*.ico binary
*.jpg binary
*.jpeg binary
*.png binary
*.psd binary
# SVG treated as an asset (binary) by default. If you want to treat it as text,
# comment-out the following line and uncomment the line after.
*.svg binary
#*.svg text
*.tif binary
*.tiff binary
*.webp binary
*.xcf binary

# Other
*.exe binary
*.jar binary

###############################
# Git Large File System (LFS) #
###############################

# Archives
#*.7z filter=lfs diff=lfs merge=lfs -text
#*.br filter=lfs diff=lfs merge=lfs -text
#*.bz2 filter=lfs diff=lfs merge=lfs -text
#*.gz filter=lfs diff=lfs merge=lfs -text
#*.tar filter=lfs diff=lfs merge=lfs -text
#*.zip filter=lfs diff=lfs merge=lfs -text

# Documents
#*.pdf filter=lfs diff=lfs merge=lfs -text

# Graphics
#*.eps filter=lfs diff=lfs merge=lfs -text
#*.gif filter=lfs diff=lfs merge=lfs -text
#*.ico filter=lfs diff=lfs merge=lfs -text
#*.jpg filter=lfs diff=lfs merge=lfs -text
#*.jpeg filter=lfs diff=lfs merge=lfs -text
#*.png filter=lfs diff=lfs merge=lfs -text
#*.psd filter=lfs diff=lfs merge=lfs -text
#*.tif filter=lfs diff=lfs merge=lfs -text
#*.tiff filter=lfs diff=lfs merge=lfs -text
#*.webp filter=lfs diff=lfs merge=lfs -text
#*.xcf filter=lfs diff=lfs merge=lfs -text

# Other
#*.exe filter=lfs diff=lfs merge=lfs -text
#*.jar filter=lfs diff=lfs merge=lfs -text
52 changes: 52 additions & 0 deletions .github/workflows/build_status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and Test

on:
push:
branches: [ '**' ]
pull_request:

permissions:
contents: read

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

env:
JAVA_VERSION: 21

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out source
uses: actions/checkout@v7

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v6

- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v6
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'microsoft'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Build and test
run: |
chmod +x ./gradlew
./gradlew clean check build

- name: Upload build artifacts
continue-on-error: true
uses: actions/upload-artifact@v7
with:
name: ${{ github.event.repository.name }}-${{ github.sha }}
if-no-files-found: error
retention-days: 14
path: |
build/libs/*.jar
92 changes: 92 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Upload Release Artifacts

on:
push:
tags: [ '*' ]

permissions:
contents: read

concurrency:
group: publish-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false # Never cancel a release halfway through uploading.

env:
JAVA_VERSION: 21
# Only booleans here, the secrets themselves are passed to the steps that need them. This is a preventative measure.
HAS_MAVEN: ${{ secrets.MAVEN_UPLOAD_URL != '' }}
HAS_CURSEFORGE: ${{ secrets.CURSEFORGE_TOKEN != '' }}
# The release tag ("modMajor.modMinor.modBug.minecraftVersionNoDots.loader" example: 1.2.1.121012) is used as-is for the mod version, build.gradle reads this.
TAG: ${{ github.ref_name }}

jobs:
publish:
name: Build and Publish
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write # Required for mc-publish to create a GitHub release.

steps:
- name: Check out source
uses: actions/checkout@v7

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v6

- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v6
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'microsoft'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Read gradle.properties
run: |
# Keeps the CurseForge ID defined in one place.
prop() { grep -E "^$1\s*=" gradle.properties | cut -d= -f2- | tr -d '[:space:]'; }
echo "CURSEFORGE_ID=$(prop curseforge_id)" >> "$GITHUB_ENV"

- name: Build and test
run: |
chmod +x ./gradlew
./gradlew clean check build

- name: Publish to Maven
if: env.HAS_MAVEN == 'true'
run: ./gradlew publish
env:
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}

# For additional properties and values that are not detected/set up here, you can read up on the docs here:
# https://github.com/Kira-NT/mc-publish
# I HEAVILY advise you read about this action, as this action can do a lot but also has a few quirks like changelog publishing not working right.
- name: Publish to GitHub
uses: Kira-NT/mc-publish@v3.3.2
with:
github-token: ${{ github.token }}
version: ${{ env.TAG }}
# Main jar first so it becomes the primary file, sources/javadoc attached as extras.
files: |
build/libs/!(*-@(sources|javadoc)).jar
build/libs/*-@(sources|javadoc).jar

- name: Publish to CurseForge
if: env.HAS_CURSEFORGE == 'true' && env.CURSEFORGE_ID != ''
uses: Kira-NT/mc-publish@v3.3.2
with:
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
# Read from curseforge_id in gradle.properties.
curseforge-id: ${{ env.CURSEFORGE_ID }}
version: ${{ env.TAG }}
files: |
build/libs/!(*-@(sources|javadoc)).jar
build/libs/*-@(sources|javadoc).jar
loaders: |
neoforge
environment: client | server
java: ${{ env.JAVA_VERSION }}
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@
/.gradle/
/debugmods/
/.idea/
/gradle/
/bin/
/.vscode/
/logs/

# Local tools (google-java-format for ./gradlew format)
/tools/*.jar

# Eclipse (generated by ./gradlew eclipse)
/.classpath
/.project
/.settings/
/*.launch

# Local Maven repository (publishAllPublicationsToLocalRepository)
/mcmodsrepo/
/.eclipse/
Loading
Loading