Skip to content

Commit 83ef9a0

Browse files
committed
Clean up API buildscripts and align manifest/versions
1 parent bcd768a commit 83ef9a0

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

.github/workflows/nightly-builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
version: ${{ needs.vars.outputs.version }}
4545

4646
tests:
47-
needs: [datagen]
47+
needs: [vars, datagen]
4848
uses: ./.github/workflows/run-gametests.yml
4949
secrets: inherit
5050
with:

.github/workflows/run-gametests.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
required: true
88
type: string
99

10+
env:
11+
VERSION: ${{ inputs.version }}
12+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
1015
jobs:
1116
run-tests:
1217
name: Run Game Testss
@@ -34,10 +39,6 @@ jobs:
3439

3540
- name: Build Core
3641
run: ./gradlew :core-api:jar
37-
env:
38-
VERSION: ${{ inputs.version }}
39-
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4142

4243
- name: Upload built core
4344
uses: actions/upload-artifact@v4
@@ -47,10 +48,6 @@ jobs:
4748

4849
- name: Run Game Tests
4950
run: ./gradlew :neoforge-main:runGameTestServer
50-
env:
51-
VERSION: ${{ inputs.version }}
52-
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5451

5552
- name: Upload build failure
5653
if: failure()
@@ -61,10 +58,6 @@ jobs:
6158

6259
- name: Run JUnit Tests
6360
run: ./gradlew :neoforge-main:test
64-
env:
65-
VERSION: ${{ inputs.version }}
66-
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
67-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6861

6962
- name: Upload test reports on failure
7063
if: failure()

core-api/build.gradle.kts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
import java.text.SimpleDateFormat
32
import java.util.*
43

5-
val versionMain: String = System.getenv("VERSION") ?: "0.0.0"
4+
val versionMain: String = System.getenv("VERSION") ?: "9.9.9"
65

76
plugins {
87
id("java-library")
@@ -40,24 +39,32 @@ tasks.withType<JavaCompile> {
4039
}
4140

4241
tasks.withType<Jar> {
42+
val gitVersion = providers.exec {
43+
commandLine("git", "rev-parse", "HEAD")
44+
}.standardOutput.asText.get()
45+
4346
manifest {
4447
val now = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(Date())
45-
attributes(mapOf(
48+
attributes(
49+
mapOf(
4650
"Specification-Title" to "Compact Machines - Core API",
4751
"Specification-Version" to "1", // We are version 1 of ourselves
4852
"Implementation-Title" to "Compact Machines - Core API",
4953
"Implementation-Timestamp" to now,
50-
"FMLModType" to "GAMELIBRARY"
51-
))
54+
"FMLModType" to "GAMELIBRARY",
55+
"Minecraft-Version" to mojang.versions.minecraft.get(),
56+
"NeoForge-Version" to neoforged.versions.neoforge.get(),
57+
"Main-Commit" to gitVersion
58+
)
59+
)
5260
}
5361
}
5462

55-
val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/compactmachines-core"
63+
val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/compactmachines"
5664
publishing {
5765
publications.register<MavenPublication>("api") {
5866
artifactId = "core-api"
5967
from(components.getByName("java"))
60-
// artifact(tasks.named("remapSrgJar"))
6168
}
6269

6370
repositories {

0 commit comments

Comments
 (0)