From def8f32750b45f6208b35a44c4aad61d667187d2 Mon Sep 17 00:00:00 2001 From: Aton-Kish <38515249+Aton-Kish@users.noreply.github.com> Date: Sun, 19 Feb 2023 21:35:27 +0900 Subject: [PATCH] [v2.3.1+1.19] bump version (#52) * bump fabric deps * bump mod deps * use BlockEntityRendererFactories instead * bump version * setup release plugin * add release workflow --- .github/workflows/build.yaml | 8 -- .github/workflows/release.yaml | 32 ++++++++ build.gradle | 74 ++++++++++++++----- gradle.properties | 25 +++---- .../ReinforcedShulkerBoxesClientMod.java | 4 +- 5 files changed, 103 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7ca3ebd..999542b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,13 +1,5 @@ -# Automatically build the project and run any configured tests for every push -# and submitted pull request. This can help catch issues that only occur on -# certain platforms or Java versions, and provides a first line of defence -# against bad commits. - name: build on: - push: - tags: - - v[0-9]+.[0-9]+.[0-9]+* pull_request: branches: - 1.[0-9]+ diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..514657d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +name: release +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+* + +jobs: + build: + runs-on: ubuntu-22.04 + env: + JAVA_VERSION: 17 + ORG_GRADLE_PROJECT_curseforge_token: ${{ secrets.CURSEFORGE_TOKEN }} + ORG_GRADLE_PROJECT_modrinth_token: ${{ secrets.MODRINTH_TOKEN }} + steps: + - name: checkout repository + uses: actions/checkout@v3 + - name: validate gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: setup jdk ${{ env.JAVA_VERSION }} + uses: actions/setup-java@v3 + with: + java-version: ${{ env.JAVA_VERSION }} + distribution: "microsoft" + - name: make gradle wrapper executable + run: chmod +x ./gradlew + - name: release + run: ./gradlew build curseforge modrinth + - name: capture build artifacts + uses: actions/upload-artifact@v3 + with: + name: Artifacts + path: build/libs/ diff --git a/build.gradle b/build.gradle index 3633cf2..80256d7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,8 @@ plugins { - id 'fabric-loom' version '1.0-SNAPSHOT' - id 'maven-publish' + id "fabric-loom" version "1.0-SNAPSHOT" + id "maven-publish" + id "com.matthewprenger.cursegradle" version "1.4.0" + id "com.modrinth.minotaur" version "2.+" } sourceCompatibility = JavaVersion.VERSION_17 @@ -37,15 +39,6 @@ repositories { url "https://maven.kyrptonaught.dev" } - // <-- workaround - maven { - url "https://www.cursemaven.com" - content { - includeGroup "curse.maven" - } - } - // --> - // Shulker Box Tooltip maven { url "https://maven.misterpemodder.com/libs-release" @@ -74,12 +67,7 @@ dependencies { modImplementation "atonkish.reinfchest:reinforced-chests:${project.reinforced_chests_version}" // Quick Shulker - // modImplementation "net.kyrptonaught:quickshulker:${project.quick_shulker_version}" - // <-- workaround - modImplementation "curse.maven:quick-shulker-362669:${project.quick_shulker_file_id}" - modImplementation "net.kyrptonaught:kyrptconfig:${project.kyrptconfig_version}" - modImplementation "net.kyrptonaught:shulkerutils:${project.shulkerutils_version}" - // --> + modImplementation "net.kyrptonaught:quickshulker:${project.quick_shulker_version}" // Shulker Box Tooltip modImplementation "com.misterpemodder:shulkerboxtooltip-fabric:${project.shulker_box_tooltip_version}" @@ -130,3 +118,55 @@ publishing { } } } + +curseforge { + apiKey = project.findProperty("curseforge_token") ?: "Missing token" + + project { + id = project.curseforge_id + + mainArtifact(remapJar) { + displayName = "Reinforced Shulker Boxes v${project.version}" + } + releaseType = "release" + changelogType = "markdown" + changelog = "[v${project.version}](https://github.com/Aton-Kish/reinforced-shulker-boxes/releases/tag/v" + java.net.URLEncoder.encode(project.version, "UTF-8") + ")" + + addGameVersion "Fabric" + addGameVersion "Java 17" + addGameVersion "1.19.3" + + relations { + requiredDependency "fabric-api" + embeddedLibrary "cloth-config" + optionalDependency "modmenu" + optionalDependency "shulkerboxtooltip" + optionalDependency "quick-shulker" + optionalDependency "reinforced-chests" + } + } +} + +modrinth { + token = project.findProperty("modrinth_token") ?: "Missing token" + + projectId = project.modrinth_id + + uploadFile = remapJar + versionNumber = project.version + versionName = "Reinforced Shulker Boxes v${project.version}" + versionType = "release" + changelog = "[v${project.version}](https://github.com/Aton-Kish/reinforced-shulker-boxes/releases/tag/v" + java.net.URLEncoder.encode(project.version, "UTF-8") + ")" + + gameVersions = ["1.19.3"] + loaders = ["fabric"] + + dependencies { + required.project "fabric-api" + embedded.project "cloth-config" + optional.project "modmenu" + optional.project "shulkerboxtooltip" + optional.project "quickshulker" + optional.project "reinforced-chests" + } +} diff --git a/gradle.properties b/gradle.properties index 7c42572..e3e8025 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,22 +5,21 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.19.3 - yarn_mappings=1.19.3+build.3 - loader_version=0.14.11 + yarn_mappings=1.19.3+build.5 + loader_version=0.14.14 # Mod Properties - mod_version=2.3.0+1.19 + mod_version=2.3.1+1.19 maven_group=atonkish.reinfshulker archives_base_name=reinforced-shulker-boxes # Dependencies - fabric_version=0.69.1+1.19.3 - reinforced_core_version=3.0.4+1.19 - reinforced_chests_version=2.3.0+1.19 - # quick_shulker_version=1.3.10-1.19.3 - # <-- workaround - quick_shulker_file_id=4171682 - kyrptconfig_version=1.5.1-1.19.3 - shulkerutils_version=1.0.4-1.19 - # --> - shulker_box_tooltip_version=3.2.3+1.19.3 + fabric_version=0.74.0+1.19.3 + reinforced_core_version=3.0.5+1.19 + reinforced_chests_version=2.3.1+1.19 + quick_shulker_version=1.3.10-1.19.3 + shulker_box_tooltip_version=3.2.4+1.19.3 + +# Distribution platform + curseforge_id=529874 + modrinth_id=xlOwuSdN diff --git a/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesClientMod.java b/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesClientMod.java index 8417f9b..1b29f99 100644 --- a/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesClientMod.java +++ b/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesClientMod.java @@ -2,7 +2,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry; import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; import net.fabricmc.loader.api.FabricLoader; @@ -10,6 +9,7 @@ import net.minecraft.block.entity.BlockEntity; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.block.entity.BlockEntityRendererFactories; import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; @@ -63,7 +63,7 @@ private static void initializeReinforcedShulkerBoxesClient() { material); // Block Entity Renderer - BlockEntityRendererRegistry + BlockEntityRendererFactories .register(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material), ReinforcedShulkerBoxBlockEntityRenderer::new);