Skip to content

Commit

Permalink
port 1.19.2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnt committed Jun 14, 2023
1 parent a0b3a6b commit e2edbac
Show file tree
Hide file tree
Showing 25 changed files with 423 additions and 155 deletions.
245 changes: 178 additions & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,23 @@ env:
JAVA_VERSION: 17
MOD_ID: 'almostunified'
MOD_NAME: 'AlmostUnified'
CURSEFORGE_ID: '633823'
MODRINTH_ID: 'sdaSaQEz'

jobs:
release:
name: Release

build:
name: Build, collect info, parse changelog
runs-on: ubuntu-latest
outputs:
JAR_FILE: ${{ steps.collect_info.outputs.JAR_FILE }}
MINECRAFT_VERSION: ${{ steps.collect_info.outputs.MINECRAFT_VERSION }}
MOD_VERSION: ${{ steps.collect_info.outputs.MOD_VERSION }}
RELEASE_TYPE: ${{ steps.collect_info.outputs.RELEASE_TYPE }}
steps:
- name: Clone Repository
uses: actions/checkout@v3

- name: Check Secrets
run: |
if [ -z "${{ secrets.MODRINTH_TOKEN }}" ]; then
echo "MODRINTH_TOKEN is not set"
exit 1
fi
if [ -z "${{ secrets.CURSEFORGE_TOKEN }}" ]; then
echo "CURSEFORGE_TOKEN is not set"
exit 1
fi
- name: Validate Modrinth Token
run: |
if [ -n "$(curl -s -H "Authorization: ${{ secrets.MODRINTH_TOKEN }}" https://api.modrinth.com/v2/user | grep "unauthorized")" ]; then
echo "Modrinth Token is invalid!"
exit 1
fi
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
Expand All @@ -59,21 +49,22 @@ jobs:
- name: Assemble the JARs
run: ./gradlew assemble

- name: Move JARs to build directory
- name: Move JARs to central directory
run: |
mkdir -p build/libs
mv -f Forge/build/libs/*.jar build/libs
mv -f Fabric/build/libs/*.jar build/libs
mkdir output
mv -f Forge/build/libs/*.jar Fabric/build/libs/*.jar output/
rm -f output/*-dev-shadow.jar output/*-sources.jar
- name: Collect version information
id: collect_info
run: |
shopt -s failglob # print a warning if a glob does not match anything
set_var() {
echo $1="$2"
echo $1="$2" >> $GITHUB_ENV
echo $1="$2" >> $GITHUB_OUTPUT
declare -g $1="$2"
}
set_var JAR_FILE $(eval echo build/libs/${{ env.MOD_ID }}-*-*-*.jar)
set_var JAR_FILE $(eval echo output/${{ env.MOD_ID }}-*-*-*.jar)
set_var MINECRAFT_VERSION $(echo ${JAR_FILE%.*} | cut -d- -f3)
set_var MOD_VERSION $(echo ${JAR_FILE%.*} | cut -d- -f4)
set_var RELEASE_TYPE "$(echo ${GITHUB_REF##*/} | cut -d- -f3)"
Expand All @@ -83,68 +74,188 @@ jobs:
uses: taiki-e/install-action@parse-changelog

- name: Parse changelog
run: parse-changelog CHANGELOG.md ${{ env.MOD_VERSION }} > changes.md
run: parse-changelog CHANGELOG.md ${{ steps.collect_info.outputs.MOD_VERSION }} > output/changelog.md

- name: Release Fabric to CF and MR
uses: Kir-Antipov/mc-publish@v3.2
- name: Archive results
run: tar -zcvf build.tar.gz output

- name: Upload results
uses: actions/upload-artifact@v3
with:
curseforge-id: 633823
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-id: sdaSaQEz
name: build-artifacts
path: build.tar.gz
if-no-files-found: error
retention-days: 3

