Skip to content

Commit aed5535

Browse files
committed
publish
1 parent 7adb8fb commit aed5535

File tree

4 files changed

+59
-15
lines changed

4 files changed

+59
-15
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Release
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
Build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up JDK 21
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'adopt'
22+
java-version: 21
23+
- name: Cache
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.gradle/caches
28+
~/.gradle/wrapper
29+
.gradle
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
31+
- uses: gradle/actions/wrapper-validation@v3
32+
- run: |
33+
chmod +x gradlew
34+
./gradlew build publishMod --stacktrace -Porg.gradle.parallel.threads=4
35+
env:
36+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Changelog
2+
- port to 1.21.4 neoforge

build.gradle.kts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id("dev.architectury.loom").version("1.9-SNAPSHOT")
3+
id("com.hypherionmc.modutils.modpublisher").version("2.+")
34
id("maven-publish")
45
}
56

@@ -60,18 +61,18 @@ tasks.withType<ProcessResources> {
6061
}
6162
}
6263

63-
//tasks.register("copyJar") {
64-
// // Specify that this task runs after the 'build' task
65-
// dependsOn("build")
66-
//
67-
// // Specify the task's action
68-
// doLast {
69-
// val destination = file("build/${archives_base_name}-${minecraft_version}-${mod_version}.jar")
70-
// file("build/libs/litematica-printer.jar").copyTo(destination, true)
71-
// println("Copied output to ${destination.absolutePath}")
72-
// }
73-
//}
74-
//
75-
//tasks.build {
76-
// finalizedBy("copyJar")
77-
//}
64+
publisher {
65+
apiKeys.modrinth(System.getenv("MODRINTH_TOKEN"))
66+
apiKeys.curseforge(System.getenv("CURSEFORGE_TOKEN"))
67+
68+
curseID.set("$project.curseforge_id")
69+
modrinthID.set("$project.modrinth_id")
70+
versionType.set("release")
71+
changelog.set(file("CHANGELOG.md"))
72+
displayName.set("$project.version")
73+
gameVersions.set(listOf("1.21.4"))
74+
loaders.set(listOf(loom.platform.get().id()))
75+
projectVersion.set("$project.version")
76+
artifact.set(tasks.remapJar)
77+
addAdditionalFile(tasks.remapSourcesJar)
78+
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ mappings_version = 1.21.4+build.8
1919
yarn_patch=1.21+build.4
2020

2121
neoforge_version = 21.4.94-beta
22+
23+
curseforge_id=1223456
24+
modrinth_id=oqw1j8E7

0 commit comments

Comments
 (0)