Skip to content

Commit 2093c49

Browse files
committed
Should work now
Tested with ACT, so hopefully it'll actually build everything now :)
1 parent 6ec055e commit 2093c49

File tree

1 file changed

+78
-10
lines changed

1 file changed

+78
-10
lines changed

.github/workflows/build.yml

+78-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Build
2+
13
on:
24
workflow_dispatch:
35
push:
@@ -13,7 +15,10 @@ jobs:
1315
strategy:
1416
matrix:
1517
build-type: [Release, Debug]
16-
compilers: [ { cc: "gcc", cxx: "g++", mingw: 'false' }, { cc: "x86_64-w64-mingw32-gcc", cxx: "x86_64-w64-mingw32-g++", mingw: 'true' } ]
18+
compilers: [
19+
{ cc: "gcc", cxx: "g++", mingw: 'false' },
20+
{ cc: "x86_64-w64-mingw32-gcc", cxx: "x86_64-w64-mingw32-g++", mingw: 'true' }
21+
]
1722
steps:
1823
- name: Checkout Repository
1924
uses: actions/[email protected]
@@ -29,7 +34,7 @@ jobs:
2934
uses: actions/cache/[email protected]
3035
with:
3136
path: ${{ github.workspace }}/godot-cpp
32-
key: ${{ matrix.compilers.cxx }}-${{ hashFiles('.gitmodules') }}-${{ matrix.build-type }}
37+
key: ${{ matrix.compilers.cc }}-${{ hashFiles('.gitmodules') }}-${{ matrix.build-type }}
3338

3439
- name: Update submodules
3540
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
@@ -41,7 +46,7 @@ jobs:
4146
uses: lukka/get-cmake@latest
4247

4348
- name: Build godot-cpp
44-
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
49+
if: steps.cache-godot-restore.outputs.cache-hit != 'true' && matrix.compilers.mingw != 'true'
4550
uses: ashutoshvarma/action-cmake-build@master
4651
with:
4752
source-dir: ${{ github.workspace }}/godot-cpp
@@ -51,13 +56,22 @@ jobs:
5156
configure-options: -G Ninja
5257
build-type: ${{ matrix.build-type }}
5358

59+
- name: Build godot-cpp MinGW
60+
if: steps.cache-godot-restore.outputs.cache-hit != 'true' && matrix.compilers.mingw == 'true'
61+
uses: ashutoshvarma/action-cmake-build@master
62+
with:
63+
source-dir: ${{ github.workspace }}/godot-cpp
64+
build-dir: ${{ github.workspace }}/godot-cpp/build
65+
cc: ${{ matrix.compilers.cc }}
66+
cxx: ${{ matrix.compilers.cxx }}
67+
configure-options: -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_FIND_ROOT_PATH=/usr/x86_64-w64-mingw32 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -G Ninja
68+
build-type: ${{ matrix.build-type }}
69+
5470
- name: Setup godot-cpp Environment
5571
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
5672
run: |
57-
mkdir "${{ github.workspace }}/godot-cpp/bin"
58-
mkdir "${{ github.workspace }}/godot-cpp/gen"
59-
cp -r "${{ github.workspace }}/godot-cpp/build/bin" "${{ github.workspace }}/godot-cpp/bin"
60-
cp -r "${{ github.workspace }}/godot-cpp/build/gen" "${{ github.workspace }}/godot-cpp/gen"
73+
cp -r "${{ github.workspace }}/godot-cpp/build/bin" "${{ github.workspace }}/godot-cpp"
74+
cp -r "${{ github.workspace }}/godot-cpp/build/gen" "${{ github.workspace }}/godot-cpp"
6175
6276
- name: Save godot-cpp
6377
id: cache-godot-save
@@ -67,16 +81,70 @@ jobs:
6781
key: ${{ steps.cache-godot-restore.outputs.cache-primary-key }}
6882

6983
- name: Build with CMake
84+
if: matrix.compilers.mingw != 'true'
7085
uses: ashutoshvarma/action-cmake-build@master
7186
with:
7287
build-dir: ${{ github.workspace }}/build
7388
cc: ${{ matrix.compilers.cc }}
7489
cxx: ${{ matrix.compilers.cxx }}
7590
configure-options: -G Ninja
7691
build-type: ${{ matrix.build-type }}
92+
93+
- name: Build with CMake MinGW
94+
if: matrix.compilers.mingw == 'true'
95+
uses: ashutoshvarma/action-cmake-build@master
96+
with:
97+
build-dir: ${{ github.workspace }}/build
98+
cc: ${{ matrix.compilers.cc }}
99+
cxx: ${{ matrix.compilers.cxx }}
100+
configure-options: -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_FIND_ROOT_PATH=/usr/x86_64-w64-mingw32 -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -G Ninja
101+
build-type: ${{ matrix.build-type }}
102+
103+
- name: Upload Built Library Artifact
104+
# We use v3 of both upload and download artifact for ACT compatibility
105+
uses: actions/[email protected]
106+
with:
107+
path: ${{ github.workspace }}/addons/godot-openmpt/bin/*
108+
name: bin-${{ matrix.compilers.cc }}-${{ matrix.build-type }}
109+
package:
110+
runs-on: ubuntu-latest
111+
needs: build
112+
steps:
113+
- name: Checkout Repository
114+
uses: actions/[email protected]
115+
116+
- name: Extract Linux Debug
117+
uses: actions/[email protected]
118+
# In the case of ACT, it may be that we just ran it with a subset matrix and not the full one.
119+
# So it's okay if some of these fail.
120+
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
121+
with:
122+
name: bin-gcc-Debug
123+
path: ${{ github.workspace }}/addons/godot-openmpt/bin
124+
125+
- name: Extract Windows Debug
126+
uses: actions/[email protected]
127+
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
128+
with:
129+
name: bin-x86_64-w64-mingw32-gcc-Debug
130+
path: ${{ github.workspace }}/addons/godot-openmpt/bin
77131

78-
- name: Upload Addon Artifact
79-
uses: actions/[email protected]
132+
- name: Extract Linux Release
133+
uses: actions/[email protected]
134+
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
135+
with:
136+
name: bin-gcc-Release
137+
path: ${{ github.workspace }}/addons/godot-openmpt/bin
138+
139+
- name: Extract Windows Release
140+
uses: actions/[email protected]
141+
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
142+
with:
143+
name: bin-x86_64-w64-mingw32-gcc-Release
144+
path: ${{ github.workspace }}/addons/godot-openmpt/bin
145+
146+
- name: Package Output Addon Artifact
147+
uses: actions/[email protected]
80148
with:
81149
path: ${{ github.workspace }}/addons
82-
name: godot-openmpt-addon
150+
name: godot-openmpt-${{ github.ref_name }}-${{ github.sha }}

0 commit comments

Comments
 (0)