diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23627fd..68f3ae5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,37 +4,38 @@ # against bad commits. name: build -on: [pull_request, push] +on: [ pull_request, push ] jobs: build: strategy: matrix: # Use these Java versions - java: [ - 17 - ] + java: [ 17 ] # and run on both Linux and Windows - os: [ubuntu-20.04, windows-latest] + os: [ ubuntu-20.04 ] runs-on: ${{ matrix.os }} steps: - name: checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3.4.0 - name: validate gradle wrapper uses: gradle/wrapper-validation-action@v1 - name: setup jdk ${{ matrix.java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v3.10.0 with: - distribution: adopt + distribution: 'temurin' java-version: ${{ matrix.java }} - name: make gradle wrapper executable if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew - name: build run: ./gradlew build + - name: Retrieve Version #https://stackoverflow.com/questions/71089787/how-to-get-version-name-from-android-gradle-file-in-github-actions + run: | + echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_ENV + echo "GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_ENV - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3.1.2 with: - name: Artifacts - path: build/libs/ + name: ${{ env.VERSION_INFORMATION }} [${{ env.GIT_HASH }}] #https://stackoverflow.com/questions/58886293/getting-current-branch-and-commit-hash-in-github-action + path: build/libs/ \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c6f6927..9b44503 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,4 @@ +name: publish on: push: tags: @@ -8,34 +9,41 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3.4.0 - name: validate gradle wrapper uses: gradle/wrapper-validation-action@v1 - name: setup jdk 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3.10.0 with: - distribution: adopt + distribution: 'temurin' java-version: 17 - name: make gradle wrapper executable run: chmod +x ./gradlew - name: build run: ./gradlew build + - name: Retrieve Version #https://stackoverflow.com/questions/71089787/how-to-get-version-name-from-android-gradle-file-in-github-actions + run: | + echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q printVersionName)" >> $GITHUB_ENV + echo "VERSION_PLAIN=$(${{github.workspace}}/gradlew -q printVersion)" >> $GITHUB_ENV - name: Publish Minecraft Mods uses: Kir-Antipov/mc-publish@v3.2 with: - version-type: alpha - modrinth-id: etNS9OnA - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - modrinth-featured: true - modrinth-unfeature-mode: subset - - curseforge-id: 643246 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + version-type: beta + changelog-file: CHANGELOG.md + name: ${{ env.VERSION_INFORMATION }} + version: ${{ env.VERSION_PLAIN }} game-versions: | - 1.19.2 + 1.19.4 loaders: | fabric - changelog-file: CHANGELOG.md \ No newline at end of file + modrinth-id: etNS9OnA + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + modrinth-featured: true + modrinth-unfeature-mode: subset + + + curseforge-id: 643246 + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index fd42e48..ee3dfb1 100644 --- a/build.gradle +++ b/build.gradle @@ -66,6 +66,18 @@ java { withSourcesJar() } +tasks.register('printVersionName') { + doLast { + println "${version.split("-")[0]} (${version.split("-")[1]})" + } +} + +tasks.register('printVersion') { + doLast { + println version + } +} + jar { from("LICENSE") { rename { "${it}_${project.archivesBaseName}" } diff --git a/gradle.properties b/gradle.properties index f02cfb3..e6d4ee4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ loader_version=0.14.19 mod_version=0.9.1-1.19.2 maven_group=me.melontini archives_base_name=recipe-book-is-pain -cracker_util=v0.3.2-1.19.2 +cracker_util=v0.3.3-1.19.2 diff --git a/src/main/java/me/melontini/recipebookispain/mixin/ClientRecipeBookMixin.java b/src/main/java/me/melontini/recipebookispain/mixin/ClientRecipeBookMixin.java index b74cc32..8867c5d 100644 --- a/src/main/java/me/melontini/recipebookispain/mixin/ClientRecipeBookMixin.java +++ b/src/main/java/me/melontini/recipebookispain/mixin/ClientRecipeBookMixin.java @@ -1,6 +1,5 @@ package me.melontini.recipebookispain.mixin; -import me.melontini.crackerutil.CrackerLog; import me.melontini.crackerutil.util.EnumWrapper; import me.melontini.recipebookispain.RecipeBookIsPainClient; import net.minecraft.client.recipebook.ClientRecipeBook; @@ -43,7 +42,7 @@ public class ClientRecipeBookMixin { RecipeBookGroup.SEARCH_MAP.get(RecipeBookGroup.CRAFTING_SEARCH).addAll(CRAFTING_SEARCH_LIST); RecipeBookGroup.CRAFTING.clear(); RecipeBookGroup.CRAFTING.addAll(CRAFTING_LIST); - CrackerLog.info("Finished setting up recipe book groups!"); + RecipeBookIsPainClient.LOGGER.info("[RBIP] Finished setting up recipe book groups!"); } @Inject(at = @At("HEAD"), method = "getGroupForRecipe", cancellable = true)