Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
dima_dencep committed Mar 19, 2023
1 parent bafbd8d commit dd21dd9
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:

- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -23,6 +25,21 @@ jobs:
- name: Upload assets to releases
run: ./gradlew build

#- name: Build Changelog
# id: build_changelog
# uses: mikepenz/release-changelog-builder-action@v3
# with:
# failOnError: false
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Read value from Properties-file
id: read_property
uses: christian-draeger/[email protected]
with:
path: './gradle.properties'
properties: 'archives_base_name mod_version minecraft_version cloth_config_version'

- name: Publish Forge to Modrinth & CurseForge
uses: Kir-Antipov/[email protected]
with:
Expand All @@ -33,17 +50,21 @@ jobs:
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

files-primary: forge/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar
files-secondary: forge/build/libs/*-@(dev|sources|javadoc|shadow).jar
files-secondary: forge/build/libs/*-@(dev|sources|javadoc).jar

name: ${{ steps.read_property.outputs.archives_base_name }} ${{ steps.read_property.outputs.mod_version }} Forge ${{ steps.read_property.outputs.minecraft_version }}

#changelog: ${{steps.build_changelog.outputs.changelog}}

version-type: release

loaders: forge

game-versions: |
1.18.2
${{ steps.read_property.outputs.minecraft_version }}
dependencies: |
cloth-config | includes | 6.4.90
cloth-config | includes | ${{ steps.read_property.outputs.cloth_config_version }}
java: |
17
Expand All @@ -58,18 +79,33 @@ jobs:
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

files-primary: fabric/build/libs/!(*-@(dev|sources|javadoc|shadow)).jar
files-secondary: fabric/build/libs/*-@(dev|sources|javadoc|shadow).jar
files-secondary: fabric/build/libs/*-@(dev|sources|javadoc).jar

name: ${{ steps.read_property.outputs.archives_base_name }} ${{ steps.read_property.outputs.mod_version }} Fabric ${{ steps.read_property.outputs.minecraft_version }}

#changelog: ${{steps.build_changelog.outputs.changelog}}

version-type: release

loaders: fabric

game-versions: |
1.18.2
${{ steps.read_property.outputs.minecraft_version }}
dependencies: |
fabric-api | depends | *
cloth-config | includes | 6.4.90
cloth-config | includes | ${{ steps.read_property.outputs.cloth_config_version }}
modmenu | recommends | *
java: |
17
- name: Create Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ steps.read_property.outputs.minecraft_version }}-${{ steps.read_property.outputs.mod_version }}"
prerelease: false
title: "${{ steps.read_property.outputs.archives_base_name }} ${{ steps.read_property.outputs.mod_version }}"
files: |
fabric/build/libs/*
forge/build/libs/*
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.toast.SystemToast;
import net.minecraft.client.toast.ToastManager;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -31,7 +32,7 @@ public void onResourceReloadFailure(Throwable exception, Text resourceName, Call
if (!MainMod.config.resetResources) {
this.reloadResources(true).thenRun(() -> {
ToastManager toastManager = this.getToastManager();
SystemToast.show(toastManager, SystemToast.Type.PACK_LOAD_FAILURE, Text.translatable("resourcePack.load_fail"), resourceName == null ? Text.translatable("gui.all") : resourceName);
SystemToast.show(toastManager, SystemToast.Type.PACK_LOAD_FAILURE, new TranslatableText("resourcePack.load_fail"), resourceName == null ? new TranslatableText("gui.all") : resourceName);
});

ci.cancel();
Expand All @@ -49,7 +50,7 @@ public void reloadResources(CallbackInfoReturnable<CompletableFuture<Void>> cir)
if (MainMod.reloadHandler.getReload() != null) {
cir.setReturnValue(CompletableFuture.runAsync(() -> {
ToastManager toastManager = this.getToastManager();
SystemToast.show(toastManager, SystemToast.Type.PACK_LOAD_FAILURE, Text.translatable("resourcePack.load_fail"), Text.translatable("rrls.alreadyReloading"));
SystemToast.show(toastManager, SystemToast.Type.PACK_LOAD_FAILURE, new TranslatableText("resourcePack.load_fail"), new TranslatableText("rrls.alreadyReloading"));
}));
}
}
Expand Down

0 comments on commit dd21dd9

Please sign in to comment.