Compare commits

..
2 Commits
Author SHA1 Message Date
big-duckie da2ffa19ff Add actions support.
release / build (21) (push) Successful in 12m1s
2025-01-01 14:27:06 -07:00
big-duckie 412ab2c1d0 Fix up some issues. 2025-01-01 14:25:39 -07:00
10 changed files with 133 additions and 74 deletions
+43
View File
@@ -0,0 +1,43 @@
name: release
on:
push:
tags:
- "*"
env:
VERSION: "${{github.ref_name}}"
jobs:
build:
strategy:
matrix:
java: [
21, # Current Java LTS
]
runs-on: ubuntu-22.04
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: "temurin"
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: publish maven
continue-on-error: true
env:
MAVEN_TOKEN: "${{secrets.MAVEN_TOKEN}}"
run: ./gradlew publish
- name: publish release
uses: akkuman/gitea-release-action@v1
with:
files: |-
build/libs/**
token: "${{secrets.GITHUB_TOKEN}}"
+58 -44
View File
@@ -1,57 +1,25 @@
plugins { plugins {
id "fabric-loom" version "1.6-SNAPSHOT" id 'fabric-loom' version '1.8-SNAPSHOT'
id "maven-publish" id 'maven-publish'
id "java-library"
} }
if (System.getenv("VERSION")) {
project.mod_version = System.getenv("VERSION")
}
version = "${project.mod_version}"
group = "dev.draylar" group = "dev.draylar"
archivesBaseName = "omega-config"
subprojects { base {
apply plugin: 'fabric-loom' archivesName = "omega-config"
apply plugin: 'maven-publish'
archivesBaseName = project.name
group = "dev.draylar.${project.group}"
// Only publish for submodules (not the root project) - add standard jar, + sources & development jar
publishing {
repositories {
maven {
name = "draylarRepository"
url = "https://maven.draylar.dev/releases"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
// Add sources & javadoc artifacts
java {
withSourcesJar()
withJavadocJar()
}
} }
allprojects { allprojects {
apply plugin: "fabric-loom" apply plugin: "fabric-loom"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
version = project.mod_version + "+" + project.minecraft_version version = project.mod_version
repositories { repositories {}
maven {
name = "FabricMC"
url = "https://maven.fabricmc.net"
}
}
dependencies { dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
@@ -68,7 +36,8 @@ allprojects {
} }
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile).configureEach {
it.options.release = 17
javadoc.options.addStringOption('Xdoclint:none', '-quiet') javadoc.options.addStringOption('Xdoclint:none', '-quiet')
} }
@@ -79,6 +48,51 @@ allprojects {
} }
} }
subprojects {
apply plugin: 'fabric-loom'
apply plugin: 'maven-publish'
archivesBaseName = project.name
group = "dev.draylar.${project.group}"
// Only publish for submodules (not the root project) - add standard jar, + sources & development jar
publishing {
publications {
create("mavenJava", MavenPublication) {
artifactId = project.archives_base_name
version = "${project.mod_version}+${project.minecraft_version}"
from components.java
}
}
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
maven {
name = "Gitea"
url = uri("https://git.bigduckie.dev/api/packages/big-duckie/maven")
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "token ${System.getenv("MAVEN_TOKEN")}"
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
// Add sources & javadoc artifacts
java {
withSourcesJar()
withJavadocJar()
}
}
// Main project depends on the base & gui module for testing // Main project depends on the base & gui module for testing
dependencies { dependencies {
implementation project(path: ":omega-config-base", configuration: "namedElements") implementation project(path: ":omega-config-base", configuration: "namedElements")
+8 -6
View File
@@ -1,17 +1,19 @@
# Done to increase the memory available to gradle. # Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/versions.html
minecraft_version=1.20.1 minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10 yarn_mappings=1.20.1+build.10
loader_version=0.15.11 loader_version=0.16.7
# Fabric API
fabric_version=0.92.2+1.20.1
# Mod Properties # Mod Properties
mod_version=1.4.1 mod_version=1.4.1
maven_group=dev.draylar maven_group=dev.bigduckie
archives_base_name=omega-config archives_base_name=omega-config
# Dependencies
fabric_version=0.92.2+1.20.1
modmenu_version=7.1.0 modmenu_version=7.1.0
+3 -1
View File
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
-5
View File
@@ -1,5 +0,0 @@
jdk:
- openjdk17
before_install:
- sdk install java 17.0.1-open
- sdk use java 17.0.1-open
@@ -96,8 +96,9 @@ public class OmegaConfig implements ModInitializer {
} }
return config; return config;
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException exception) { } catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
exception.printStackTrace(); InvocationTargetException e) {
e.printStackTrace();
throw new RuntimeException("No valid constructor found for: " + configClass.getName()); throw new RuntimeException("No valid constructor found for: " + configClass.getName());
} }
} }
@@ -179,12 +180,10 @@ public class OmegaConfig implements ModInitializer {
Class<?>[] classes = aClass.getDeclaredClasses(); Class<?>[] classes = aClass.getDeclaredClasses();
if (classes.length != 0) {
for (Class<?> clazz : classes) { for (Class<?> clazz : classes) {
populateRecursively(list, clazz); populateRecursively(list, clazz);
} }
} }
}
private static void addFieldComments(Field field, Map<String, String> keyToComments) { private static void addFieldComments(Field field, Map<String, String> keyToComments) {
String fieldName = field.getName(); String fieldName = field.getName();
@@ -8,6 +8,7 @@ import net.fabricmc.fabric.api.util.NbtType;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.RunArgs; import net.minecraft.client.RunArgs;
import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtList;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.Unique;
@@ -36,7 +37,7 @@ public class ClientMixin {
client.execute(() -> { client.execute(() -> {
if (tag != null && tag.contains("Configurations")) { if (tag != null && tag.contains("Configurations")) {
NbtList list = tag.getList("Configurations", NbtType.COMPOUND); NbtList list = tag.getList("Configurations", NbtElement.COMPOUND_TYPE);
list.forEach(compound -> { list.forEach(compound -> {
NbtCompound syncedConfiguration = (NbtCompound) compound; NbtCompound syncedConfiguration = (NbtCompound) compound;
String name = syncedConfiguration.getString("ConfigName"); String name = syncedConfiguration.getString("ConfigName");
@@ -6,7 +6,8 @@
"description": "The last config solution you will ever use.", "description": "The last config solution you will ever use.",
"authors": [ "authors": [
"Draylar", "Draylar",
"Frqnny" "Frqnny",
"Big Duckie"
], ],
"entrypoints": { "entrypoints": {
"main": [ "main": [
@@ -30,7 +31,9 @@
}, },
"custom": { "custom": {
"modmenu": { "modmenu": {
"badges": [ "library" ] "badges": [
"library"
]
} }
} }
} }
+1 -1
View File
@@ -1,10 +1,10 @@
pluginManagement { pluginManagement {
repositories { repositories {
jcenter()
maven { maven {
name = 'Fabric' name = 'Fabric'
url = 'https://maven.fabricmc.net/' url = 'https://maven.fabricmc.net/'
} }
mavenCentral()
gradlePluginPortal() gradlePluginPortal()
} }
} }
@@ -8,7 +8,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
//taken straight out of Mo' Structures //taken straight out of Mo Structures
public class StructuresConfigTest implements Config { public class StructuresConfigTest implements Config {
@Comment(""" @Comment("""