-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
57 changed files
with
216 additions
and
771 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 |
---|---|---|
|
@@ -5,15 +5,15 @@ name: build-commit | |
on: | ||
push: | ||
paths-ignore: | ||
- "readme.md" | ||
- "README.md" | ||
- "LICENSE" | ||
- ".gitignore" | ||
- "changelog.md" | ||
- ".editorconfig" | ||
- "src/*/resources/lang/*" | ||
pull_request: | ||
paths-ignore: | ||
- "readme.md" | ||
- "README.md" | ||
- "LICENSE" | ||
- ".gitignore" | ||
- "changelog.md" | ||
|
@@ -38,7 +38,17 @@ jobs: | |
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
- name: Build with Gradle | ||
run: ./gradlew :telekinesis-fabric:buildAllVersions --stacktrace | ||
run: ./gradlew buildAllVersions --stacktrace | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: versions/**/build/libs/*.jar | ||
|
||
modrinth-description: | ||
runs-on: ubuntu-latest | ||
name: Sync Modrinth description | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: funnyboy-roks/[email protected] | ||
with: | ||
auth-token: ${{ secrets.MODRINTH_API_KEY }} | ||
slug: 'skylper' |
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 |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
- name: Release with Gradle | ||
run: ./gradlew :telekinesis-fabric:releaseAllVersions --stacktrace | ||
run: ./gradlew releaseAllVersions postUpdate --stacktrace | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }} | ||
|
@@ -31,3 +31,13 @@ jobs: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SECRET_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SECRET_KEY_PASSWORD }} | ||
GPG_SECRET_KEY_ID: ${{ secrets.GPG_SECRET_KEY_ID }} | ||
|
||
modrinth-description: | ||
runs-on: ubuntu-latest | ||
name: Sync Modrinth description | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: funnyboy-roks/[email protected] | ||
with: | ||
auth-token: ${{ secrets.MODRINTH_API_KEY }} | ||
slug: 'skylper' |
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,17 +1,203 @@ | ||
@file:Suppress("SpellCheckingInspection", "SENSELESS_COMPARISON") | ||
|
||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") version "2.0.0" | ||
kotlin("plugin.serialization") version "2.0.0" | ||
id("fabric-loom") version "1.7-SNAPSHOT" | ||
|
||
id("me.modmuss50.mod-publish-plugin") version "0.5.+" | ||
|
||
id("fabric-loom") version "1.7-SNAPSHOT" apply (false) | ||
|
||
id("io.papermc.paperweight.userdev") version "1.5.5" apply (false) | ||
|
||
`maven-publish` | ||
signing | ||
} | ||
|
||
val beta: Int = 1 // Pattern is '1.0.0-beta1-1.20.6-pre.2' | ||
val featureVersion = "1.0.0${if (beta != null) "-beta$beta" else ""}" | ||
val mcVersion = property("mcVersion")!!.toString() | ||
val mcVersionRange = property("mcVersionRange")!!.toString() | ||
version = "$featureVersion-$mcVersion" | ||
|
||
group = "dev.nyon" | ||
val projectAuthors = listOf("btwonion") | ||
val githubRepo = "btwonion/telekinesis" | ||
|
||
base { | ||
archivesName.set(rootProject.name) | ||
} | ||
|
||
loom { | ||
if (stonecutter.current.isActive) { | ||
runConfigs.all { | ||
ideConfigGenerated(true) | ||
runDir("../../run") | ||
} | ||
} | ||
|
||
mixin { useLegacyMixinAp = false } | ||
} | ||
|
||
// Enable data generation for >1.20.6 | ||
if (!listOf("1.20.1", "1.20.4", "1.20.6").contains(stonecutter.current.version)) { | ||
fabricApi { | ||
configureDataGeneration() | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
exclusiveContent { | ||
forRepository { | ||
maven("https://api.modrinth.com/maven") | ||
} | ||
filter { | ||
includeGroup("maven.modrinth") | ||
} | ||
} | ||
maven("https://maven.terraformersmc.com") | ||
maven("https://maven.parchmentmc.org") | ||
maven("https://repo.nyon.dev/releases") | ||
maven("https://maven.isxander.dev/releases") | ||
maven("https://maven.isxander.dev/snapshots") | ||
maven("https://jitpack.io") | ||
} | ||
|
||
dependencies { | ||
minecraft("com.mojang:minecraft:$mcVersion") | ||
mappings(loom.layered { | ||
val parchment: String = property("deps.parchment").toString() | ||
if (parchment.isNotEmpty()) parchment("org.parchmentmc.data:parchment-$parchment@zip") | ||
officialMojangMappings() | ||
}) | ||
|
||
implementation("org.vineflower:vineflower:1.10.1") | ||
modImplementation("net.fabricmc:fabric-loader:0.15.11") | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("deps.fapi")!!}") | ||
modImplementation("net.fabricmc:fabric-language-kotlin:1.11.0+kotlin.2.0.0") | ||
|
||
modImplementation("dev.isxander:yet-another-config-lib:${property("deps.yacl")!!}") | ||
modImplementation("com.terraformersmc:modmenu:${property("deps.modMenu")!!}") | ||
|
||
include(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.1.1")!!)!!) | ||
|
||
include(modImplementation("dev.nyon:konfig:2.0.1-1.20.4")!!) | ||
} | ||
|
||
val javaVersion = property("javaVer")!!.toString() | ||
tasks { | ||
processResources { | ||
val modId = "telekinesis" | ||
val modName = "telekinesis" | ||
val modDescription = "Adds a telekinesis enchantment to minecraft" | ||
|
||
val props = mapOf( | ||
"id" to modId, | ||
"name" to modName, | ||
"description" to modDescription, | ||
"version" to project.version, | ||
"github" to githubRepo, | ||
"mc" to mcVersionRange | ||
) | ||
|
||
props.forEach(inputs::property) | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand(props) | ||
} | ||
} | ||
|
||
register("releaseMod") { | ||
group = "publishing" | ||
|
||
dependsOn("publishMods") | ||
dependsOn("publish") | ||
} | ||
|
||
withType<JavaCompile> { | ||
options.release = javaVersion.toInt() | ||
} | ||
|
||
withType<KotlinCompile> { | ||
compilerOptions { | ||
jvmTarget = JvmTarget.fromTarget(javaVersion) | ||
} | ||
} | ||
} | ||
|
||
val changelogText = buildString { | ||
append("# v${project.version}\n") | ||
rootProject.file("changelog.md").readText().also(::append) | ||
} | ||
|
||
val supportedMcVersions: List<String> = | ||
property("supportedMcVersions")!!.toString().split(',').map(String::trim).filter(String::isNotEmpty) | ||
|
||
publishMods { | ||
displayName = "v${project.version}" | ||
file = tasks.remapJar.get().archiveFile | ||
changelog = changelogText | ||
type = if (beta != null) BETA else STABLE | ||
modLoaders.addAll("fabric", "quilt") | ||
|
||
modrinth { | ||
projectId = "LLfA8jAD" | ||
accessToken = providers.environmentVariable("MODRINTH_API_KEY") | ||
minecraftVersions.addAll(supportedMcVersions) | ||
|
||
requires { slug = "fabric-api" } | ||
requires { slug = "yacl" } | ||
requires { slug = "fabric-language-kotlin" } | ||
optional { slug = "modmenu" } | ||
} | ||
|
||
github { | ||
repository = githubRepo | ||
accessToken = providers.environmentVariable("GITHUB_TOKEN") | ||
commitish = "master" | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
name = "nyon" | ||
url = uri("https://repo.nyon.dev/releases") | ||
credentials { | ||
username = providers.environmentVariable("NYON_USERNAME").orNull | ||
password = providers.environmentVariable("NYON_PASSWORD").orNull | ||
} | ||
} | ||
} | ||
publications { | ||
create<MavenPublication>("maven") { | ||
groupId = "dev.nyon" | ||
artifactId = "telekinesis" | ||
version = project.version.toString() | ||
from(components["java"]) | ||
} | ||
} | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
|
||
javaVersion.toInt().let { JavaVersion.values()[it - 1] }.let { | ||
sourceCompatibility = it | ||
targetCompatibility = it | ||
} | ||
} | ||
|
||
/* | ||
signing { | ||
val signingKey: String? by project | ||
val signingPassword: String? by project | ||
useGpgCmd() | ||
if (signingKey != null && signingPassword != null) { | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
} | ||
sign(publishing.publications) | ||
} | ||
*/ | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.