File tree Expand file tree Collapse file tree 4 files changed +31
-47
lines changed
plugins/src/main/kotlin/hexdebug/conventions Expand file tree Collapse file tree 4 files changed +31
-47
lines changed Original file line number Diff line number Diff line change 6262 - name : Build mod
6363 run : ./gradlew build
6464
65+ # do this first so we fail if we've already published this version
66+ # because CurseForge and Modrinth apparently don't care!
67+ - name : Publish to GitHub
68+ if : inputs.publish-github
69+ env :
70+ DRY_RUN : ${{ inputs.dry-run && 'true' || '' }}
71+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72+ run : ./gradlew publishGithub
73+
6574 - name : Publish to CurseForge
6675 if : inputs.publish-curseforge
6776 env :
7685 MODRINTH_TOKEN : ${{ secrets.MODRINTH_TOKEN }}
7786 run : ./gradlew publishModrinth
7887
79- - name : Publish to GitHub
80- if : inputs.publish-github
81- env :
82- DRY_RUN : ${{ inputs.dry-run && 'true' || '' }}
83- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
84- run : ./gradlew publishGithub
85-
8688 - name : Upload dry run artifact
8789 if : inputs.dry-run
8890 uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -74,3 +74,19 @@ dependencies {
7474 include(libs.bundles.lsp4j)
7575 include(libs.bundles.ktor)
7676}
77+
78+ // this fails if we do it for all projects, since the tag already exists :/
79+ // see https://github.com/modmuss50/mod-publish-plugin/issues/3
80+ publishMods {
81+ github {
82+ accessToken = providers.environmentVariable(" GITHUB_TOKEN" ).orElse(" " )
83+ repository = providers.environmentVariable(" GITHUB_REPOSITORY" ).orElse(" " )
84+ commitish = providers.environmentVariable(" GITHUB_SHA" ).orElse(" " )
85+
86+ type = STABLE
87+ displayName = " v${project.version} "
88+ tagName = " v${project.version} "
89+
90+ additionalFiles.from(project(" :Common" ).tasks.remapJar.get().archiveFile)
91+ }
92+ }
Original file line number Diff line number Diff line change @@ -91,36 +91,9 @@ tasks {
9191 }
9292}
9393
94- publishMods {
95- // curseforge {
96- // accessToken = project.curseforgeApiToken
97- // projectId = project.curseforgeId
98- // minecraftVersions.add(minecraftVersion)
99- //
100- // requires {
101- // slug = "architectury-debugger"
102- // }
103- // requires {
104- // slug = "kotlin-for-forge"
105- // }
106- // requires {
107- // slug = "hexcasting"
108- // }
109- // }
110- //
111- // modrinth {
112- // accessToken = project.modrinthApiToken
113- // projectId = project.modrinthId
114- // minecraftVersions.add("1.19.2")
115- //
116- // requires {
117- // slug = "architectury-debugger"
118- // }
119- // requires {
120- // slug = "kotlin-for-forge"
121- // }
122- // requires {
123- // slug = "hex-casting"
124- // }
125- // }
94+ // SO SO SO SCUFFED.
95+ val publishFile = publishMods.file.get().asFile
96+ project(" :Fabric" ).publishMods.github {
97+ additionalFiles.from(publishFile)
12698}
99+
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ components {
112112 }
113113}
114114
115- fun envOrEmpty (name : String ) = providers.environmentVariable(name).orElse(" " )
115+ fun Project. envOrEmpty (name : String ) = this . providers.environmentVariable(name).orElse(" " )
116116
117117publishMods {
118118 dryRun = providers.zip(envOrEmpty(" CI" ), envOrEmpty(" DRY_RUN" )) { ci, dryRun ->
@@ -136,11 +136,4 @@ publishMods {
136136 projectId = hexdebugProperties.modrinthId
137137 minecraftVersions.add(hexdebugProperties.minecraftVersion)
138138 }
139-
140- github {
141- accessToken = envOrEmpty(" GITHUB_TOKEN" )
142- repository = envOrEmpty(" GITHUB_REPOSITORY" )
143- commitish = envOrEmpty(" GITHUB_SHA" )
144- tagName = " v${project.version} "
145- }
146139}
You can’t perform that action at this time.
0 commit comments