From 931aa2974e7036e7575173c42b345fe998521c99 Mon Sep 17 00:00:00 2001 From: Ran <43445785+Ran-Mewo@users.noreply.github.com> Date: Tue, 6 May 2025 14:00:27 +1000 Subject: [PATCH] Better CI formatting --- .gitlab-ci.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 50b3f6e06..83c2dca0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,19 +41,19 @@ build: # this both runs the unit tests and assembles the code - ./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/* . || true - # copy the merged jar to the jars folder so we can use it later in the multiversion stage - - mkdir -p ./jars - - cp ./build/forgix/* ./jars || 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 - - ./jars/*.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 @@ -64,13 +64,16 @@ multiversion: needs: [build] script: # Create a semicolon-separated list of jar paths - - MC_VER_PATHS=$(find jars -name "*.jar" -type f | tr '\n' ';') + - 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: - - ./build/forgix/multiversion/*.jar + - ./*.jar expire_in: 30 days when: always extends: .build_java