Fixed up git on ci (well, kinda)
This commit is contained in:
+3
-3
@@ -33,9 +33,9 @@ build:
|
|||||||
- MC_VER: ["1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.19.4", "1.20.1"]
|
- MC_VER: ["1.16.5", "1.17.1", "1.18.2", "1.19.2", "1.19.4", "1.20.1"]
|
||||||
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}" --gradle-user-home cache/;
|
- ./gradlew clean -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/;
|
||||||
- ./gradlew build -PmcVer="${MC_VER}" --gradle-user-home cache/;
|
- ./gradlew build -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/;
|
||||||
- ./gradlew mergeJars -PmcVer="${MC_VER}" --gradle-user-home cache/;
|
- ./gradlew mergeJars -PmcVer="${MC_VER}" -PgitMainBranch="${CI_COMMIT_BRANCH}" -PgitMainCommit="${CI_COMMIT_SHA}" -PgitCoreCommit="None(ran through Gitlab CI)" --gradle-user-home cache/;
|
||||||
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:
|
||||||
|
|||||||
+16
-4
@@ -363,11 +363,23 @@ subprojects { p ->
|
|||||||
def git_main_commit = "Git_not_found"
|
def git_main_commit = "Git_not_found"
|
||||||
def git_core_commit = "Git_not_found"
|
def git_core_commit = "Git_not_found"
|
||||||
def git_main_branch = "Git_not_found"
|
def git_main_branch = "Git_not_found"
|
||||||
|
// These "hasProperty"'s are so that they can be passed through the cli (ie in the CI)
|
||||||
try {
|
try {
|
||||||
"git rev-parse --is-inside-work-tree".execute() // If git doesnt exist, or this isnt cloned from git, then this wont work
|
// "git rev-parse --is-inside-work-tree".execute() // If git doesnt exist, or this isnt cloned from git, then this wont work
|
||||||
git_main_commit = 'git rev-parse --verify HEAD'.execute().text.trim()
|
if (gitMainCommit != "null")
|
||||||
git_core_commit = 'git ls-tree --object-only HEAD ../coreSubProjects'.execute().text.trim() // TODO: is there a way to do this universally
|
git_main_commit = gitMainCommit
|
||||||
git_main_branch = 'git symbolic-ref --short HEAD'.execute().text.trim()
|
else
|
||||||
|
git_main_commit = 'git rev-parse --verify HEAD'.execute().text.trim()
|
||||||
|
|
||||||
|
if (gitCoreCommit != "null")
|
||||||
|
git_core_commit = gitCoreCommit
|
||||||
|
else
|
||||||
|
git_core_commit = 'git ls-tree --object-only HEAD ../coreSubProjects'.execute().text.trim() // TODO: is there a way to do this universally
|
||||||
|
|
||||||
|
if (gitMainBranch != "null")
|
||||||
|
git_main_branch = gitMainBranch
|
||||||
|
else
|
||||||
|
git_main_branch = 'git symbolic-ref --short HEAD'.execute().text.trim()
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
println "Git or Git project not found"
|
println "Git or Git project not found"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ netty_version=4.1.94.Final
|
|||||||
lwjgl_version=3.2.3
|
lwjgl_version=3.2.3
|
||||||
joml_version=1.10.2
|
joml_version=1.10.2
|
||||||
|
|
||||||
|
|
||||||
|
# These are here so they can be changed with cmd arguments
|
||||||
|
# If they are null, they would be automatically set
|
||||||
|
# (This is mainly used for the CI)
|
||||||
|
gitMainCommit=null
|
||||||
|
gitCoreCommit=null
|
||||||
|
gitMainBranch=null
|
||||||
|
|
||||||
# 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=
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user