diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa5ccf29b3..d987620def 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,6 +91,9 @@ stages: - if: $DO_RELEASE == "true" script: - !reference [.build-release-template, script] + after_script: + - if [ "$TARGET" == "template_debug" ]; then export FRIENDLY_TARGET="debug"; else export FRIENDLY_TARGET="release"; fi + - mv "out/templates/redot.${PLATFORM}.${TARGET}.${ARCH}" "out/templates/linux_${FRIENDLY_TARGET}.${ARCH}" artifacts: public: false expire_in: 3 days @@ -104,6 +107,9 @@ stages: - if: $DO_RELEASE == "true" script: - !reference [.build-release-template-mono, script] + after_script: + - if [ "$TARGET" == "template_debug" ]; then export FRIENDLY_TARGET="debug"; else export FRIENDLY_TARGET="release"; fi + - mv "out/templates-mono/redot.${PLATFORM}.${TARGET}.${ARCH}.mono" "out/templates-mono/linux_${FRIENDLY_TARGET}.${ARCH}" artifacts: public: false expire_in: 3 days @@ -142,6 +148,16 @@ stages: - export OPTIONS="production=yes use_mingw=yes angle_libs=$(pwd)/deps/angle mesa_libs=$(pwd)/deps/mesa" script: - !reference [ .build-release-template, script ] + after_script: + - if [ "$TARGET" == "template_debug" ]; then export FRIENDLY_TARGET="debug"; else export FRIENDLY_TARGET="release"; fi + - | + if [ "$ARCH" == "arm64" ]; then + mv "out/templates/redot.${PLATFORM}.${TARGET}.${ARCH}.llvm.exe" "out/templates/windows_${FRIENDLY_TARGET}_${ARCH}.exe" + mv "out/templates/redot.${PLATFORM}.${TARGET}.${ARCH}.llvm.console.exe" "out/templates/windows_${FRIENDLY_TARGET}_${ARCH}_console.exe" + else + mv "out/templates/redot.${PLATFORM}.${TARGET}.${ARCH}.exe" "out/templates/windows_${FRIENDLY_TARGET}_${ARCH}.exe" + mv "out/templates/redot.${PLATFORM}.${TARGET}.${ARCH}.console.exe" "out/templates/windows_${FRIENDLY_TARGET}_${ARCH}_console.exe" + fi variables: PLATFORM: "windows" artifacts: @@ -160,6 +176,16 @@ stages: - export OPTIONS="production=yes use_mingw=yes angle_libs=$(pwd)/deps/angle mesa_libs=$(pwd)/deps/mesa" script: - !reference [ .build-release-template-mono, script ] + after_script: + - if [ "$TARGET" == "template_debug" ]; then export FRIENDLY_TARGET="debug"; else export FRIENDLY_TARGET="release"; fi + - | + if [ "$ARCH" == "arm64" ]; then + mv "out/templates-mono/redot.${PLATFORM}.${TARGET}.${ARCH}.llvm.mono.exe" "out/templates-mono/windows_${FRIENDLY_TARGET}_${ARCH}.exe" + mv "out/templates-mono/redot.${PLATFORM}.${TARGET}.${ARCH}.llvm.mono.console.exe" "out/templates-mono/windows_${FRIENDLY_TARGET}_${ARCH}_console.exe" + else + mv "out/templates-mono/redot.${PLATFORM}.${TARGET}.${ARCH}.mono.exe" "out/templates-mono/windows_${FRIENDLY_TARGET}_${ARCH}.exe" + mv "out/templates-mono/redot.${PLATFORM}.${TARGET}.${ARCH}.mono.console.exe" "out/templates-mono/windows_${FRIENDLY_TARGET}_${ARCH}_console.exe" + fi variables: PLATFORM: "windows" artifacts: @@ -314,6 +340,54 @@ stages: - out/$PLATFORM/$ARCH/$TYPE-mono - mono-glue/ +# create tarball for release +create-tarball: + tags: [ docker ] + stage: build + image: $CI_REGISTRY/redot-engine/redot-production-containers/redot-linux:latest + rules: + - when: always + script: + - major=$(grep -E '^major\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - minor=$(grep -E '^minor\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - patch=$(grep -E '^patch\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - status=$(grep -E '^status\s*=' version.py | sed -E "s/.*=\s*\"([^\"]+)\".*/\1/") + - status_version=$(grep -E '^status_version\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - echo "$major.$minor.$patch-$status.$status_version" + - | + if [ "$status" == "stable" ] + then + if [ "$patch" == "0" ] + then + export VERSIONSTRING="${major}.${minor}-stable" + export VERSIONTXT="${major}.${minor}.stable" + else + export VERSIONSTRING="${major}.${minor}.${patch}-stable" + export VERSIONTXT="${major}.${minor}.${patch}.stable" + fi + else + if [ "$patch" == "0" ] + then + export VERSIONSTRING="${major}.${minor}-${status}.${status_version}" + export VERSIONTXT="${major}.${minor}.${status}.${status_version}" + else + export VERSIONSTRING="${major}.${minor}.${patch}-${status}.${status_version}" + export VERSIONTXT="${major}.${minor}.${patch}.${status}.${status_version}" + fi + fi + - echo $VERSIONSTRING + - TARBALL_NAME="redot-${VERSIONSTRING}.tar.xz" + - FOLDER_NAME="redot-${VERSIONSTRING}" + - mkdir $FOLDER_NAME + - rsync -a --exclude="${FOLDER_NAME}" ./ "${FOLDER_NAME}/" + - mkdir -p out/ + - tar -cJf "out/${TARBALL_NAME}" "${FOLDER_NAME}" + - sha256sum "out/${TARBALL_NAME}" > "out/${TARBALL_NAME}.sha256" + artifacts: + public: false + expire_in: 3 days + paths: + - out/ # -- Build the Linux Editors -- linux-editor-x64-mono: tags: [ docker ] @@ -905,6 +979,14 @@ Web-Release-Template: script: - export BUILD_NAME="official" - /root/scripts/buildWeb.sh + - mv "out/templates/godot.web.template_debug.wasm32.zip" "out/templates/web_debug.zip" + - mv "out/templates/godot.web.template_release.wasm32.zip" "out/templates/web_release.zip" + - mv "out/templates/godot.web.template_debug.wasm32.dlink.zip" "out/templates/web_dlink_debug.zip" + - mv "out/templates/godot.web.template_release.wasm32.dlink.zip" "out/templates/web_dlink_release.zip" + - mv "out/templates/godot.web.template_debug.wasm32.nothreads.zip" "out/templates/web_nothreads_debug.zip" + - mv "out/templates/godot.web.template_release.wasm32.nothreads.zip" "out/templates/web_nothreads_release.zip" + - mv "out/templates/godot.web.template_debug.wasm32.nothreads.dlink.zip" "out/templates/web_dlink_nothreads_debug.zip" + - mv "out/templates/godot.web.template_release.wasm32.nothreads.dlink.zip" "out/templates/web_dlink_nothreads_release.zip" artifacts: public: false expire_in: 3 days @@ -983,7 +1065,8 @@ Android-Release-Template-Mono: - popd - ls bin/ - cp bin/*.zip out/templates-mono/ - - cp bin/*.apk out/templates-mono/ + - cp bin/android_monoDebug.apk out/templates-mono/android_debug.apk + - cp bin/android_monoRelease.apk out/templates-mono/android_release.apk - cp bin/*.aar out/templates-mono/ artifacts: public: false @@ -1063,6 +1146,51 @@ build-ios-Debug-Template-arm64-Mono: TYPE: "iPhoneOS" TARGET: "template_debug" +package-ios: + stage: build + tags: [docker] + image: $CI_REGISTRY/redot-engine/redot-production-containers/redot-linux:latest + needs: + - build-ios-Release-Template-arm64 + - build-ios-Release-Template-arm64-Mono + - build-ios-Release-Template-x64 + - build-ios-Release-Template-x64-Mono + - build-ios-Debug-Template-arm64 + - build-ios-Debug-Template-arm64-Mono + - build-ios-Debug-Template-x64 + - build-ios-Debug-Template-x64-Mono + rules: + - if: $DO_RELEASE == "true" + script: + - /root/scripts/Fetch_Deps.sh "ios" + - echo "Packaging IOS" + - cp -r misc/dist/ios_xcode ios_xcode + - cp out/templates/libgodot.ios.template_release.x86_64.simulator.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a + - cp out/templates/libgodot.ios.template_debug.x86_64.simulator.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a + - cp out/templates/libgodot.ios.template_release.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a + - cp out/templates/libgodot.ios.template_debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a + - cp -r deps/moltenvk/MoltenVK/MoltenVK.xcframework ios_xcode/ + - rm -rf ios_xcode/MoltenVK.xcframework/{macos,tvos}* + - cd ios_xcode + - zip -q -9 -r "../out/templates/ios.zip" * + - cd .. + - rm -rf ios_xcode + - echo "Done packaging IOS" + - echo "Packaging IOS Mono" + - cp -r misc/dist/ios_xcode ios_xcode + - cp out/templates-mono/libgodot.ios.template_release.x86_64.simulator.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a + - cp out/templates-mono/libgodot.ios.template_debug.x86_64.simulator.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a + - cp out/templates-mono/libgodot.ios.template_release.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a + - cp out/templates-mono/libgodot.ios.template_debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a + - cp -r deps/moltenvk/MoltenVK/MoltenVK.xcframework ios_xcode/ + - rm -rf ios_xcode/MoltenVK.xcframework/{macos,tvos}* + - cd ios_xcode + - zip -q -9 -r "../out/templates-mono/ios.zip" * + - cd .. + - rm -rf ios_xcode + artifacts: + expire_in: 3 days, + paths: [ out/templates/ios.zip, out/templates-mono/ios.zip ] sign-mac-editor: stage: build @@ -1095,12 +1223,12 @@ sign-mac-editor: _macos_tmpdir="$(pwd)/tmp" _app_path="${_macos_tmpdir}/${_appname}" echo $_macos_tmpdir - echo $__app_path + echo $_app_path cp -r "misc/dist/macos/editor.entitlements" "${_macos_tmpdir}/" rm -rf "${_macos_tmpdir}/${_appname}" cp -r "misc/dist/macos_tools.app" "${_macos_tmpdir}/${_appname}" if [[ "${_is_mono}" == "1" ]]; then - cp -r "${_reldir}/GodotSharp/ " "${_macos_tmpdir}/${_appname}/Contents/Resources/GodotSharp" + cp -r "${_reldir}/GodotSharp/" "${_macos_tmpdir}/${_appname}/Contents/Resources/GodotSharp" fi ls "${_reldir}/" ls "${_macos_tmpdir}/${_appname}/" @@ -1297,7 +1425,7 @@ sign-mac-templates: codesign --force -s - \ --options=linker-signed \ -v macos_template.app/Contents/MacOS/* - zip -r ../out/templates${_mono_prefix}/macos_signed.zip macos_template.app + zip -r ../out/templates${_mono_prefix}/macos.zip macos_template.app popd rm -rf tmp/ } @@ -1321,8 +1449,37 @@ package-builds: - docker image: $CI_REGISTRY/redot-engine/redot-production-containers/redot-linux:latest script: + - major=$(grep -E '^major\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - minor=$(grep -E '^minor\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - patch=$(grep -E '^patch\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - status=$(grep -E '^status\s*=' version.py | sed -E "s/.*=\s*\"([^\"]+)\".*/\1/") + - status_version=$(grep -E '^status_version\s*=' version.py | sed -E "s/.*=\s*([0-9]+).*/\1/") + - | + if [ "$status" == "stable" ] + then + if [ "$patch" == "0" ] + then + export VERSIONSTRING="${major}.${minor}-stable" + export VERSIONTXT="${major}.${minor}.stable" + else + export VERSIONSTRING="${major}.${minor}.${patch}-stable" + export VERSIONTXT="${major}.${minor}.${patch}.stable" + fi + else + if [ "$patch" == "0" ] + then + export VERSIONSTRING="${major}.${minor}-${status}.${status_version}" + export VERSIONTXT="${major}.${minor}.${status}.${status_version}" + else + export VERSIONSTRING="${major}.${minor}.${patch}-${status}.${status_version}" + export VERSIONTXT="${major}.${minor}.${patch}.${status}.${status_version}" + fi + fi - mkdir releases/ - - export RELEASE_DIR="$(pwd)/releases" + - RELEASE_DIR="$(pwd)/releases" + - TARBALL_NAME="redot-${VERSIONSTRING}.tar.xz" + - cp "out/${TARBALL_NAME}" "${RELEASE_DIR}/${TARBALL_NAME}" + - cp "out/${TARBALL_NAME}.sha256" "${RELEASE_DIR}/${TARBALL_NAME}.sha256" - pushd out/linuxbsd/x86_64/tools/ - zip -r "${RELEASE_DIR}/Redot_v${VERSIONSTRING}_linux_x64.zip" ./* - popd @@ -1367,14 +1524,32 @@ package-builds: - popd - mv out/macos/universal/tools/signed/redot.macos.editor.universal_stapled.zip releases/Redot_v${VERSIONSTRING}_macos_universal.zip - mv out/macos/universal/tools-mono/signed/redot.macos.editor.universal.mono_stapled.zip releases/Redot_v${VERSIONSTRING}_macos_mono_universal.zip - - pushd out/templates-mono/ - - zip -r ${RELEASE_DIR}/Redot_v${VERSIONSTRING}_mono_export_templates.zip ./* - - popd - - pushd out/templates/ - - zip -r ${RELEASE_DIR}/Redot_v${VERSIONSTRING}_export_templates.zip ./* + - pushd out/ + - touch ./templates/version.txt + - echo "${VERSIONTXT}" | cat >> ./templates/version.txt + - rm ./templates/redot.macos.template* + - rm ./templates/libgodot.ios* + - zip -r ${RELEASE_DIR}/Redot_v${VERSIONSTRING}_export_templates.zip ./templates/* + - rm -rf ./templates/ + - mv ./templates-mono ./templates/ + - touch ./templates/version.txt + - echo "${VERSIONTXT}.mono" | cat >> ./templates/version.txt + - rm ./templates/redot.macos.template* + - rm ./templates/libgodot.ios* + - zip -r ${RELEASE_DIR}/Redot_v${VERSIONSTRING}_mono_export_templates.zip ./templates/* - popd - mv releases/Redot_v${VERSIONSTRING}_mono_export_templates.zip releases/Redot_v${VERSIONSTRING}_mono_export_templates.tpz - mv releases/Redot_v${VERSIONSTRING}_export_templates.zip releases/Redot_v${VERSIONSTRING}_export_templates.tpz + - touch SHA512-SUMS.txt + - | + for f in releases/*; do + # Only process regular files + [ -f "$f" ] || continue + + # Compute the hash and append it + sha512sum "$f" >> SHA512-SUMS.txt + done + - mv SHA512-SUMS.txt releases/SHA512-SUMS.txt artifacts: expire_in: 3 days paths: