4545 echo "sha=$(git rev-parse @:./godot-cpp)" >> $GITHUB_OUTPUT
4646
4747 - name : Checkout telemetry repo
48- uses : actions/checkout@v4
48+ uses : actions/checkout@v6
4949 id : checkout_tele_repo
5050 if : ${{env.PRODUCTION_BUILD == 'true' && contains(fromJSON('["template_debug", "editor"]'), inputs.target) && contains(fromJSON('["linux", "macos", "windows"]'), inputs.platform)}}
5151 continue-on-error : true
5757 - name : Restore .scons_cache directory
5858 if : inputs.use_cache != 'false'
5959 id : restore_scons_cache
60- uses : actions/cache/restore@v4
60+ uses : actions/cache/restore@v5
6161 with :
6262 path : ${{env.SCONS_CACHE}}
6363 key : ${{github.job}}-${{inputs.artifact}}-${{steps.get_godot_cpp_sha.outputs.sha}}-${{github.ref}}-${{github.sha}}
6666 ${{github.job}}-${{inputs.artifact}}-${{steps.get_godot_cpp_sha.outputs.sha}}
6767
6868 - name : Set up Python 3.x
69- uses : actions/setup-python@v5
69+ uses : actions/setup-python@v6
7070 with :
7171 python-version : " 3.x"
7272 architecture : ${{ fromJSON('["x64", "arm64"]')[runner.arch == 'arm64'] }}
8181 python --version
8282 scons --version
8383
84+ - name : Setup MinGW
85+ if : inputs.platform == 'windows'
86+ id : setup_mingw
87+ uses : ./.github/actions/setup_mingw
88+
8489 - name : Linux dependencies
8590 shell : bash
8691 if : (runner.os == 'Linux') && (inputs.platform == 'linux')
@@ -93,33 +98,51 @@ runs:
9398 - name : Compilation
9499 shell : bash
95100 run : |
101+ run_scons() {
102+ echo "============================================="
103+ echo "Running scons with arguments:"
104+ echo "$@"
105+ echo "======================"
106+ echo ""
107+
108+ scons "$@"
109+ }
110+
96111 echo "::group::🛠️ GDExtesion Compilation 🛠️"
97- scons apply_patches
112+ run_scons apply_patches
113+
114+ scons_mingw_args=""
115+ if [ "${{inputs.platform}}" == "windows" ];then
116+ scons_mingw_args='use_mingw=yes use_llvm=yes mingw_prefix="${{steps.setup_mingw.outputs.mingw_folder}}"'
117+ fi
98118
99119 telemetry_args=""
100120 if [[ "${{env.PRODUCTION_BUILD}}" == "true" && " editor " == *" ${{inputs.target}} "* && " linux macos windows " == *" ${{inputs.platform}} "* && "${{steps.checkout_tele_repo.conclusion}}" == "success" ]]; then
101121 telemetry_args="telemetry_enabled=yes"
102122 fi
103- scons_params="platform=${{inputs.platform}} arch=${{inputs.arch}} optimize=speed target=${{inputs.target}} addon_output_dir=${{inputs.output_libs_path}} ${{inputs.additional}}"
123+ scons_params="platform=${{inputs.platform}} arch=${{inputs.arch}} optimize=speed target=${{inputs.target}} addon_output_dir=${{inputs.output_libs_path}} ${{inputs.additional}} $scons_mingw_args "
104124
105- scons $scons_params $telemetry_args
125+ run_scons $scons_params $telemetry_args
106126
107127 if [ "${{inputs.target}}" == "template_release" ] && [ "${{inputs.build_forced_dd3d}}" == "true" ]; then
108128 echo "============================================="
109129 echo "🧊 build_forced_dd3d"
110- echo "============================================="
111- scons $scons_params force_enabled_dd3d=yes
130+ echo "======================"
131+ echo ""
132+
133+ run_scons $scons_params force_enabled_dd3d=yes
112134 fi
113135
114136 if [ "${{inputs.build_cpp_tests}}" == "true" ]; then
115137 echo "============================================="
116138 echo "🧪 build_cpp_tests"
117- echo "============================================="
139+ echo "======================"
140+ echo ""
118141
119142 # Cleaning the generated folder to avoid cache issues.
120143 rm -rf godot-cpp/gen/
121144
122- scons $scons_params cpp_api_tests=yes custom_godotcpp_suffix=.test_napi folder_to_include_classes=../tests_native_api/cpp cpp_api_auto_gen=no
145+ run_scons $scons_params cpp_api_tests=yes custom_godotcpp_suffix=.test_napi folder_to_include_classes=../tests_native_api/cpp cpp_api_auto_gen=no
123146 fi
124147
125148 echo "::endgroup::"
@@ -136,7 +159,8 @@ runs:
136159 strip -u "$file"
137160 done <<< "$found_files"
138161 else
139- found_files=$(find -L ${{inputs.output_libs_path}} -type f -exec file {} + | grep "ELF" | cut -d: -f1)
162+ exe_format=$([ "${{inputs.platform}}" = "windows" ] && echo "PE32+" || echo "ELF")
163+ found_files=$(find -L ${{inputs.output_libs_path}} -type f -exec file {} + | grep "$exe_format" | cut -d: -f1)
140164 echo "Found files: $found_files"
141165 strip $found_files
142166 fi
@@ -148,15 +172,15 @@ runs:
148172 Remove-Item ${{inputs.output_libs_path}}/* -Recurse -Include *.exp,*.lib,*.pdb -Force
149173
150174 - name : Upload Artifact
151- uses : actions/upload-artifact@v4
175+ uses : actions/upload-artifact@v7
152176 with :
153177 name : ${{inputs.artifact}}
154178 retention-days : 7
155179 path : ${{inputs.output_libs_path}}/*
156180
157181 - name : Save .scons_cache directory
158182 if : inputs.use_cache != 'false'
159- uses : actions/cache/save@v4
183+ uses : actions/cache/save@v5
160184 with :
161185 path : ${{env.SCONS_CACHE}}
162186 key : ${{github.job}}-${{inputs.artifact}}-${{steps.get_godot_cpp_sha.outputs.sha}}-${{github.ref}}-${{github.sha}}
0 commit comments