Skip to content

Commit 5fe114c

Browse files
committed
build: add in support for CF publishing
1 parent 09124ac commit 5fe114c

File tree

5 files changed

+62
-2
lines changed

5 files changed

+62
-2
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Java CI - Build Release
22

33
on:
4-
release:
5-
types: [ published ]
4+
push:
5+
tags:
6+
- 'v[0-9]+\.[0-9]+\.[0-9]+'
7+
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+'
8+
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z]+\.[0-9]+'
69

710
jobs:
811
build:

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id "architectury-plugin" version "3.4-SNAPSHOT"
33
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false
4+
id "com.matthewprenger.cursegradle" version "1.4.0" apply false
45
}
56

67
architectury {
@@ -96,3 +97,5 @@ subprojects {
9697
}
9798
}
9899
}
100+
101+
task curseforgePublish

fabric/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
plugins {
22
id "com.github.johnrengelman.shadow" version "7.1.2"
3+
id "com.matthewprenger.cursegradle"
34
}
45

6+
def ENV = System.getenv()
7+
58
architectury {
69
platformSetupLoomIde()
710
fabric()
@@ -65,6 +68,27 @@ components.java {
6568
}
6669
}
6770

71+
if (ENV.CURSEFORGE_KEY) {
72+
curseforge {
73+
apiKey = ENV.CURSEFORGE_KEY
74+
project {
75+
id = project.curseforge_id
76+
releaseType = ftbPublishing.relType
77+
addGameVersion "Fabric"
78+
addGameVersion project.minecraft_version
79+
addGameVersion "Java 17"
80+
mainArtifact(remapJar.archiveFile)
81+
relations {
82+
requiredDependency 'architectury-api'
83+
requiredDependency 'ftb-library-fabric'
84+
requiredDependency 'ftb-teams-fabric'
85+
}
86+
changelog = ""
87+
changelogType = 'markdown'
88+
}
89+
}
90+
}
91+
6892
publishing {
6993
publications {
7094
mavenForge(MavenPublication) {
@@ -74,3 +98,5 @@ publishing {
7498
}
7599
}
76100
}
101+
102+
rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")

forge/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
plugins {
22
id "com.github.johnrengelman.shadow" version "7.1.2"
3+
id "com.matthewprenger.cursegradle"
34
}
45

6+
def ENV = System.getenv()
7+
58
architectury {
69
platformSetupLoomIde()
710
forge()
@@ -73,6 +76,27 @@ components.java {
7376
}
7477
}
7578

79+
if (ENV.CURSEFORGE_KEY) {
80+
curseforge {
81+
apiKey = ENV.CURSEFORGE_KEY
82+
project {
83+
id = project.curseforge_id
84+
releaseType = ftbPublishing.relType
85+
addGameVersion "Forge"
86+
addGameVersion project.minecraft_version
87+
addGameVersion "Java 17"
88+
mainArtifact(remapJar.archiveFile)
89+
relations {
90+
requiredDependency 'architectury-api'
91+
requiredDependency 'ftb-library-forge'
92+
requiredDependency 'ftb-teams-forge'
93+
}
94+
changelog = ""
95+
changelogType = 'markdown'
96+
}
97+
}
98+
}
99+
76100
publishing {
77101
publications {
78102
mavenForge(MavenPublication) {
@@ -82,3 +106,5 @@ publishing {
82106
}
83107
}
84108
}
109+
110+
rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mod_version=20.1.1
88
maven_group=dev.ftb.mods
99
mod_author=FTB Team
1010

11+
curseforge_id=1197857
12+
1113
architectury_version=9.1.12
1214
fabric_loader_version=0.14.23
1315
fabric_api_version=0.90.4+1.20.1

0 commit comments

Comments
 (0)