Quick & simplified steps on how to do that (my laptop is weak)
Create new... > New codespace, or https://github.com/codespaces/new
# match the branch to the project's version
git clone https://github.com/godotengine/godot.git -b 4.1.1-stable
# go to the source code dir
cd godot
python -m pip install scons
sudo apt-get update
sudo apt-get -y install mingw-w64
64-bit:
sudo update-alternatives --config x86_64-w64-mingw32-gcc
<choose x86_64-w64-mingw32-gcc-posix from the list>
sudo update-alternatives --config x86_64-w64-mingw32-g++
<choose x86_64-w64-mingw32-g++-posix from the list>
32-bit:
sudo update-alternatives --config i686-w64-mingw32-gcc
<choose i686-w64-mingw32-gcc-posix from the list>
sudo update-alternatives --config i686-w64-mingw32-g++
<choose i686-w64-mingw32-g++-posix from the list>
scons platform=windows target=template_debug arch=x86_32
scons platform=windows target=template_release arch=x86_32
scons platform=windows target=template_debug arch=x86_64
scons platform=windows target=template_release arch=x86_64
Download the resulting files in bin/
or commit and push the changes to the repository