diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..fae2f9a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +name: Publish to Bintray + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + publish: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew bintrayUpload --parallel --stacktrace + env: + BINTRAY_USER: oroarmor + BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} \ No newline at end of file diff --git a/README.md b/README.md index d2ea1a2..2ba1b4c 100644 --- a/README.md +++ b/README.md @@ -9,19 +9,22 @@ My goal in creating this library was to make an light-weight config library that ## How to include Include my library in your mod by adding it to your `build.gradle` file. -Make sure jitpack is included in your repositiories section: +Make sure my bintray repo is included in your repositiories section: ``` repositories { maven { - url = "https://jitpack.io" + url = "https://dl.bintray.com/oroarmor/oroarmor" } } ``` Then in your dependencies section add my library to the classpath and jar-in-jar it so that users dont have to download an extra file: + +The current version is: ![](https://img.shields.io/github/v/tag/oroarmor/oro-config.svg) + ``` dependencies { - modImplementation 'com.github.OroArmor:oro-config:-SNAPSHOT' - include 'com.github.OroArmor:oro-config:-SNAPSHOT' + modImplementation 'com.github.OroArmor:oro-config:${version}' + include 'com.github.OroArmor:oro-config:${version}' } ``` diff --git a/build.gradle b/build.gradle index d6df9b2..978e4e9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'fabric-loom' version '0.5-SNAPSHOT' id 'maven-publish' + id 'com.jfrog.bintray' version "1.8.4" } repositories { @@ -28,31 +29,20 @@ task runTestmodClient(type: RunClientTask) { dependencies { - //to change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - // Fabric API. This is technically optional, but you probably want it anyway. - modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - -// [ -// "fabric-api-base", -// "fabric-command-api-v1", -// "fabric-resource-loader-v0" -// ].forEach { -// modImplementation(fabricApi.module(it, project.fabric_version)) -// } + testmodCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modCompile("io.github.prospector:modmenu:1.14.6+build.31") { exclude(module: "fabric-api") } - - modApi("me.shedaniel.cloth:config-2:4.8.3"){ + + modCompile("me.shedaniel.cloth:config-2:4.8.3") { exclude(module: "fabric-api") } - + testImplementation 'junit:junit:4.13.1' testmodCompile sourceSets.main.output @@ -101,6 +91,10 @@ publishing { artifact(sourcesJar) { builtBy remapSourcesJar } + + archivesBaseName = rootProject.archives_base_name + version = rootProject.mod_version + group = rootProject.maven_group } } @@ -109,4 +103,21 @@ publishing { // uncomment to publish to the local maven // mavenLocal() } +} + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_KEY') + publications = ["mavenJava"] + publish = true + pkg { + repo = 'oroarmor' + name = rootProject.archives_base_name + userOrg = "oroarmor" + licenses = ['CC0-1.0'] + vcsUrl = 'https://github.com/OroArmor/Oro-Config.git' + version { + name = rootProject.mod_version + } + } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a1392fb..89b6c52 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,10 +8,10 @@ org.gradle.jvmargs=-Xmx2G loader_version=0.10.0+build.208 # Mod Properties - mod_version = 1.0.0 + mod_version = 1.1.0 maven_group = com.oroarmor archives_base_name = oro-config # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version= 0.22.1+build.409-1.16 \ No newline at end of file + fabric_version= 0.29.4+1.16 \ No newline at end of file diff --git a/src/main/java/com/oroarmor/config/command/ConfigCommand.java b/src/main/java/com/oroarmor/config/command/ConfigCommand.java index 3b0ab40..8ff14a2 100644 --- a/src/main/java/com/oroarmor/config/command/ConfigCommand.java +++ b/src/main/java/com/oroarmor/config/command/ConfigCommand.java @@ -16,7 +16,6 @@ import com.oroarmor.config.ConfigItemGroup; import com.oroarmor.config.ConfigItem.Type; -import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; import net.minecraft.client.resource.language.I18n; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.text.ClickEvent; @@ -36,7 +35,7 @@ * @author Eli Orona * */ -public class ConfigCommand implements CommandRegistrationCallback { +public class ConfigCommand { /** * The config @@ -127,9 +126,8 @@ protected int listItem(CommandContext c, ConfigItem item return 1; } - @Override public void register(CommandDispatcher dispatcher, boolean dedicated) { - LiteralArgumentBuilder literalArgumentBuilder = literal(config.getID()).requires(p -> p.hasPermissionLevel(2)).executes(c -> listConfigGroups(c)); + LiteralArgumentBuilder literalArgumentBuilder = literal(config.getID()).requires(p -> p.hasPermissionLevel(2)).executes(this::listConfigGroups); for (ConfigItemGroup group : config.getConfigs()) { parseConfigItemGroupCommand(literalArgumentBuilder, group); diff --git a/src/main/resources/oro-config_icon.jpg b/src/main/resources/oro-config_icon.jpg index 64d0971..7c48999 100644 Binary files a/src/main/resources/oro-config_icon.jpg and b/src/main/resources/oro-config_icon.jpg differ diff --git a/src/testmod/java/com/oroarmor/config/testmod/OroConfigTestMod.java b/src/testmod/java/com/oroarmor/config/testmod/OroConfigTestMod.java index 78750af..6720003 100644 --- a/src/testmod/java/com/oroarmor/config/testmod/OroConfigTestMod.java +++ b/src/testmod/java/com/oroarmor/config/testmod/OroConfigTestMod.java @@ -17,7 +17,7 @@ public void onInitialize() { System.out.println(CONFIG); - CommandRegistrationCallback.EVENT.register(new ConfigCommand(CONFIG)); + CommandRegistrationCallback.EVENT.register(new ConfigCommand(CONFIG)::register); } }