Skip to content

Commit

Permalink
remove paper module
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion committed Jun 16, 2024
1 parent f7e374b commit 2b35f53
Show file tree
Hide file tree
Showing 57 changed files with 216 additions and 771 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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'
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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'
194 changes: 190 additions & 4 deletions build.gradle.kts
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)
}
*/

5 changes: 1 addition & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@ buildscript {
}
}

//include("telekinesis-paper")
include("telekinesis-fabric")

extensions.configure<StonecutterSettings> {
kotlinController = true
centralScript = "build.gradle.kts"
shared {
versions("1.20.1", "1.20.4", "1.20.6", "1.21")
vcsVersion = "1.21"
}
create(":telekinesis-fabric")
create(rootProject)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 2b35f53

Please sign in to comment.