Compare commits

...

6 Commits

Author SHA1 Message Date
Ran 8e7f82d3e0 Update Forgix 2025-05-08 12:44:29 +10:00
Ran 931aa2974e Better CI formatting 2025-05-06 14:00:27 +10:00
Ran 1f77a12fe3 attempt #3 on fixing the CI 2025-05-06 13:14:34 +10:00
Ran dcf546a163 attempt #2 on fixing the CI 2025-05-06 12:37:46 +10:00
Ran 81f050dc8b try to fix CI 2025-05-06 11:33:49 +10:00
Ran 9cd1ada37f multiversion test 2025-05-06 11:27:16 +10:00
4 changed files with 40 additions and 7 deletions
+29 -5
View File
@@ -6,6 +6,7 @@ image: eclipse-temurin:21
# TODO: Make stages depend on what is in versionProperties
stages:
- build
- multiversion
- api
- pages
@@ -38,23 +39,46 @@ build:
- MC_VER: ["1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.19.4", "1.20.1", "1.20.2", "1.20.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5"]
script:
# this both runs the unit tests and assembles the code
- ./gradlew clean -PmcVer="${MC_VER}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/;
- ./gradlew build -PmcVer="${MC_VER}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/;
- ./gradlew mergeJars -PmcVer="${MC_VER}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/;
- cp ./fabric/build/libs/* ./forge/build/libs/* ./neoforge/build/libs/* ./build/merged/* . || true
- cp ./build/forgix/* . || true
- mkdir -p ./builds
- cp ./fabric/build/libs/* ./forge/build/libs/* ./neoforge/build/libs/* ./builds || true
# When the archive is created, the merged jar will be the main jar and a subfolder named "builds" will contain the other jars
artifacts:
name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
paths:
- ./*.jar
- ./builds/*.jar
exclude:
- ./*-all.jar
- ./*-dev.jar
- ./*-sources.jar
- ./builds/*-all.jar
- ./builds/*-dev.jar
- ./builds/*-sources.jar
expire_in: 14 days
when: always
extends: .build_java
multiversion:
stage: multiversion
needs: [build]
script:
# Create a semicolon-separated list of jar paths
- MC_VER_PATHS=$(find . -maxdepth 1 -name "*.jar" -type f | tr '\n' ';')
# Run the mergeVersions task
- ./gradlew mergeVersions -PmergeVersions="${MC_VER_PATHS}" -PinfoGitCommit="${CI_COMMIT_SHA}" -PinfoGitBranch="${CI_COMMIT_BRANCH}" -PinfoBuildSource="GitLab CI (${CI_PIPELINE_ID})" --gradle-user-home cache/;
# Clean up existing jars and make sure only the multiversion jar remains which will be uploaded
- rm -f ./*.jar
- cp ./build/forgix/multiversion/* .
artifacts:
name: "NightlyBuild_Multiversion-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
paths:
- ./*.jar
expire_in: 30 days
when: always
extends: .build_java
api:
stage: api
needs: []
+9 -1
View File
@@ -13,7 +13,7 @@ plugins {
id "com.github.johnrengelman.shadow" version '8.1.1' apply false
// Plugin to create merged jars
id "io.github.pacifistmc.forgix" version "1.3.4"
id "io.github.pacifistmc.forgix" version "2.0.0-SNAPSHOT.2"
// Manifold preprocessor
id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha"
@@ -22,6 +22,14 @@ plugins {
id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false
}
// Sets up Forgix for multiversion merging
forgix {
if (project.hasProperty('mergeVersions')) { // This is set using -PmergeVersions by the GitLab CI
multiversion {
inputJars = project.files(project.property('mergeVersions').toString().split(';'))
}
}
}
/**
* Creates the list of preprocessors to use.
+1
View File
@@ -48,6 +48,7 @@ infoBuildSource=User
# Internal Properties (These are set at runtime for Forgix to merge jar's)
versionStr=
mergeVersions=
# This defines what MC version Intellij will use for the preprocessor
# and what version is used automatically by build and run commands
+1 -1
View File
@@ -58,7 +58,7 @@ If you still need help with compiling, please read the Readme.md
/** Loads the VersionProperties fiel for the currently selected Minecraft version. */
/** Loads the VersionProperties field for the currently selected Minecraft version. */
def loadProperties() {
def defaultMcVersion = "1.20.1" // 1.20.1 is our current most stable version so we use that if no version was defined