From 5cc31efa12c761246a6100ea272cedeb7d2c35fa Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 02:16:04 +0000 Subject: [PATCH 01/12] Attempt to add 1.18.1 and 1.18.2 auto building --- .gitlab-ci.yml | 83 ++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 54 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f2dfb293..24ad33801 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,8 +4,8 @@ image: gradle:eclipse-temurin # all stages need to be defined here stages: - gradleSetup - - build - - merge + - build_18-1 + - build_18-2 variables: # Disable the Gradle daemon for Continuous Integration servers as correctness @@ -25,7 +25,6 @@ before_script: -# first stage # This prevents us from re-downloading Gradle every stage gradleSetup: stage: gradleSetup @@ -42,71 +41,47 @@ gradleSetup: -# second stage -build: - stage: build - script: ./gradlew build --gradle-user-home cache/ +# 1.18.1 build +build_18-1: + stage: build_18-1 + script: ./gradlew build -PmcVer=1.18.1 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/ # build using Java 17 image: eclipse-temurin:17 cache: - key: "$CI_COMMIT_REF_NAME" + key: "$CI_COMMIT_REF_NAME_18-1" policy: pull-push paths: - - .architectury-transformer - - .gradle - - build - - common/.gradle - - common/build - - core/.gradle - - core/build - - fabric/.gradle - - fabric/src/generated - - forge/.gradle - - forge/src/generated - - build - .gradle - cache/ artifacts: - name: "NightlyBuild-$CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" - paths: - # relative to the root directory - - fabric/build/libs - - forge/build/libs - exclude: - - fabric/build/libs/*-dev.jar - - fabric/build/libs/*-dev-shadow.jar - - fabric/build/libs/*-sources-dev.jar - - fabric/build/libs/*-sources.jar - - forge/build/libs/*-dev.jar - - forge/build/libs/*-dev-shadow.jar - - forge/build/libs/*-sources-dev.jar - - forge/build/libs/*-sources.jar - reports: - # To ensure we've access to these files in the next stage - dotenv: generate_jars.env - expire_in: 1 day - -# third stage -merge: - stage: merge - script: ./gradlew merge --gradle-user-home cache/ - # build using Java 17 - image: eclipse-temurin:17 - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull-push - paths: - - build - - .gradle - - cache/ - artifacts: - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" paths: # relative to the root directory - Merged expire_in: 1 day +# 1.18.2 build +build_18-2: + stage: build_18-2 + script: ./gradlew build -PmcVer=1.18.2 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/ + # build using Java 17 + image: eclipse-temurin:17 + cache: + key: "$CI_COMMIT_REF_NAME_18-2" + policy: pull-push + paths: + - .gradle + - cache/ + artifacts: + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" + paths: + # relative to the root directory + - Merged + expire_in: 1 day + + + ## - stage #deploy: # stage: deploy From 919990820e97899c59568a8e82449ca4235cee66 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 02:43:12 +0000 Subject: [PATCH 02/12] Fix exporting duplicate jars --- .gitlab-ci.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 24ad33801..d5d4ada14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,12 +53,6 @@ build_18-1: paths: - .gradle - cache/ - artifacts: - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" - paths: - # relative to the root directory - - Merged - expire_in: 1 day # 1.18.2 build @@ -74,7 +68,8 @@ build_18-2: - .gradle - cache/ artifacts: - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" + # This should only be done for the last build, otherwise there will be a number of duplicate jars + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: # relative to the root directory - Merged From ec32d09468f4e3cb13c11de0b5713e7a58faacba Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 02:51:39 +0000 Subject: [PATCH 03/12] Try separating the archiving into a separate step This will make adding/removing MC versions to compile easier --- .gitlab-ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d5d4ada14..b95b3fdc1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,13 +6,11 @@ stages: - gradleSetup - build_18-1 - build_18-2 + - archive variables: - # Disable the Gradle daemon for Continuous Integration servers as correctness - # is usually a priority over speed in CI environments. Using a fresh - # runtime for each build is more reliable since the runtime is completely - # isolated from any previous builds. - GRADLE_OPTS: "-Dorg.gradle.daemon=false" + # Let's see if setting this to true will improve speed any + GRADLE_OPTS: "-Dorg.gradle.daemon=true" # Pull core when building GIT_SUBMODULE_STRATEGY: recursive @@ -67,8 +65,16 @@ build_18-2: paths: - .gradle - cache/ + + +# should be done after the builds +# creates the archive zip containing all the built jars +archive: + stage: archive + script: + - echo 'Builds finished, creating archive.' # The compiler complains if we don't give it a "script" line artifacts: - # This should only be done for the last build, otherwise there will be a number of duplicate jars + # This should only be done for the last build, otherwise there will be duplicate jars name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: # relative to the root directory From 5adfbb2dee7f7e44245b4ad0df68e1549f9f2fa5 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:04:50 +0000 Subject: [PATCH 04/12] Update .gitlab-ci.yml --- .gitlab-ci.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b95b3fdc1..6b19f0c60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,6 @@ stages: - gradleSetup - build_18-1 - build_18-2 - - archive variables: # Let's see if setting this to true will improve speed any @@ -51,6 +50,13 @@ build_18-1: paths: - .gradle - cache/ + artifacts: + # This should only be done for the last build, otherwise there will be duplicate jars + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" + paths: + # relative to the root directory + - Merged + expire_in: 1 day # 1.18.2 build @@ -65,17 +71,9 @@ build_18-2: paths: - .gradle - cache/ - - -# should be done after the builds -# creates the archive zip containing all the built jars -archive: - stage: archive - script: - - echo 'Builds finished, creating archive.' # The compiler complains if we don't give it a "script" line artifacts: # This should only be done for the last build, otherwise there will be duplicate jars - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-2" paths: # relative to the root directory - Merged From 91712cee2adb77f54faf7c5eba41693a3d28cb12 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:21:44 +0000 Subject: [PATCH 05/12] Rough artifact test --- .gitlab-ci.yml | 55 +++++++++----------------------------------------- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b19f0c60..57277495f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,12 +3,13 @@ image: gradle:eclipse-temurin # all stages need to be defined here stages: - - gradleSetup - - build_18-1 - - build_18-2 + #- gradleSetup + #- build_18-1 + #- build_18-2 + - artifacts variables: - # Let's see if setting this to true will improve speed any + # If we have correctness issues when compiling this can be set to false GRADLE_OPTS: "-Dorg.gradle.daemon=true" # Pull core when building GIT_SUBMODULE_STRATEGY: recursive @@ -22,55 +23,17 @@ before_script: -# This prevents us from re-downloading Gradle every stage -gradleSetup: - stage: gradleSetup - script: ./gradlew --build-cache --gradle-user-home cache/ check - # build using Java 17 - image: eclipse-temurin:17 - cache: - key: - files: - - gradle/wrapper/gradle-wrapper.properties - policy: push - paths: - - cache/ -# 1.18.1 build -build_18-1: - stage: build_18-1 - script: ./gradlew build -PmcVer=1.18.1 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/ - # build using Java 17 - image: eclipse-temurin:17 - cache: - key: "$CI_COMMIT_REF_NAME_18-1" - policy: pull-push - paths: - - .gradle - - cache/ - artifacts: - # This should only be done for the last build, otherwise there will be duplicate jars - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" - paths: - # relative to the root directory - - Merged - expire_in: 1 day -# 1.18.2 build -build_18-2: +# put artifacts in a zip +artifacts: stage: build_18-2 - script: ./gradlew build -PmcVer=1.18.2 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/ + script: echo 'Building complete. Creating artifact Zip.' # build using Java 17 image: eclipse-temurin:17 - cache: - key: "$CI_COMMIT_REF_NAME_18-2" - policy: pull-push - paths: - - .gradle - - cache/ artifacts: # This should only be done for the last build, otherwise there will be duplicate jars name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-2" @@ -81,7 +44,7 @@ build_18-2: -## - stage +# unused deployment stage #deploy: # stage: deploy # image: registry.gitlab.com/gitlab-org/release-cli:latest From b082b048d6054a60e9052eb5741094572a547cce Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:21:59 +0000 Subject: [PATCH 06/12] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57277495f..03e0266f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,7 +30,7 @@ before_script: # put artifacts in a zip artifacts: - stage: build_18-2 + stage: artifacts script: echo 'Building complete. Creating artifact Zip.' # build using Java 17 image: eclipse-temurin:17 From fe59c6b0c9eaaa66045cd16e6ab1f131c9dcd183 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:25:09 +0000 Subject: [PATCH 07/12] Check if Gradle setup is necessary --- .gitlab-ci.yml | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03e0266f1..ae334acad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,9 +3,9 @@ image: gradle:eclipse-temurin # all stages need to be defined here stages: - #- gradleSetup - #- build_18-1 - #- build_18-2 +# - gradleSetup + - build_18-1 + - build_18-2 - artifacts variables: @@ -21,22 +21,61 @@ before_script: - echo GE_JOB_ID=$CI_JOB_ID >> generate_jars.env +# # This prevents us from re-downloading Gradle every stage +# gradleSetup: +# stage: gradleSetup +# script: ./gradlew --build-cache --gradle-user-home cache/ check +# # build using Java 17 +# image: eclipse-temurin:17 +# cache: +# key: +# files: +# - gradle/wrapper/gradle-wrapper.properties +# policy: push +# paths: +# - cache/ +# 1.18.1 build +build_18-1: + stage: build_18-1 + script: ./gradlew build -PmcVer=1.18.1 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/ + # build using Java 17 + image: eclipse-temurin:17 + cache: + key: "$CI_COMMIT_REF_NAME_18-1" + policy: pull-push + paths: + - .gradle + - cache/ +# 1.18.2 build +build_18-2: + stage: build_18-2 + script: ./gradlew build -PmcVer=1.18.2 --gradle-user-home cache/; ./gradlew merge --gradle-user-home cache/ + # build using Java 17 + image: eclipse-temurin:17 + cache: + key: "$CI_COMMIT_REF_NAME_18-2" + policy: pull-push + paths: + - .gradle + - cache/ # put artifacts in a zip +# This should only be done after all the builds have been completed artifacts: stage: artifacts + # The complier complains if we don't do something with the script line script: echo 'Building complete. Creating artifact Zip.' # build using Java 17 image: eclipse-temurin:17 artifacts: # This should only be done for the last build, otherwise there will be duplicate jars - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-2" + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: # relative to the root directory - Merged From b9608498a2dab1ea50d1e8065623f579c5162f40 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:34:29 +0000 Subject: [PATCH 08/12] Check if Gradle setup is necessary + fix artifacts not being populated --- .gitlab-ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae334acad..b32add01b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: # - gradleSetup - build_18-1 - build_18-2 - - artifacts +# - artifacts variables: # If we have correctness issues when compiling this can be set to false @@ -63,6 +63,13 @@ build_18-2: paths: - .gradle - cache/ + artifacts: + # This should only be done for the last build, otherwise there will be duplicate jars + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-2" + paths: + # relative to the root directory + - Merged + expire_in: 1 day # put artifacts in a zip From fae4bee87150a1abc2f418147be633a29f7e9b29 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:34:52 +0000 Subject: [PATCH 09/12] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b32add01b..88a2bba4e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,21 +72,21 @@ build_18-2: expire_in: 1 day -# put artifacts in a zip -# This should only be done after all the builds have been completed -artifacts: - stage: artifacts - # The complier complains if we don't do something with the script line - script: echo 'Building complete. Creating artifact Zip.' - # build using Java 17 - image: eclipse-temurin:17 - artifacts: - # This should only be done for the last build, otherwise there will be duplicate jars - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" - paths: - # relative to the root directory - - Merged - expire_in: 1 day +# # put artifacts in a zip +# # This should only be done after all the builds have been completed +# artifacts: +# stage: artifacts +# # The complier complains if we don't do something with the script line +# script: echo 'Building complete. Creating artifact Zip.' +# # build using Java 17 +# image: eclipse-temurin:17 +# artifacts: +# # This should only be done for the last build, otherwise there will be duplicate jars +# name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" +# paths: +# # relative to the root directory +# - Merged +# expire_in: 1 day From 8610917b865859f6c9f5b2be25ed81bee3b9a117 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:41:17 +0000 Subject: [PATCH 10/12] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88a2bba4e..7e0aa9263 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,12 @@ build_18-1: paths: - .gradle - cache/ + artifacts: + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" + paths: + # relative to the root directory + - Merged + expire_in: 1 day # 1.18.2 build @@ -64,7 +70,6 @@ build_18-2: - .gradle - cache/ artifacts: - # This should only be done for the last build, otherwise there will be duplicate jars name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-2" paths: # relative to the root directory From c80b025ac187a1946cb6699f3bfa8fd8deee7096 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 03:52:25 +0000 Subject: [PATCH 11/12] Clean up the build script --- .gitlab-ci.yml | 55 ++++++++++++-------------------------------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e0aa9263..c7b0b49ca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,10 +3,9 @@ image: gradle:eclipse-temurin # all stages need to be defined here stages: -# - gradleSetup - build_18-1 - build_18-2 -# - artifacts + - zip_artifacts variables: # If we have correctness issues when compiling this can be set to false @@ -21,22 +20,6 @@ before_script: - echo GE_JOB_ID=$CI_JOB_ID >> generate_jars.env -# # This prevents us from re-downloading Gradle every stage -# gradleSetup: -# stage: gradleSetup -# script: ./gradlew --build-cache --gradle-user-home cache/ check -# # build using Java 17 -# image: eclipse-temurin:17 -# cache: -# key: -# files: -# - gradle/wrapper/gradle-wrapper.properties -# policy: push -# paths: -# - cache/ - - - # 1.18.1 build build_18-1: stage: build_18-1 @@ -49,12 +32,6 @@ build_18-1: paths: - .gradle - cache/ - artifacts: - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-1" - paths: - # relative to the root directory - - Merged - expire_in: 1 day # 1.18.2 build @@ -69,31 +46,25 @@ build_18-2: paths: - .gradle - cache/ + + +# put artifacts in a zip +# This should only be done after all the builds have been completed +zip_artifacts: + stage: zip_artifacts + # The complier complains if we don't do something with the script line + script: echo 'Building complete. Creating artifact Zip.' + # build using Java 17 + image: eclipse-temurin:17 artifacts: - name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}_18-2" + # This should only be done after the last build, otherwise there will be duplicate jars + name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" paths: # relative to the root directory - Merged expire_in: 1 day -# # put artifacts in a zip -# # This should only be done after all the builds have been completed -# artifacts: -# stage: artifacts -# # The complier complains if we don't do something with the script line -# script: echo 'Building complete. Creating artifact Zip.' -# # build using Java 17 -# image: eclipse-temurin:17 -# artifacts: -# # This should only be done for the last build, otherwise there will be duplicate jars -# name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" -# paths: -# # relative to the root directory -# - Merged -# expire_in: 1 day - - # unused deployment stage #deploy: From 207cab9a0f00def0055434bdd01e8847b7a35fe4 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Tue, 15 Mar 2022 04:05:12 +0000 Subject: [PATCH 12/12] Clean up the build script --- .gitlab-ci.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7b0b49ca..b7a32635e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ image: gradle:eclipse-temurin stages: - build_18-1 - build_18-2 - - zip_artifacts +# - zip_artifacts variables: # If we have correctness issues when compiling this can be set to false @@ -46,16 +46,8 @@ build_18-2: paths: - .gradle - cache/ - - -# put artifacts in a zip -# This should only be done after all the builds have been completed -zip_artifacts: - stage: zip_artifacts - # The complier complains if we don't do something with the script line - script: echo 'Building complete. Creating artifact Zip.' - # build using Java 17 - image: eclipse-temurin:17 + + # TEMPORARY, there should be a way of either generating artifacts per build or in a separate stage artifacts: # This should only be done after the last build, otherwise there will be duplicate jars name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" @@ -65,6 +57,23 @@ zip_artifacts: expire_in: 1 day +# # put artifacts in a zip +# # This should only be done after all the builds have been completed +# zip_artifacts: +# stage: zip_artifacts +# # The complier complains if we don't do something with the script line +# script: echo 'Building complete. Creating artifact Zip.' +# # build using Java 17 +# image: eclipse-temurin:17 +# artifacts: +# # This should only be done after the last build, otherwise there will be duplicate jars +# name: "Merged_NightlyBuild-${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_TIMESTAMP}" +# paths: +# # relative to the root directory +# - Merged +# expire_in: 1 day + + # unused deployment stage #deploy: