From feaf767f9b95e2055392b8b10d428bddaab949a7 Mon Sep 17 00:00:00 2001 From: MewPurPur Date: Tue, 4 Jun 2024 09:36:26 +0300 Subject: [PATCH] Oh this is SO pissing me off --- .github/workflows/dev-desktop.yml | 8 +++ .github/workflows/export-optimized.yml | 91 +++++++++++++++----------- 2 files changed, 61 insertions(+), 38 deletions(-) diff --git a/.github/workflows/dev-desktop.yml b/.github/workflows/dev-desktop.yml index ec38f938..ea451803 100644 --- a/.github/workflows/dev-desktop.yml +++ b/.github/workflows/dev-desktop.yml @@ -22,8 +22,10 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + - name: Set up Godot uses: ./.github/actions/set-up-godot + - name: Set up WINE and rcedit for Windows export run: | # Download rcedit and install wine. @@ -40,8 +42,10 @@ jobs: # Add wine and rcedit paths to Godot config. echo 'export/windows/wine = "/usr/bin/wine64"' >> ~/.config/godot/editor_settings-4.tres echo 'export/windows/rcedit = "/home/runner/.local/share/rcedit/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-4.tres + - name: Export project uses: ./.github/actions/godot-export + - name: Upload Artifact uses: actions/upload-artifact@v4 with: @@ -60,16 +64,20 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 + - name: Set up Godot uses: ./.github/actions/set-up-godot + - name: Export project uses: ./.github/actions/godot-export + - name: Make Linux export runnable run: | # Set run permission. chmod +x ~/build/${BUILD_NAME}/${PROJECT_NAME}.x86_64 cd ~/build tar zcvf ${BUILD_NAME}.tar.gz ${BUILD_NAME} + - name: Upload Artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/export-optimized.yml b/.github/workflows/export-optimized.yml index 07eb73ab..75479da8 100644 --- a/.github/workflows/export-optimized.yml +++ b/.github/workflows/export-optimized.yml @@ -2,17 +2,24 @@ name: export-optimized on: workflow_dispatch: + push: env: + GODOT_VERSION: 4.2.2 + PROJECT_NAME: GodSVG GODOT_REPO: https://github.com/godotengine/godot.git GODOT_DIR: godot - BUILD_DIR: build GODOT_COMMIT_HASH: 15073af - BUILD_OPTIONS: "target=template_release lto=full production=yes deprecated=no minizip=no brotli=no vulkan=no openxr=no use_volk=no disable_3d=yes modules_enabled_by_default=no module_freetype_enabled=yes module_gdscript_enabled=yes module_svg_enabled=yes module_jpg_enabled=yes module_text_server_adv_enabled=yes graphite=no module_webp_enabled=yes" + BUILD_OPTIONS: target=template_release lto=full production=yes deprecated=no minizip=no brotli=no vulkan=no openxr=no use_volk=no disable_3d=yes modules_enabled_by_default=no module_freetype_enabled=yes module_gdscript_enabled=yes module_svg_enabled=yes module_jpg_enabled=yes module_text_server_adv_enabled=yes graphite=no module_webp_enabled=yes jobs: build-linux: + name: Export GodSVG for Linux runs-on: ubuntu-latest + env: + PLATFORM: "Linux/X11" + EXTENSION: "exe" + BUILD_NAME: "linux-64bit" steps: - name: Checkout repository uses: actions/checkout@v3 @@ -32,28 +39,29 @@ jobs: - name: Build Godot template for Linux run: | cd $GODOT_DIR - scons p=linuxbsd arch=x86_64 optimize=speed $BUILD_OPTIONS - mkdir -p ../$BUILD_DIR - cp bin/godot.linuxbsd.*.x86_64 ../$BUILD_DIR/godot_template_linux + scons p=linuxbsd arch=x86_64 optimize=speed ${BUILD_OPTIONS} + mkdir -p ~/build + cp bin/godot.linuxbsd.template_release.x86_64 ~/build/godot_template_linux - - name: Lmofa - run: ls $BUILD_DIR - - - name: Upload Linux template - uses: actions/upload-artifact@v3 + - name: Upload artifact + uses: actions/upload-artifact@v4 with: name: godot_template_linux - path: $BUILD_DIR/godot_template_linux + path: ~/build/godot_template_linux + if-no-files-found: error retention-days: 1 build-windows: - runs-on: windows-latest + name: Export GodSVG for Windows + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Install dependencies - run: choco install scons + run: | + sudo apt install -y scons python3 + sudo apt install -y g++-mingw-w64-x86-64-posix - name: Clone Godot repository run: git clone $GODOT_REPO $GODOT_DIR @@ -66,18 +74,22 @@ jobs: - name: Build Godot template for Windows run: | + apt search mingw cd $GODOT_DIR - scons p=windows arch=x86_64 optimize=speed $BUILD_OPTIONS - cp bin/godot.windows.*.64 ../$BUILD_DIR/godot_template_windows + scons p=windows target=release_debug tools=no ${BUILD_OPTIONS} + mkdir -p ~/build + cp bin/godot.windows.template_release.x86_64.exe ~/build/godot_template_windows - - name: Upload Windows template - uses: actions/upload-artifact@v3 + - name: Upload artifact + uses: actions/upload-artifact@v4 with: name: godot_template_windows - path: $BUILD_DIR/godot_template_windows + path: ~/build/godot_template_windows + if-no-files-found: error retention-days: 1 build-web: + name: Export GodSVG for Web runs-on: ubuntu-latest steps: - name: Checkout repository @@ -108,18 +120,20 @@ jobs: run: | cd $GODOT_DIR source ../emsdk/emsdk_env.sh - scons p=web arch=wasm32 javascript_eval=no optimize=size $BUILD_OPTIONS - mkdir -p ../$BUILD_DIR/godot_template_web - cp bin/godot.javascript.opt.* ../$BUILD_DIR/godot_template_web + scons p=web arch=wasm32 javascript_eval=no optimize=size ${BUILD_OPTIONS} + mkdir -p ~/build + cp bin/godot.web.* ~/build/godot_template_web - - name: Upload Web template - uses: actions/upload-artifact@v3 + - name: Upload artifact + uses: actions/upload-artifact@v4 with: name: godot_template_web - path: $BUILD_DIR/godot_template_web + path: ~/build/godot_template_web + if-no-files-found: error retention-days: 1 build-macos: + name: Export GodSVG for MacOS runs-on: macos-latest steps: - name: Checkout repository @@ -140,37 +154,38 @@ jobs: - name: Build Godot template for macOS (arm64 release) run: | cd $GODOT_DIR - scons p=macos arch=arm64 optimize=speed $BUILD_OPTIONS - mkdir -p ../$BUILD_DIR - cp bin/godot.macos.template_release.arm64 ../$BUILD_DIR/godot_template_macos_release_arm64 + scons p=macos arch=arm64 optimize=speed ${BUILD_OPTIONS} + mkdir -p ~/build + cp bin/godot.macos.*arm64 ~/build/godot_template_macos_release_arm64 - name: Build Godot template for macOS (x86_64 release) run: | cd $GODOT_DIR - scons p=macos arch=x86_64 optimize=speed $BUILD_OPTIONS - cp bin/godot.macos.template_release.x86_64 ../$BUILD_DIR/godot_template_macos_release_x86_64 + scons p=macos arch=x86_64 optimize=speed ${BUILD_OPTIONS} + cp bin/godot.macos.*x86_64 ~/build/godot_template_macos_release_x86_64 - name: Combine binaries with lipo run: | - cd $BUILD_DIR - lipo -create godot.macos.template_release.arm64 godot.macos.template_release.x86_64 -output godot_template_macos_release_universal - chmod +x godot_template_macos_* + cd ~/build + lipo -create godot_template_macos_release_arm64 godot_template_macos_release_x86_64 -output godot_template_macos_release_universal + chmod +x godot_template_macos_release_universal - name: Prepare .app bundle run: | - cp -R ~/workspace/misc/dist/macos_template.app . - mkdir -p macos_template.app/Contents/MacOS - cp godot_template_macos_debug_universal macos_template.app/Contents/MacOS/godot_macos_debug.universal - cp godot_template_macos_release_universal macos_template.app/Contents/MacOS/godot_macos_release.universal - chmod +x macos_template.app/Contents/MacOS/godot_macos* + mkdir -p ~/build/macos_template.app/Contents/MacOS + cp godot_template_macos_release_universal ~/build/macos_template.app/Contents/MacOS/godot + chmod +x ~/build/macos_template.app/Contents/MacOS/godot - name: Zip the .app bundle - run: zip -q -9 -r macos.zip macos_template.app + run: | + cd ~/build + zip -q -9 -r macos.zip macos_template.app - name: Upload macOS template uses: actions/upload-artifact@v3 with: name: godot_template_macos path: macos.zip + if-no-files-found: error retention-days: 1