From ff09eb3fe7d7789e1c7e98a28951bdd1c088cf42 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 3 Jul 2023 20:14:43 +0200 Subject: [PATCH 1/3] feat: port to minecraft 1.20.1 --- CHANGELOG.md | 4 ++++ helper.gradle | 15 +++++++++------ .../build.gradle | 8 ++++---- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6179f5c..e7d012b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed + +- Ported to Minecraft 1.20.1 + ## [0.4.2] - 2023-06-20 ### Fixed diff --git a/helper.gradle b/helper.gradle index a35c3d6..d360da1 100644 --- a/helper.gradle +++ b/helper.gradle @@ -72,11 +72,14 @@ subprojects { } ext { - minecraftVersion = "1.19.4" + minecraftVersion = "1.20.1" + forgeVersion = "47.0.35" + fabricLoaderVersion = "0.14.21" + fabricApiVersion = "0.85.0+1.20.1" // https://www.curseforge.com/minecraft/mc-mods/jei/files - jeiVersion = "13.1.0.11" + jeiVersion = "15.2.0.22" // https://www.curseforge.com/minecraft/mc-mods/roughly-enough-items/files - reiVersion = "11.0.603" + reiVersion = "12.0.626" architecturyVersion = "8.1.73" // dependency of rei clothMathVersion = "0.6.1" // dependency of rei clothConfigVersion = "10.0.96" // dependency of rei @@ -189,7 +192,7 @@ subprojects { } } dependencies { - minecraft "net.minecraftforge:forge:${minecraftVersion}-45.0.64" + minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}" apis.collect { implementation project(it) } @@ -227,8 +230,8 @@ subprojects { officialMojangMappings() parchment("org.parchmentmc.data:parchment-1.19.3:2023.03.12@zip") } - modImplementation "net.fabricmc:fabric-loader:0.14.21" - modImplementation "net.fabricmc.fabric-api:fabric-api:0.82.0+1.19.4" + modImplementation "net.fabricmc:fabric-loader:${fabricLoaderVersion}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${fabricApiVersion}" apis.collect { implementation project(it) include project(it) diff --git a/refinedarchitect-catalog-platform-fabric/build.gradle b/refinedarchitect-catalog-platform-fabric/build.gradle index 4412fd8..01155bc 100644 --- a/refinedarchitect-catalog-platform-fabric/build.gradle +++ b/refinedarchitect-catalog-platform-fabric/build.gradle @@ -18,16 +18,16 @@ catalog { library("jei-api", "mezz.jei", "jei-${minecraftVersion}-fabric-api").version(jeiVersion) library("jei-impl", "mezz.jei", "jei-${minecraftVersion}-fabric").version(jeiVersion) - // https://www.curseforge.com/minecraft/mc-mods/modmenu/files - def modmenu = version("modmenu", "6.2.2") + // https://modrinth.com/mod/modmenu + def modmenu = version("modmenu", "7.1.0") library("modmenu", "com.terraformersmc", "modmenu").versionRef(modmenu) // https://www.curseforge.com/minecraft/mc-mods/wthit/files - def wthit = version("wthit", "fabric-7.3.1") + def wthit = version("wthit", "fabric-8.1.1") library("wthit", "mcp.mobius.waila", "wthit").versionRef(wthit) // https://www.curseforge.com/minecraft/mc-mods/no-indium/files - def noIndium = version("noIndium", "1.1.0+1.19.4") + def noIndium = version("noIndium", "1.1.0+1.20") library("noIndium", "me.luligabi", "NoIndium").versionRef(noIndium) } } From d20715258f3521f59421c53a1155b03d81c02163 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 3 Jul 2023 21:04:22 +0200 Subject: [PATCH 2/3] feat: curseforge upload support Removes twitter announce as well. --- .github/workflows/publish-release.yml | 36 ++++++++------- .gitignore | 2 + CHANGELOG.md | 4 ++ helper.gradle | 63 ++++++++++++++++++++++----- 4 files changed, 79 insertions(+), 26 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 25fb989..fc7fb18 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -17,6 +17,10 @@ on: required: false type: boolean default: true + curseforge: + required: false + type: boolean + default: false jobs: extract-version-number: name: Extract version number @@ -126,6 +130,23 @@ jobs: files: | **/build/libs/*.jar + deploy-curseforge: + name: Deploy to CurseForge + runs-on: ubuntu-latest + needs: [ build, extract-version-number, extract-changelog ] + if: ${{ inputs.curseforge == true }} + env: + RELEASE_VERSION: ${{ needs.extract-version-number.outputs.version }} + RELEASE_CHANGELOG: ${{ needs.extract-changelog.outputs.changelog }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Java + uses: refinedmods/refinedarchitect/.github/actions/setup-java@develop + - name: Deploy to CurseForge + run: ./gradlew publishCurseForge + announce-discord: name: Announce to Discord runs-on: ubuntu-latest @@ -143,21 +164,6 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - announce-twitter: - name: Announce to Twitter - runs-on: ubuntu-latest - needs: [ deploy-github-releases, extract-version-number ] - if: ${{ inputs.announce == true }} - steps: - - name: Announce to Twitter - uses: ethomson/send-tweet-action@v1 - with: - status: ${{ inputs.project-name }} v${{ needs.extract-version-number.outputs.version }} has been released! ${{ needs.deploy-github-releases.outputs.release-url }} - consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} - consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} - access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - announce-mastodon: name: Announce to Mastodon runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 924b02b..5b4bff5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ out/ /bin/ logs/ .cache/ +refinedarchitect-test/ +refinedarchitect-test-fabric/ diff --git a/CHANGELOG.md b/CHANGELOG.md index e7d012b..e28335d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- CurseForge upload support. + ### Changed - Ported to Minecraft 1.20.1 diff --git a/helper.gradle b/helper.gradle index d360da1..31ee6e2 100644 --- a/helper.gradle +++ b/helper.gradle @@ -13,6 +13,10 @@ buildscript { name = 'Fabric' url = 'https://maven.fabricmc.net/' } + maven { + name = 'CurseForgeGradle' + url "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.9.11' @@ -20,6 +24,7 @@ buildscript { classpath 'org.spongepowered:vanillagradle:0.2.1-SNAPSHOT' classpath 'net.minecraftforge.gradle:ForgeGradle:[6.0,6.2)' classpath 'fabric-loom:fabric-loom.gradle.plugin:1.2-SNAPSHOT' + classpath 'net.darkhax.curseforgegradle:CurseForgeGradle:1.1.15' } } @@ -48,6 +53,7 @@ subprojects { it.options.encoding = 'UTF-8' it.options.release.set(17) it.options.deprecation = true + it.options.compilerArgs << "-Xmaxerrs" << "999" } repositories { @@ -131,6 +137,18 @@ subprojects { } } + ext.enableCurseForgePublishing = { int projectId -> + task publishCurseForge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) { + apiToken = System.getenv("CURSEFORGE_TOKEN") + debugMode = true + + def mainFile = upload(projectId, jar) + mainFile.releaseType = project.version.toString().contains('beta') ? 'beta' : (project.version.toString().contains('alpha') ? 'alpha' : 'release') + mainFile.changelog = System.getenv("RELEASE_CHANGELOG") + mainFile.changelogType = 'markdown' + } + } + ext.commonProject = { apply plugin: org.spongepowered.gradle.vanilla.VanillaGradle minecraft { @@ -144,7 +162,7 @@ subprojects { } } - ext.forgeProject = { String modId, Project commonProject, ArrayList apis = [], ArrayList compileApis = [] -> + ext.forgeProject = { String modId, Project commonProject = null, ArrayList apis = [], ArrayList compileApis = [] -> apply plugin: net.minecraftforge.gradle.userdev.UserDevPlugin minecraft { mappings channel: 'official', version: minecraftVersion @@ -163,7 +181,9 @@ subprojects { compileApis.collect { source(project(it).sourceSets.main) } - source(commonProject.sourceSets.main) + if (commonProject != null) { + source(commonProject.sourceSets.main) + } } } } @@ -180,12 +200,16 @@ subprojects { compileApis.collect { source(project(it).sourceSets.main) } - source(commonProject.sourceSets.main) + if (commonProject != null) { + source(commonProject.sourceSets.main) + } } } } data { - args '--mod', modId, '--all', '--output', commonProject.file('src/generated/resources'), "--existing", commonProject.file('src/main/resources') + var destinationProject = commonProject != null ? commonProject : project + var existingProject = commonProject != null ? commonProject : project + args '--mod', modId, '--all', '--output', destinationProject.file('src/generated/resources'), "--existing", existingProject.file('src/main/resources') ideaModule "${rootProject.name}.${project.name}.main" taskName 'Data' } @@ -199,10 +223,18 @@ subprojects { compileApis.collect { implementation project(it) } - implementation commonProject + if (commonProject != null) { + implementation commonProject + } + } + sourceSets { + main.resources.srcDirs += 'src/generated/resources' } processResources { - from commonProject.sourceSets.main.resources + if (commonProject != null) { + from commonProject.sourceSets.main.resources + } + from project.sourceSets.main.resources } tasks.withType(JavaCompile) { apis.collect { @@ -211,12 +243,14 @@ subprojects { compileApis.collect { source(project(it).sourceSets.main.allSource) } - source(commonProject.sourceSets.main.allSource) + if (commonProject != null) { + source(commonProject.sourceSets.main.allSource) + } } jar.finalizedBy('reobfJar') } - ext.fabricProject = { String modId, Project commonProject, ArrayList apis = [], ArrayList compileApis = [] -> + ext.fabricProject = { String modId, Project commonProject = null, ArrayList apis = [], ArrayList compileApis = [] -> repositories { maven { name = 'Parchment' @@ -239,16 +273,23 @@ subprojects { compileApis.collect { implementation project(it) } - implementation commonProject + if (commonProject != null) { + implementation commonProject + } } processResources { - from commonProject.sourceSets.main.resources + if (commonProject != null) { + from commonProject.sourceSets.main.resources + } + from project.sourceSets.main.resources } tasks.withType(JavaCompile) { compileApis.collect { source(project(it).sourceSets.main.allSource) } - source(commonProject.sourceSets.main.allSource) + if (commonProject != null) { + source(commonProject.sourceSets.main.allSource) + } } jar { from '../LICENSE.md' From cebce983ccc1a0025c4e6ffda6377b84405283be Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Mon, 3 Jul 2023 19:09:36 +0000 Subject: [PATCH 3/3] chore: prepare release v0.5.0 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e28335d..638f2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.5.0] - 2023-07-03 + ### Added - CurseForge upload support. @@ -76,7 +78,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Gradle helpers for Fabric and Forge projects. - CI workflows. -[Unreleased]: https://github.com/refinedmods/refinedarchitect/compare/v0.4.2...HEAD +[Unreleased]: https://github.com/refinedmods/refinedarchitect/compare/v0.5.0...HEAD + +[0.5.0]: https://github.com/refinedmods/refinedarchitect/compare/v0.4.2...v0.5.0 [0.4.2]: https://github.com/refinedmods/refinedarchitect/compare/v0.4.1...v0.4.2