-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef1bfc9
commit 3ccac35
Showing
14 changed files
with
629 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Java CI (Main) | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
workflow_dispatch: | ||
branches: | ||
- 'main' | ||
inputs: | ||
release_type: | ||
description: 'Release Type' | ||
required: true | ||
type: choice | ||
default: 'release' | ||
options: | ||
- 'release' | ||
- 'beta' | ||
- 'alpha' | ||
- 'none' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: | | ||
!contains(github.event.head_commit.message, '[ci skip]') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 30 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '21' | ||
cache: gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Build and Publish with Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
env: | ||
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }} | ||
SAPS_TOKEN: ${{ secrets.SAPS_TOKEN }} | ||
with: | ||
arguments: build publish --stacktrace --no-daemon | ||
|
||
- name: Release to CurseForge | ||
uses: gradle/gradle-build-action@v2 | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != 'none' }} | ||
env: | ||
GIT_COMMIT: ${{ github.event.after }} | ||
GIT_PREVIOUS_COMMIT: ${{ github.event.before }} | ||
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
RELEASE_TYPE: ${{ inputs.release_type }} | ||
with: | ||
arguments: curseforge modrinth --stacktrace --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
.gradle | ||
**/build/ | ||
!src/**/build/ | ||
|
||
# Ignore Gradle GUI config | ||
gradle-app.setting | ||
|
||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
!gradle-wrapper.jar | ||
# eclipse | ||
bin | ||
*.launch | ||
.settings | ||
.metadata | ||
.classpath | ||
.project | ||
|
||
# Avoid ignore Gradle wrappper properties | ||
!gradle-wrapper.properties | ||
# idea | ||
out | ||
*.ipr | ||
*.iws | ||
*.iml | ||
.idea | ||
|
||
# Cache of project | ||
.gradletasknamecache | ||
# gradle | ||
build | ||
.gradle | ||
logs | ||
|
||
# Eclipse Gradle plugin generated files | ||
# Eclipse Core | ||
.project | ||
# JDT-specific (Eclipse Java Development Tools) | ||
.classpath | ||
# other | ||
eclipse | ||
run | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
import java.time.Instant | ||
|
||
plugins { | ||
id 'base' | ||
id 'java' | ||
id 'maven-publish' | ||
id 'net.neoforged.moddev' version "1.0.14" | ||
// https://maven.architectury.dev/me/shedaniel/unified-publishing/maven-metadata.xml | ||
id "me.shedaniel.unified-publishing" version "0.1.13" | ||
} | ||
|
||
ext.ENV = System.getenv() | ||
def isLocal = !ENV.containsKey("GITHUB_RUN_NUMBER") | ||
|
||
version = "${mod_version}-${isLocal ? "local.${Instant.now().epochSecond}" : "build.${ENV.GITHUB_RUN_NUMBER}"}" | ||
group = project.maven_group | ||
base.archivesBaseName = project.archives_base_name | ||
|
||
neoForge { | ||
version = project.neoforge_version | ||
|
||
runs { | ||
configureEach { | ||
logLevel = org.slf4j.event.Level.INFO | ||
} | ||
|
||
client { | ||
client() | ||
|
||
if (ENV.MC_CLIENT_ARGS) { | ||
programArguments.addAll(ENV.MC_CLIENT_ARGS.split(' ')) | ||
} | ||
|
||
jvmArguments.addAll("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition") | ||
gameDirectory = file 'run' | ||
} | ||
|
||
server { | ||
server() | ||
programArgument("--nogui") | ||
gameDirectory = file 'run_server' | ||
} | ||
} | ||
|
||
mods { | ||
worldadvancements { | ||
sourceSet sourceSets.main | ||
} | ||
} | ||
|
||
parchment { | ||
minecraftVersion = parchment_mc_version | ||
mappingsVersion = parchment_mapping_version | ||
} | ||
} | ||
|
||
compileJava { | ||
options.encoding = "UTF-8" | ||
options.release.set(21) | ||
} | ||
|
||
java { | ||
sourceCompatibility = targetCompatibility = '21' | ||
withSourcesJar() | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
|
||
maven { | ||
url "https://maven.neoforged.net/releases" | ||
} | ||
|
||
maven { | ||
name = 'ParchmentMC' | ||
url = 'https://maven.parchmentmc.org' | ||
content { | ||
includeGroup "org.parchmentmc.data" | ||
} | ||
} | ||
|
||
maven { | ||
url "https://cursemaven.com" | ||
content { | ||
includeGroup "curse.maven" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
// compileOnly("curse.maven:oculus-581495:5299671") | ||
// compileOnly("curse.maven:rubidium-574856:4952685") | ||
} | ||
|
||
processResources { | ||
def toReplace = [ | ||
"version": project.version, | ||
] | ||
|
||
println("[Process Resources] Replacing properties in resources: " + toReplace) | ||
|
||
inputs.properties toReplace | ||
filesMatching("META-INF/neoforge.mods.toml") { | ||
expand toReplace | ||
} | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes([ | ||
"Specification-Title" : project.mod_id, | ||
"Specification-Vendor" : project.mod_author, | ||
"Specification-Version" : "1", | ||
"Implementation-Title" : project.name, | ||
"Implementation-Version" : version, | ||
"Implementation-Vendor" : project.mod_author, | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | ||
]) | ||
} | ||
} | ||
|
||
unifiedPublishing { | ||
project { | ||
releaseType = "${ENV.RELEASE_TYPE ?: 'release'}" | ||
gameVersions = [ | ||
rootProject.minecraft_version | ||
] | ||
gameLoaders = ["neoforge"] | ||
displayName = "$mod_name NeoForge $project.version" | ||
mainPublication jar | ||
|
||
if (ENV.CURSEFORGE_KEY) { | ||
curseforge { | ||
token = ENV.CURSEFORGE_KEY | ||
id = project.curseforge_id | ||
} | ||
} | ||
|
||
if (ENV.MODRINTH_TOKEN) { | ||
modrinth { | ||
token = ENV.MODRINTH_TOKEN | ||
id = project.modrinth_id | ||
version = "$project.version+$project.name" | ||
} | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenNeoForge(MavenPublication) { | ||
artifactId = archives_base_name | ||
from components.java | ||
} | ||
} | ||
|
||
repositories { | ||
if (ENV.MAVEN_TOKEN) { | ||
maven { | ||
url "https://maven.latvian.dev/releases" | ||
credentials { | ||
username = "lat" | ||
password = "${ENV.MAVEN_TOKEN}" | ||
} | ||
} | ||
} | ||
|
||
if (ENV.SAPS_TOKEN) { | ||
maven { | ||
url "https://maven.saps.dev/releases" | ||
credentials { | ||
username = "latvian" | ||
password = "${ENV.SAPS_TOKEN}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs << "-Xmaxerrs" << "1000" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
org.gradle.jvmargs=-Xmx3G | ||
org.gradle.daemon=false | ||
|
||
mod_id=worldadvancements | ||
archives_base_name=world-advancements-neoforge | ||
mod_name=World Advancements | ||
maven_group=dev.latvian.mods | ||
mod_author=latvian.dev | ||
curseforge_id=0 | ||
modrinth_id=0 | ||
|
||
minecraft_version=1.21.1 | ||
mod_version=2101.0.1 | ||
|
||
neoforge_version=21.1.12 | ||
parchment_mc_version=1.21 | ||
parchment_mapping_version=2024.07.28 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.