forked from CraterCrash/godot-orchestrator
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (157 loc) · 6.55 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
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
176
177
178
name: 🛠️ Build All
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref_name }}"
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# - identifier: linux-debug
# name: 🐧 Linux (Debug)
# build_type: Debug
# runner: ubuntu-20.04
# target: template_debug
# platform: linux
# arch: x86_64
- identifier: linux-release
name: 🐧 Linux (Release)
build_type: Release
runner: ubuntu-20.04
target: template_release
platform: linux
arch: x86_64
# - identifier: windows-debug
# name: 🪟 Windows (Debug)
# build_type: Debug
# runner: windows-latest
# target: template_debug
# platform: windows
# arch: x86_64
- identifier: windows-release
name: 🪟 Windows (Release)
build_type: Release
runner: windows-latest
target: template_release
platform: windows
arch: x86_64
# - identifier: macos-debug
# name: 🍎 MacOS (Debug)
# build_type: Debug
# runner: macos-latest
# target: template_debug
# platform: macos
- identifier: macos-release
name: 🍎 MacOS (Release)
build_type: Release
runner: macos-latest
target: template_release
platform: macos
- identifier: android-arm64
name: 🤖 Android Arm64
build_type: Release
runner: ubuntu-20.04
platform: android
arch: arm64-v8a
- identifier: android-arm32
name: 🤖 Android Arm32
build_type: Release
runner: ubuntu-20.04
platform: android
arch: armeabi-v7a
runs-on: ${{ matrix.runner }}
name: ${{ matrix.name }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Linux Dependencies
if: startsWith(matrix.identifier, 'linux-')
uses: ./.github/actions/linux-deps
- name: Setup Windows Dependencies
if: startsWith(matrix.identifier, 'windows-')
uses: ./.github/actions/windows-deps
- name: Setup MacOS Dependencies
if: startsWith(matrix.identifier, 'macos-')
uses: ./.github/actions/macos-deps
- name: Setup Android Dependencies
if: startsWith(matrix.identifier, 'android-')
uses: ./.github/actions/android-deps
- name: Setup Base Dependencies
uses: ./.github/actions/base-deps
- name: ccache (Linux/Mac)
uses: hendrikmuhs/[email protected]
with:
key: ccache-${{ matrix.identifier }}
- name: Build Orchestrator (Linux/MacOS)
if: startsWith(matrix.identifier, 'linux-') || startsWith(matrix.identifier, 'macos-')
shell: sh
run: |
cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }} -G Ninja
cmake --build ${{ github.workspace }}/.out-${{ matrix.identifier }} --target orchestrator -j 18
- name: Build Orchestrator (Windows)
if: startsWith(matrix.identifier, 'windows-')
shell: bash
run: |
cmake -B '${{ github.workspace }}/.out-${{ matrix.identifier }}' -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -S '${{ github.workspace }}' -G Ninja
cmake --build '${{ github.workspace }}/.out-${{ matrix.identifier }}' --target orchestrator -j 18
- name: Build Orchestrator (Android)
if: startsWith(matrix.identifier, 'android-')
shell: sh
run: |
cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_ANDROID_ARCH_ABI=${{ matrix.arch }} -DANDROID_ABI=${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 -DANDROID_PLATFORM=android-23 -DANDROID_TOOLCHAIN=clang -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -S ${{ github.workspace }}
cmake --build ${{ github.workspace }}/.out-${{ matrix.identifier }} --target orchestrator -j 18
- name: Prepare addon files
shell: bash
run: |
cp '${{ github.workspace }}/AUTHORS.md' '${{ github.workspace }}/project/addons/orchestrator/'
cp '${{ github.workspace }}/CHANGELOG.md' '${{ github.workspace }}/project/addons/orchestrator/'
cp '${{ github.workspace }}/README.md' '${{ github.workspace }}/project/addons/orchestrator/'
cp '${{ github.workspace }}/LICENSE' '${{ github.workspace }}/project/addons/orchestrator/'
- name: Upload artifact (Demo)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-demo-${{ matrix.identifier }}
retention-days: 1
path: |
${{ github.workspace }}/project/
- name: Upload artifact (Plugin)
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-plugin-${{ matrix.identifier }}
retention-days: 1
path: |
${{ github.workspace }}/project
!${{ github.workspace }}/project/addons/orchestrator/*debug*
!${{ github.workspace }}/project/scenes
!${{ github.workspace }}/project/icon.svg
!${{ github.workspace }}/project/project.godot
publish:
needs: build
runs-on: ubuntu-latest
name: Combine Artifacts
steps:
- name: Download Plugin Artifacts
uses: actions/download-artifact@v4
with:
pattern: ${{ github.event.repository.name }}-plugin-*
merge-multiple: true
- name: Upload Plugin Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-plugin
retention-days: 1
path: |
${{ github.workspace }}
# - name: Remove Transient Artifacts
# uses: geekyeggo/delete-artifact@v4
# with:
# name: |
# ${{ github.event.repository.name}}-plugin-*
# failOnError: false