chore: remove PKPCPBP and use mod-publish-plugin - #1215
Conversation
|
I've tested this version on a temporary private modrinth project created for testing, and it works well. However, since I can't easily get a curseforge access token, I can't test the curseforge part. |
There was a problem hiding this comment.
This is a good start, but I'd like to improve the publishing flow a bit more while we're here, and I'd still like to use PKPCPBP's JSON flattening. Also:
- Can this branch target 1.20 rather than 1.21? I'd like to get these improvements on 1.20 as well.
- We still need to support the Discord prerelease webhook that PKPCPBP (I think?) publishes to (the
#bleeding-edge-buildschannel in the VIP category). I believe mod-publish-plugin supports this, but if not, we may still need to use a bit of PKPCPBP code (this will likely require a parallel PR to PKPCPBP).
| // Determine release status from the HEAD commit subject, mirroring PKPCPBP's | ||
| // MiscUtil.isRelease(getMostRecentPush(...)): a release is any commit whose | ||
| // subject starts with "[release" (case-insensitive). | ||
| def rootRecentCommit = "" | ||
| def rootIsRelease = false | ||
| try { | ||
| def proc = ["git", "log", "--pretty=tformat:%s", "-n", "1"].execute(null, rootProject.projectDir) | ||
| proc.waitFor() | ||
| rootRecentCommit = proc.text.trim() | ||
| rootIsRelease = rootRecentCommit ==~ /(?i)^\[release.*/ | ||
| } catch (Exception e) { | ||
| logger.warn("Could not determine release status from git: {}", e.toString()) | ||
| } |
There was a problem hiding this comment.
Can we get rid of this and just have releases be triggered by manual Jenkins runs? I'm not a fan of having to push a commit to do releases. See an example here (though it'll need to be modified for Hex): https://github.com/object-Object/HexDebug/blob/8fc7e24e8313dc78433138100311fd81352716e3/Jenkinsfile#L11
| id("at.petra-k.pkpcpbp.PKSubprojPlugin") version "0.2.0-pre-104" apply false | ||
| id("at.petra-k.pkpcpbp.PKJson5Plugin") version "0.2.0-pre-104" apply false | ||
| id "me.modmuss50.mod-publish-plugin" version "2.1.1" | ||
| id "coffee.cypher.json-processor" version "0.1.0" apply false |
There was a problem hiding this comment.
Actually, I'd like to still use PKJson5Plugin, just not the rest of PKPCPBP. Sorry, I should have made the issue more clear on that.
| requires("paucal", | ||
| "patchouli", | ||
| "fabric-language-kotlin", | ||
| "inline", | ||
| "cloth-config", | ||
| "cardinal-components-api", | ||
| "fabric-api",) |
There was a problem hiding this comment.
Nit: can we keep the previous format/indentation? Also applies elsewhere
| slug = "patchouli" | ||
| version = "1.21-88-fabric" | ||
| } | ||
|
|
There was a problem hiding this comment.
Nit: some unnecessary blank lines here
| // pkSubproj { | ||
| // platform = project.platform | ||
| // artifactId = base.archivesName.get() | ||
| // versionDisplayName = "$platform-$minecraftVersion-$modVersion" | ||
| // } |
There was a problem hiding this comment.
Can we get rid of this commented-out code?
I will port it to 1.20 after finish those improvements. and, the mod-publish-plugin do support this(discord), but I find nothing related to it when I rewrite build.gradle. I'll re-check it and hopefully migrate it to mod-publish-plugin, along with other improvements you mention. In addition, I am not an experienced developer, and I am also not very proficient in English. Therefore, I hope you can understand any irregularities in the code and expressions. I am happy to learn from them and make improvements accordingly. |
|
@object-Object finished improvement. however, it seems that publish to maven is also handled by PKPCPBP, should we reproduce its logic or just ignore this lack? I'll port changes to 1.20 first right now. |
note that publish only triggers when last commit starts with "[release" (case-insensitive)
also, due to the inconsistent of maven version and modrinth version, alongside modrinth strange and crude match mechanism, this version of build.gradle still needs manually specify more than a half of dependency's version.