Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e7f82d3e0 | |||
| 931aa2974e | |||
| 1f77a12fe3 | |||
| dcf546a163 | |||
| 81f050dc8b | |||
| 9cd1ada37f |
+29
-5
@@ -6,6 +6,7 @@ image: eclipse-temurin:21
|
|||||||
# TODO: Make stages depend on what is in versionProperties
|
# TODO: Make stages depend on what is in versionProperties
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- multiversion
|
||||||
- api
|
- api
|
||||||
- pages
|
- 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"]
|
- 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:
|
script:
|
||||||
# this both runs the unit tests and assembles the code
|
# 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 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/;
|
- ./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:
|
artifacts:
|
||||||
name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
name: "NightlyBuild_${MC_VER}-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}"
|
||||||
paths:
|
paths:
|
||||||
- ./*.jar
|
- ./*.jar
|
||||||
|
- ./builds/*.jar
|
||||||
exclude:
|
exclude:
|
||||||
- ./*-all.jar
|
- ./builds/*-all.jar
|
||||||
- ./*-dev.jar
|
- ./builds/*-dev.jar
|
||||||
- ./*-sources.jar
|
- ./builds/*-sources.jar
|
||||||
expire_in: 14 days
|
expire_in: 14 days
|
||||||
when: always
|
when: always
|
||||||
extends: .build_java
|
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:
|
api:
|
||||||
stage: api
|
stage: api
|
||||||
needs: []
|
needs: []
|
||||||
|
|||||||
+9
-1
@@ -13,7 +13,7 @@ plugins {
|
|||||||
id "com.github.johnrengelman.shadow" version '8.1.1' apply false
|
id "com.github.johnrengelman.shadow" version '8.1.1' apply false
|
||||||
|
|
||||||
// Plugin to create merged jars
|
// 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
|
// Manifold preprocessor
|
||||||
id "systems.manifold.manifold-gradle-plugin" version "0.0.2-alpha"
|
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
|
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.
|
* Creates the list of preprocessors to use.
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ infoBuildSource=User
|
|||||||
|
|
||||||
# Internal Properties (These are set at runtime for Forgix to merge jar's)
|
# Internal Properties (These are set at runtime for Forgix to merge jar's)
|
||||||
versionStr=
|
versionStr=
|
||||||
|
mergeVersions=
|
||||||
|
|
||||||
# This defines what MC version Intellij will use for the preprocessor
|
# This defines what MC version Intellij will use for the preprocessor
|
||||||
# and what version is used automatically by build and run commands
|
# and what version is used automatically by build and run commands
|
||||||
|
|||||||
+1
-1
@@ -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 loadProperties() {
|
||||||
def defaultMcVersion = "1.20.1" // 1.20.1 is our current most stable version so we use that if no version was defined
|
def defaultMcVersion = "1.20.1" // 1.20.1 is our current most stable version so we use that if no version was defined
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user