-
-
Notifications
You must be signed in to change notification settings - Fork 0
176 lines (169 loc) · 5.84 KB
/
build.yml
File metadata and controls
176 lines (169 loc) · 5.84 KB
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Build and test
on: [push, pull_request]
defaults:
run:
shell: bash
env:
SCONS_CACHE: ${{ github.workspace }}/.scons-cache
jobs:
build_macos:
name: ${{ matrix.platform }} (simulator=${{ matrix.simulator }}, ${{ matrix.arch }}, ${{ matrix.target }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [universal]
platform: [macos, ios]
simulator: [true, false]
exclude:
- platform: macos
simulator: true
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Setup godot-cpp
uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp
with:
platform: ${{ matrix.platform }}
- name: Cache SCons files and compiled files
uses: actions/cache@v4
with:
path: .scons-cache/
key: ${{ matrix.platform }}-simulator=${{ matrix.simulator }}-${{ matrix.arch }}-${{ matrix.target }}-${{ hashfiles('.gitmodules', 'SConstruct', 'src/**') }}
restore-keys: |
${{ matrix.platform }}-simulator=${{ matrix.simulator }}-${{ matrix.arch }}-${{ matrix.target }}-
- name: Build artifact
run: |
scons platform=${{ matrix.platform }} ios_simulator=${{ matrix.simulator }} arch=${{ matrix.arch }} target=${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-simulator=${{ matrix.simulator }}-${{ matrix.arch }}-${{ matrix.target }}
path: |
addons/objc-gdextension/build/libobjcgdextension.*
build_linux:
name: ${{ matrix.platform }} (${{ matrix.arch }})
runs-on: ${{ matrix.runner || 'ubuntu-22.04' }}
strategy:
fail-fast: false
matrix:
arch: [x86_64, x86_32, arm64, arm32]
platform: [linux, android]
include:
- platform: linux
arch: x86_32
packages: [g++-multilib]
- platform: linux
arch: arm64
runner: ubuntu-22.04-arm
exclude:
- platform: linux
arch: arm32
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Setup godot-cpp
uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp
with:
platform: ${{ matrix.platform }}
- name: Setup dependencies
if: ${{ join(matrix.packages, ' ') != '' }}
run: |
sudo apt-get update
sudo apt-get install ${{ join(matrix.packages, ' ') }}
- name: Generate bindings
run: |
make -C lib/gdextension-lite generate-bindings
- name: Build artifact
run: |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=template_release build_library=false ${{ join(matrix.scons-args, ' ') }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}
path: |
addons/objc-gdextension/build/libobjcgdextension.*
build_windows:
name: ${{ matrix.platform }} (${{ matrix.arch }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, x86_32, arm64]
platform: [windows]
steps:
- uses: actions/checkout@v5
with:
submodules: true
- name: Setup godot-cpp
uses: ./lib/godot-cpp/.github/actions/setup-godot-cpp
with:
platform: ${{ matrix.platform }}
windows-compiler: msvc
- name: Generate bindings
run: |
make -C lib/gdextension-lite generate-bindings
- name: Build artifact
run: |
scons platform=${{ matrix.platform }} arch=${{ matrix.arch }} target=template_release build_library=false ${{ join(matrix.scons-args, ' ') }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}
path: |
addons/objc-gdextension/build/libobjcgdextension.*
test_distribution:
name: Test ${{ matrix.name }}
needs: [build_macos]
runs-on: ${{ matrix.runner-os }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS
runner-os: macos-latest
godot-release: 4.5.1-stable/Godot_v4.5.1-stable_macos.universal.zip
godot-bin: ./Godot.app/Contents/MacOS/Godot
env:
GODOT_BIN: ${{ matrix.godot-bin }}
steps:
- uses: actions/checkout@v5
- name: Download artifacts
id: download
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Copy artifacts to build folder
run: cp -r '${{ steps.download.outputs.download-path }}'/**/libobjcgdextension* addons/objc-gdextension/build
- name: Download Godot
run: |
curl --location https://github.com/godotengine/godot/releases/download/${{ matrix.godot-release }} --output godot.zip
unzip godot.zip
- name: Run tests
run: |
make test
build_distribution_zip:
name: Build distribution zip
needs: [build_macos, build_linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Download artifacts
id: download
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Copy artifacts to build folder
run: cp -r ${{ steps.download.outputs.download-path }}/**/libobjcgdextension* addons/objc-gdextension/build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: objc-gdextension
path: |
LICENSE
addons/objc-gdextension/LICENSE
addons/objc-gdextension/*.gdextension
addons/objc-gdextension/build/libobjcgdextension*