Skip to content

Commit 6217a48

Browse files
committed
Add curseforge plugin, initial debug testing, bump for alpha 6
1 parent 96234e5 commit 6217a48

File tree

3 files changed

+70
-22
lines changed

3 files changed

+70
-22
lines changed

.github/workflows/test-build.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ jobs:
100100
uses: actions/download-artifact@v2
101101
with:
102102
name: out
103-
path: out
103+
path: changelog
104104

105-
- run: cat out/CHANGELOG.md
105+
- run: cat changelog/CHANGELOG.md
106+
107+
upload:
108+
name: Upload to CurseForge
109+
runs-on: ubuntu-latest
110+
needs: [generate]
111+
with:
112+
env:
113+
CF_TOKEN: ${{ secrets.CF_API_TOKEN }}
114+
115+
steps:
116+
- name: Download Build Results
117+
uses: actions/download-artifact@v2
118+
with:
119+
name: out
120+
path: changelog
121+
122+
- name: Do Upload
123+
run: ./gradlew curseforge

build.gradle

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ buildscript {
33
maven { url = 'https://files.minecraftforge.net/maven' }
44
jcenter()
55
mavenCentral()
6+
7+
maven { url "https://plugins.gradle.org/m2/" }
68
}
9+
710
dependencies {
811
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
912
}
1013
}
14+
15+
16+
plugins {
17+
id "com.matthewprenger.cursegradle" version "1.4.0"
18+
}
19+
1120
apply plugin: 'net.minecraftforge.gradle'
1221
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1322
apply plugin: 'eclipse'
@@ -23,7 +32,7 @@ println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getPro
2332
minecraft {
2433
mappings channel: 'snapshot', version: mappings_version
2534
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
26-
35+
2736
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
2837

2938
// Default run configurations.
@@ -93,7 +102,7 @@ def getModVersion(filename) {
93102

94103
def found = matcher.find()
95104

96-
if(found) {
105+
if (found) {
97106
def mod = matcher.group("modid");
98107

99108
// Extract MC version or default
@@ -104,7 +113,7 @@ def getModVersion(filename) {
104113

105114
// println("> mod: ${mod}; mc: ${mcVersion}; version: ${version}");
106115

107-
if(mcVersion == null)
116+
if (mcVersion == null)
108117
return "${mod}:${mod}:${version}";
109118
else
110119
return "${mod}:${mod}-${mcVersion}:${version}";
@@ -136,7 +145,7 @@ repositories {
136145
}
137146
}
138147

139-
def dev_mods = fileTree(dev_mods_dir).filter { it -> it.isFile() }.files.name.collect( { getModVersion(it) } )
148+
def dev_mods = fileTree(dev_mods_dir).filter { it -> it.isFile() }.files.name.collect({ getModVersion(it) })
140149

141150
dependencies {
142151
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
@@ -164,23 +173,40 @@ dependencies {
164173
jar {
165174
manifest {
166175
attributes([
167-
"Specification-Title": "compactmachines",
168-
"Specification-Vendor": "",
169-
"Specification-Version": "1", // We are version 1 of ourselves
170-
"Implementation-Title": project.name,
171-
"Implementation-Version": "${version}",
172-
"Implementation-Vendor" : "",
173-
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
176+
"Specification-Title" : "compactmachines",
177+
"Specification-Vendor" : "",
178+
"Specification-Version" : "1", // We are version 1 of ourselves
179+
"Implementation-Title" : project.name,
180+
"Implementation-Version" : "${version}",
181+
"Implementation-Vendor" : "",
182+
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
174183
])
175184
}
176185
}
177186

178187
// Example configuration to allow publishing using the maven-publish task
179188
// This is the preferred method to reobfuscate your jar file
180-
jar.finalizedBy('reobfJar')
189+
jar.finalizedBy('reobfJar')
181190
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
182191
//publish.dependsOn('reobfJar')
183192

193+
curseforge {
194+
apiKey = System.getenv("CF_TOKEN")
195+
project {
196+
id = cf_project
197+
releaseType = "${cf_release_type}"
198+
changelogType = "markdown"
199+
changelog = file("changelog/CHANGELOG.md")
200+
}
201+
202+
options {
203+
debug = true // defaults to false
204+
javaVersionAutoDetect = true // defaults to true
205+
javaIntegration = true // defaults to true
206+
forgeGradleIntegration = true // defaults to true
207+
}
208+
}
209+
184210
publishing {
185211
publications {
186212
mavenJava(MavenPublication) {
@@ -189,12 +215,12 @@ publishing {
189215
}
190216
repositories {
191217
maven {
192-
name = "GitHubPackages"
193-
url = "https://maven.pkg.github.com/robotgryphon/compact-machines"
194-
credentials {
195-
username = System.getenv("GITHUB_ACTOR")
196-
password = System.getenv("GITHUB_TOKEN")
197-
}
218+
name = "GitHubPackages"
219+
url = "https://maven.pkg.github.com/robotgryphon/compact-machines"
220+
credentials {
221+
username = System.getenv("GITHUB_ACTOR")
222+
password = System.getenv("GITHUB_TOKEN")
223+
}
198224
}
199225
}
200226
}

gradle.properties

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ org.gradle.daemon=false
66
minecraft_version=1.16.4
77
forge_version=35.1.13
88
mappings_version=20201028-1.16.3
9-
mod_version=4.0.0-alpha.5
9+
mod_version=4.0.0-alpha.6
1010

1111
# Dependencies and Libs
1212
jei_version=7.6.0.58
13-
top_version=1.16-3.0.4-beta-7
13+
top_version=1.16-3.0.4-beta-7
14+
15+
# Curseforge
16+
cf_project=224218
17+
cf_release_type=alpha

0 commit comments

Comments
 (0)