- name: Job Summary
run: |
echo "# Version Information" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- Minecraft Version: ${{ steps.collect_info.outputs.MINECRAFT_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- Mod Version: ${{ steps.collect_info.outputs.MOD_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- Release Type: ${{ steps.collect_info.outputs.RELEASE_TYPE }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Build Information" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- JAR files: $(find output -maxdepth 1 -type f -name '*.jar' | wc -c)" >> $GITHUB_STEP_SUMMARY
echo "- Folder size: $(du -sh output | cut -f1)" >> $GITHUB_STEP_SUMMARY
echo "- Archive size: $(du -sh build.tar.gz | cut -f1)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "# Changelog" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat output/changelog.md >> $GITHUB_STEP_SUMMARY
mr-fabric-release:
name: Modrinth Fabric Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Extract build artifacts
run: tar -zxvf build.tar.gz

- name: Release Fabric on Modrinth
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: ${{ env.MODRINTH_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files: build/libs/${{ env.MOD_ID }}-fabric-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar
name: ${{ env.MOD_NAME }}-Fabric-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}
version: ${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}+fabric
version-type: ${{ env.RELEASE_TYPE }}
changelog-file: changes.md
files: output/*fabric*.jar
name: ${{ env.MOD_NAME }}-Fabric-${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}
version: ${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}+fabric
version-type: ${{ needs.build.outputs.RELEASE_TYPE }}
changelog-file: output/changelog.md

loaders: fabric
game-versions: ${{ env.MINECRAFT_VERSION }}
version-resolver: exact
game-versions: ${{ needs.build.outputs.MINECRAFT_VERSION }}
java: ${{ env.JAVA_VERSION }}

dependencies: |
roughly-enough-items | suggests | *
jei | suggests | *
jei(optional){curseforge:238222}{modrinth:u6dRKJwZ}
rei(optional){curseforge:310111}{modrinth:nfn13YXA}
cf-fabric-release:
name: CurseForge Fabric Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts

retry-attempts: 2
retry-delay: 10000
- name: Extract build artifacts
run: tar -zxvf build.tar.gz

- name: Release Forge to CF and MR
uses: Kir-Antipov/mc-publish@v3.2
- name: Release Fabric on CurseForge
uses: Kir-Antipov/mc-publish@v3.3
with:
curseforge-id: 633823
curseforge-id: ${{ env.CURSEFORGE_ID }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-id: sdaSaQEz

files: output/*fabric*.jar
name: ${{ env.MOD_NAME }}-Fabric-${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}
version: ${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}+fabric
version-type: ${{ needs.build.outputs.RELEASE_TYPE }}
changelog-file: output/changelog.md

loaders: fabric
game-versions: ${{ needs.build.outputs.MINECRAFT_VERSION }}
java: ${{ env.JAVA_VERSION }}

dependencies: |
jei(optional){curseforge:238222}{modrinth:u6dRKJwZ}
rei(optional){curseforge:310111}{modrinth:nfn13YXA}
mr-forge-release:
name: Modrinth Forge Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Extract build artifacts
run: tar -zxvf build.tar.gz

- name: Release Forge on Modrinth
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: ${{ env.MODRINTH_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files: build/libs/${{ env.MOD_ID }}-forge-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar
name: ${{ env.MOD_NAME }}-Forge-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}
version: ${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}+forge
version-type: ${{ env.RELEASE_TYPE }}
changelog-file: changes.md
files: output/*forge*.jar
name: ${{ env.MOD_NAME }}-Forge-${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}
version: ${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}+forge
version-type: ${{ needs.build.outputs.RELEASE_TYPE }}
changelog-file: output/changelog.md

loaders: forge
game-versions: ${{ env.MINECRAFT_VERSION }}
version-resolver: exact
game-versions: ${{ needs.build.outputs.MINECRAFT_VERSION }}
java: ${{ env.JAVA_VERSION }}

dependencies: |
roughly-enough-items | suggests | *
jei | suggests | *
jei(optional){curseforge:238222}{modrinth:u6dRKJwZ}
rei(optional){curseforge:310111}{modrinth:nfn13YXA}
cf-forge-release:
name: CurseForge Forge Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts

- name: Extract build artifacts
run: tar -zxvf build.tar.gz

- name: Release Forge on CurseForge
uses: Kir-Antipov/mc-publish@v3.3
with:
curseforge-id: ${{ env.CURSEFORGE_ID }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

files: output/*forge*.jar
name: ${{ env.MOD_NAME }}-Forge-${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}
version: ${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}+forge
version-type: ${{ needs.build.outputs.RELEASE_TYPE }}
changelog-file: output/changelog.md

loaders: forge
game-versions: ${{ needs.build.outputs.MINECRAFT_VERSION }}
java: ${{ env.JAVA_VERSION }}

dependencies: |
jei(optional){curseforge:238222}{modrinth:u6dRKJwZ}
rei(optional){curseforge:310111}{modrinth:nfn13YXA}
github-release:
name: GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts

retry-attempts: 2
retry-delay: 10000
- name: Extract build artifacts
run: tar -zxvf build.tar.gz

- name: Release to GitHub
uses: Kir-Antipov/mc-publish@v3.2
- name: Release on GitHub
uses: Kir-Antipov/mc-publish@v3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: build/libs/${{ env.MOD_ID }}-*-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar
name: v${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}
version: ${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}
version-type: ${{ env.RELEASE_TYPE }}
changelog-file: changes.md
retry-attempts: 2
retry-delay: 10000
files: output/*.jar
name: v${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}
version: ${{ needs.build.outputs.MINECRAFT_VERSION }}-${{ needs.build.outputs.MOD_VERSION }}
version-type: ${{ needs.build.outputs.RELEASE_TYPE }}
changelog-file: output/changelog.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ extra-mods-*
*.log.gz
eclipse
run
.architectury-transformer
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog],
and this project adheres to [Semantic Versioning].

## [0.5.0] - 2023-06-14

### Added
- repair unification for `TieredItems` (tools) and `ArmorItems` ([#53])
- supports vanilla Anvil
- works for all mods as long as they properly call the super method
- simplified Chinese translation ([#49])
- shaped recipe type from Cucumber lib for Fabric to ignored types ([#52])

<!-- Links -->
[#49]: https://github.com/AlmostReliable/almostunified/issues/49
[#52]: https://github.com/AlmostReliable/almostunified/pull/52
[#53]: https://github.com/AlmostReliable/almostunified/issues/53

## [0.4.4] - 2023-05-04

### Added
Expand Down Expand Up @@ -81,6 +95,7 @@ Initial 1.19.4 release!
[semantic versioning]: https://semver.org/spec/v2.0.0.html

<!-- Versions -->
[0.5.0]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.19.3-0.5.0-beta
[0.4.4]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.19.4-0.4.4-beta
[0.4.3]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.19.4-0.4.3-beta
[0.4.2]: https://github.com/AlmostReliable/almostunified/releases/tag/v1.19.4-0.4.2-beta
Expand Down
15 changes: 9 additions & 6 deletions Common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ val junitVersion: String by project
val minecraftVersion: String by project

plugins {
id("com.github.gmazzo.buildconfig") version ("3.1.0")
id("com.github.gmazzo.buildconfig") version ("4.0.4")
}

architectury {
Expand All @@ -26,17 +26,19 @@ loom {
}

dependencies {
// loader
// required here for the @Environment annotations and the mixin dependencies
// Do NOT use other classes from the Fabric loader!
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")

// compile time mods
modCompileOnly("me.shedaniel:RoughlyEnoughItems-api:$reiVersion") // required for common rei plugin
compileOnly("me.shedaniel:REIPluginCompatibilities-forge-annotations:9.+") // required to disable rei compat layer on jei plugin
testCompileOnly("me.shedaniel:REIPluginCompatibilities-forge-annotations:9.+") // don't question this, it's required for compiling
modCompileOnly("mezz.jei:jei-$minecraftVersion-lib:$jeiVersion") // required for common jei plugin and mixin
modCompileOnly("mezz.jei:jei-$minecraftVersion-common-api:$jeiVersion") // required for common jei plugin and mixin

// The Fabric loader is required here to use the @Environment annotations and to get the mixin dependencies.
// Do NOT use other classes from the Fabric loader!
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")

// JUnit Tests
// tests
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}
Expand All @@ -46,6 +48,7 @@ buildConfig {
buildConfigField("String", "MOD_NAME", "\"$modName\"")
buildConfigField("String", "MOD_VERSION", "\"$version\"")
packageName(modPackage)
useJavaOutput()
}

// TODO reactivate when specific mod is not annoying anymore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ public static List<String> getTags(Platform platform) {

public static List<String> getIgnoredRecipeTypes(Platform platform) {
return switch (platform) {
case FORGE -> List.of("cucumber:shaped_tag");
case FABRIC -> List.of();
default -> List.of("cucumber:shaped_tag");
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AlmostMixinPlugin implements IMixinConfigPlugin {

private static final BooleanSupplier TRUE = () -> true;
private static final Map<String, BooleanSupplier> CONDITIONS = ImmutableMap.of(
"com.almostreliable.unified.mixin.JeiRecipeLayoutMixin", modLoaded(ModConstants.JEI)
"com.almostreliable.unified.mixin.compat.JeiRecipeLayoutMixin", modLoaded(ModConstants.JEI)
);

private static BooleanSupplier modLoaded(String id) {
Expand Down
Loading

0 comments on commit e2edbac

Please sign in to comment.