|
1 | 1 | name: Setup godot-cpp |
2 | | -description: Setup build dependencies for godot-cpp. |
| 2 | +description: Setup build dependencies for godot-cpp (SCons or CMake). |
3 | 3 |
|
4 | 4 | inputs: |
5 | 5 | platform: |
6 | 6 | required: true |
7 | 7 | description: Target platform. |
8 | | - em-version: |
9 | | - default: 4.0.11 |
10 | | - description: Emscripten version. |
11 | | - windows-compiler: |
12 | | - required: true |
13 | | - description: The compiler toolchain to use on Windows ('mingw' or 'msvc'). |
14 | 8 | type: choice |
15 | 9 | options: |
16 | | - - mingw |
| 10 | + - linux |
| 11 | + - windows |
| 12 | + - macos |
| 13 | + - android |
| 14 | + - web |
| 15 | + |
| 16 | + compiler: |
| 17 | + description: Compiler toolchain (auto selects sensible default per platform). |
| 18 | + required: false |
| 19 | + default: auto |
| 20 | + type: choice |
| 21 | + options: |
| 22 | + - auto |
| 23 | + - gcc |
| 24 | + - clang |
17 | 25 | - msvc |
18 | | - default: mingw |
| 26 | + - mingw |
| 27 | + |
19 | 28 | mingw-version: |
20 | 29 | default: 12.2.0 |
21 | | - description: MinGW version. |
| 30 | + description: MinGW version (used only for windows + mingw). |
| 31 | + |
22 | 32 | ndk-version: |
23 | 33 | default: r28b |
24 | 34 | description: Android NDK version. |
| 35 | + |
| 36 | + em-version: |
| 37 | + default: 3.1.74 |
| 38 | + description: Emscripten version (recommended for Godot 4.x web). |
| 39 | + |
25 | 40 | buildtool: |
| 41 | + description: Build tool to prepare (scons or cmake). |
26 | 42 | default: scons |
27 | | - description: scons or cmake |
| 43 | + type: choice |
| 44 | + options: |
| 45 | + - scons |
| 46 | + - cmake |
| 47 | + |
28 | 48 | scons-version: |
29 | | - default: 4.4.0 |
| 49 | + default: 4.8.0 |
30 | 50 | description: SCons version. |
31 | 51 |
|
32 | | - |
33 | 52 | runs: |
34 | 53 | using: composite |
35 | 54 | steps: |
36 | | - - name: Setup Python (for SCons) |
| 55 | + - name: Setup Python |
37 | 56 | uses: actions/setup-python@v5 |
38 | 57 | with: |
39 | | - python-version: 3.x |
| 58 | + python-version: 3.12 |
40 | 59 |
|
41 | | - - name: Setup Android dependencies |
42 | | - if: inputs.platform == 'android' |
| 60 | + # === Compiler Toolchain Setup === |
| 61 | + |
| 62 | + - name: Setup Clang on Linux or Windows |
| 63 | + if: ${{ (inputs.platform == 'linux' || inputs.platform == 'windows') && inputs.compiler == 'clang' }} |
| 64 | + uses: egor-tensin/setup-clang@v2 |
| 65 | + with: |
| 66 | + version: 18 |
| 67 | + |
| 68 | + - name: Setup MinGW (Windows) |
| 69 | + if: ${{ inputs.platform == 'windows' && (inputs.compiler == 'mingw' || (inputs.compiler == 'auto' && inputs.compiler != 'msvc')) }} |
| 70 | + uses: egor-tensin/setup-mingw@v2 |
| 71 | + with: |
| 72 | + version: ${{ inputs.mingw-version }} |
| 73 | + |
| 74 | + # MSVC requires no extra setup on windows-latest runners (Visual Studio is preinstalled) |
| 75 | + |
| 76 | + - name: Setup Android NDK |
| 77 | + if: ${{ inputs.platform == 'android' }} |
43 | 78 | uses: nttld/setup-ndk@v1 |
44 | 79 | with: |
45 | 80 | ndk-version: ${{ inputs.ndk-version }} |
46 | 81 | link-to-sdk: true |
47 | 82 |
|
48 | | - - name: Setup Web dependencies |
49 | | - if: inputs.platform == 'web' |
| 83 | + - name: Setup Emscripten (Web) |
| 84 | + if: ${{ inputs.platform == 'web' }} |
50 | 85 | uses: mymindstorm/setup-emsdk@v14 |
51 | 86 | with: |
52 | 87 | version: ${{ inputs.em-version }} |
53 | 88 | no-cache: true |
54 | 89 |
|
55 | | - - name: Setup MinGW for Windows/MinGW build |
56 | | - if: inputs.platform == 'windows' && inputs.windows-compiler == 'mingw' |
57 | | - uses: egor-tensin/setup-mingw@v2 |
58 | | - with: |
59 | | - version: ${{ inputs.mingw-version }} |
| 90 | + # macOS uses AppleClang by default — no extra setup needed on macos-latest |
| 91 | + |
| 92 | + # === Build Tool Setup === |
60 | 93 |
|
61 | 94 | - name: Setup SCons |
62 | 95 | if: ${{ inputs.buildtool == 'scons' }} |
63 | 96 | shell: bash |
64 | 97 | run: | |
65 | | - python -c "import sys; print(sys.version)" |
66 | 98 | python -m pip install scons==${{ inputs.scons-version }} |
67 | 99 | scons --version |
68 | 100 |
|
69 | | - - name: Install Ninja |
| 101 | + - name: Install Ninja (for CMake) |
70 | 102 | if: ${{ inputs.buildtool == 'cmake' }} |
71 | | - uses: ashutoshvarma/setup-ninja@master |
| 103 | + uses: ashutoshvarma/setup-ninja@v1.1 |
| 104 | + |
| 105 | + - name: Debug chosen configuration |
| 106 | + shell: bash |
| 107 | + run: | |
| 108 | + echo "Platform : ${{ inputs.platform }}" |
| 109 | + echo "Compiler : ${{ inputs.compiler }}" |
| 110 | + echo "Buildtool: ${{ inputs.buildtool }}" |
0 commit comments