-
Notifications
You must be signed in to change notification settings - Fork 5
150 lines (133 loc) · 5.42 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Build
on:
workflow_dispatch:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
build-type: [Release, Debug]
compilers: [
{ cc: "gcc", cxx: "g++", mingw: 'false' },
{ cc: "x86_64-w64-mingw32-gcc", cxx: "x86_64-w64-mingw32-g++", mingw: 'true' }
]
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Install MinGW
if: matrix.compilers.mingw == 'true'
uses: egor-tensin/[email protected]
with:
cc: 0
- name: Restore godot-cpp
id: cache-godot-restore
uses: actions/cache/[email protected]
with:
path: |
${{ github.workspace }}/godot-cpp/gdextension
${{ github.workspace }}/godot-cpp/include
${{ github.workspace }}/custom-godotcpp-build
key: ${{ matrix.compilers.cc }}-${{ hashFiles('.gitmodules') }}-${{ matrix.build-type }}
- name: Update submodules
if: steps.cache-godot-restore.outputs.cache-hit != 'true'
uses: actions/[email protected]
with:
submodules: recursive
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Build godot-cpp
if: steps.cache-godot-restore.outputs.cache-hit != 'true' && matrix.compilers.mingw != 'true'
uses: ashutoshvarma/action-cmake-build@master
with:
source-dir: ${{ github.workspace }}/custom-godotcpp-build
build-dir: ${{ github.workspace }}/custom-godotcpp-build
cc: ${{ matrix.compilers.cc }}
cxx: ${{ matrix.compilers.cxx }}
configure-options: -G Ninja
build-type: ${{ matrix.build-type }}
- name: Build godot-cpp MinGW
if: steps.cache-godot-restore.outputs.cache-hit != 'true' && matrix.compilers.mingw == 'true'
uses: ashutoshvarma/action-cmake-build@master
with:
source-dir: ${{ github.workspace }}/custom-godotcpp-build
build-dir: ${{ github.workspace }}/custom-godotcpp-build
cc: ${{ matrix.compilers.cc }}
cxx: ${{ matrix.compilers.cxx }}
configure-options: -DGENERATE_DEBUG_SYMBOLS=OFF -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
build-type: ${{ matrix.build-type }}
- name: Save godot-cpp
id: cache-godot-save
uses: actions/cache/[email protected]
with:
path: |
${{ github.workspace }}/godot-cpp/gdextension
${{ github.workspace }}/godot-cpp/include
${{ github.workspace }}/custom-godotcpp-build
key: ${{ steps.cache-godot-restore.outputs.cache-primary-key }}
- name: Build with CMake
if: matrix.compilers.mingw != 'true'
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
cc: ${{ matrix.compilers.cc }}
cxx: ${{ matrix.compilers.cxx }}
configure-options: -G Ninja
build-type: ${{ matrix.build-type }}
- name: Build with CMake MinGW
if: matrix.compilers.mingw == 'true'
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
cc: ${{ matrix.compilers.cc }}
cxx: ${{ matrix.compilers.cxx }}
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
build-type: ${{ matrix.build-type }}
- name: Upload Built Library Artifact
# We use v3 of both upload and download artifact for ACT compatibility
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/addons/godot-openmpt/bin/*
name: bin-${{ matrix.compilers.cc }}-${{ matrix.build-type }}
package:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Extract Linux Debug
uses: actions/[email protected]
# In the case of ACT, it may be that we just ran it with a subset matrix and not the full one.
# So it's okay if some of these fail.
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
with:
name: bin-gcc-Debug
path: ${{ github.workspace }}/addons/godot-openmpt/bin
- name: Extract Windows Debug
uses: actions/[email protected]
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
with:
name: bin-x86_64-w64-mingw32-gcc-Debug
path: ${{ github.workspace }}/addons/godot-openmpt/bin
- name: Extract Linux Release
uses: actions/[email protected]
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
with:
name: bin-gcc-Release
path: ${{ github.workspace }}/addons/godot-openmpt/bin
- name: Extract Windows Release
uses: actions/[email protected]
continue-on-error: ${{ env.ACT && 'true' || 'false' }}
with:
name: bin-x86_64-w64-mingw32-gcc-Release
path: ${{ github.workspace }}/addons/godot-openmpt/bin
- name: Package Output Addon Artifact
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/addons
name: godot-openmpt-${{ github.ref_name }}-${{ github.sha }}