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
11 changes: 8 additions & 3 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: 21
java-version: 25
distribution: temurin
cache: gradle

Expand All @@ -38,9 +38,14 @@ jobs:
- name: Build
run: ./gradlew build

- 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 }}
74 changes: 35 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
buildscript {
repositories {
maven { url = 'https://maven.fabricmc.net/' }
maven { url = 'https://plugins.gradle.org/m2/' }
mavenCentral()
}
dependencies {
classpath "net.fabricmc:fabric-loom:${loom_version}"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
classpath "com.modrinth.minotaur:Minotaur:2.+"
}
plugins {
id 'fabric-loom' version "${loom_version}"
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: 'fabric-loom'
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 @@ -54,7 +42,11 @@ processResources {
}
}

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

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

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

curseforge {
apiKey = key

project {
id = project.curseforge_project_id

changelog = file("changelog.md")
changelogType = "markdown"
from("changelog.md")
from("LICENSE")
}

releaseType = "release"
remapJar {
dependsOn shadowJar
inputFile.set(shadowJar.archiveFile)
archiveClassifier.set('')
}

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, remapJar)
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 @@ -95,14 +91,14 @@ modrinth {
versionNumber = project.version
versionName = "${project.mod_name} ${project.version}"

uploadFile = jar
uploadFile = remapJar

gameVersions = [project.minecraft_version]
loaders = [project.loader.toLowerCase()]

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

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

## [1.18.2 Fabric - 3.2.5]

* chore: update buildscript
* chore: relocate linkableapi

## [1.18.2 Fabric - 3.2.4]

* fix: linkingtool linking
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ org.gradle.configuration-cache=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.18.2
Expand Down
9 changes: 9 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pluginManagement {
repositories {
maven { url = 'https://maven.fabricmc.net/' }
mavenCentral()
gradlePluginPortal()
}
}

rootProject.name = 'WirelessRedstone'