Skip to content
Open
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
13 changes: 9 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: 8
java-version: 25
distribution: temurin
cache: gradle

Expand All @@ -36,11 +36,16 @@ jobs:
uses: gradle/actions/setup-gradle@v6

- name: Build
run: ./gradlew build
run: ./gradlew reobfShadowJar

- name: Publish
- name: Publishing Curseforge
if: github.event_name == 'push' && github.ref_protected && github.ref_type == 'branch'
run: ./gradlew publishMods
run: ./gradlew publishCurseforge
env:
CURSETOKEN: ${{ secrets.CURSETOKEN }}

- name: Publishing Modrinth
if: github.event_name == 'push' && github.ref_protected && github.ref_type == 'branch'
run: ./gradlew publishModrinth
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

### Build

- ``./gradlew build``
- ``./gradlew build`` or
- ``./gradlew reobfShadowJar``

### License

Expand Down
77 changes: 39 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://plugins.gradle.org/m2/' }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:6.0.+'
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
classpath "com.modrinth.minotaur:Minotaur:2.+"
}
plugins {
id 'net.minecraftforge.gradle' version '6.0.+'
id 'com.gradleup.shadow' version '9.2.0+'
id 'eclipse'
id 'net.darkhax.curseforgegradle' version '1.3.+'
id "com.modrinth.minotaur" version "2.+"
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'com.matthewprenger.cursegradle'
apply plugin: 'com.modrinth.minotaur'

group = project.mod_group
version = project.mod_version

Expand Down Expand Up @@ -56,6 +45,14 @@ dependencies {
}

jar {
enabled = false
}

shadowJar {
archiveClassifier.set('')
configurations = []
relocate 'com.troblecodings.linkableapi', "${project.group}.tcredstone.shadow.linkableapi"

manifest {
attributes([
"Specification-Title": project.mod_name,
Expand All @@ -67,27 +64,31 @@ jar {
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}

jar.finalizedBy('reobfJar')

def key = System.getenv("CURSETOKEN")
if (key == null)
key = 'dev'

curseforge {
apiKey = key

project {
id = project.curseforge_project_id
from("changelog.md")
from("LICENSE")
}

changelog = file("changelog.md")
changelogType = "markdown"
reobf {
shadowJar {}
}

releaseType = "release"
tasks.named("build") {
dependsOn("reobfShadowJar")
}

addGameVersion project.minecraft_version
}
tasks.register("publishCurseforge", net.darkhax.curseforgegradle.TaskPublishCurseForge) {
def key = System.getenv("CURSETOKEN")
if (key == null)
key = 'dev'
apiToken = key
def mainFile = upload(project.curseforge_project_id, reobfShadowJar)
mainFile.changelog = file("changelog.md").text
mainFile.changelogType = 'markdown'
mainFile.releaseType = 'release'
mainFile.addModLoader("${project.loader}")
mainFile.addEnvironment("Client", "Server")
mainFile.addGameVersion("${project.minecraft_version}")
}

modrinth {
Expand All @@ -98,14 +99,14 @@ modrinth {
versionNumber = project.version
versionName = "${project.mod_name} ${project.version}"

uploadFile = jar
uploadFile = reobfShadowJar

gameVersions = [project.minecraft_version]
loaders = [project.loader]

changelog = file("changelog.md").text
}

tasks.register("publishMods") {
dependsOn("curseforge", "modrinth")
}
tasks.register("publishModrinth") {
dependsOn("modrinth")
}
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog

## [1.15.2 - 3.2.5]

* chore: update buildscript
* chore: relocate linkableapi

## [1.15.2 - 3.2.4]

* feat: add item damage
* fix: correct redstone update
* ref: update buildpipeline

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ org.gradle.daemon=false
# Mod Meta
mod_name=TC-Redstone
mod_group=com.troblecodings
mod_version=3.2.4
mod_version=3.2.5

# Minecraft
minecraft_version=1.15.2

# Forge
forge_version=31.2.57
loader=forge
loader=Forge

# Java
java_version=8
Expand Down
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
}