1
+ name : Build
2
+
1
3
on :
2
4
workflow_dispatch :
3
5
push :
13
15
strategy :
14
16
matrix :
15
17
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
+ ]
17
22
steps :
18
23
- name : Checkout Repository
19
24
29
34
uses :
actions/cache/[email protected]
30
35
with :
31
36
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 }}
33
38
34
39
- name : Update submodules
35
40
if : steps.cache-godot-restore.outputs.cache-hit != 'true'
41
46
uses : lukka/get-cmake@latest
42
47
43
48
- 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'
45
50
uses : ashutoshvarma/action-cmake-build@master
46
51
with :
47
52
source-dir : ${{ github.workspace }}/godot-cpp
@@ -51,13 +56,22 @@ jobs:
51
56
configure-options : -G Ninja
52
57
build-type : ${{ matrix.build-type }}
53
58
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
+
54
70
- name : Setup godot-cpp Environment
55
71
if : steps.cache-godot-restore.outputs.cache-hit != 'true'
56
72
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"
61
75
62
76
- name : Save godot-cpp
63
77
id : cache-godot-save
@@ -67,16 +81,70 @@ jobs:
67
81
key : ${{ steps.cache-godot-restore.outputs.cache-primary-key }}
68
82
69
83
- name : Build with CMake
84
+ if : matrix.compilers.mingw != 'true'
70
85
uses : ashutoshvarma/action-cmake-build@master
71
86
with :
72
87
build-dir : ${{ github.workspace }}/build
73
88
cc : ${{ matrix.compilers.cc }}
74
89
cxx : ${{ matrix.compilers.cxx }}
75
90
configure-options : -G Ninja
76
91
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
+
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
+
115
+
116
+ - name : Extract Linux Debug
117
+
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
+
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
77
131
78
- - name : Upload Addon Artifact
79
-
132
+ - name : Extract Linux Release
133
+
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
+
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
+
80
148
with :
81
149
path : ${{ github.workspace }}/addons
82
- name : godot-openmpt-addon
150
+ name : godot-openmpt-${{ github.ref_name }}-${{ github.sha }}
0 commit comments