-
Notifications
You must be signed in to change notification settings - Fork 8
220 lines (188 loc) · 6.28 KB
/
deploy.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Deploy
on:
# Build on commits pushed, except when explicitly skipped.
push:
branches-ignore:
- 'no-ci-**'
- 'skip-ci-**'
# Build on pull requests, except drafts.
pull_request:
# Build on a schedule to keep up with the engine changes.
schedule:
- cron: '0 0 * * 0'
env:
# Common settings.
CMAKE_VERSION: 3.21.x
# Common paths.
ci_source_dir: ${{ github.workspace }}/source-code
ci_build_script: ./source-code/Script/ci_build.sh
ci_build_dir: ${{ github.workspace }}/cmake-build
ci_native_sdk_dir: ${{ github.workspace }}/SDK-native
ci_target_sdk_dir: ${{ github.workspace }}/SDK-target
jobs:
CheckSkipCI:
runs-on: ubuntu-20.04
if: |
!contains(github.event.head_commit.message, '[skip ci]') &&
!contains(github.event.pull_request.title, '[skip ci]') &&
!contains(github.event.head_commit.message, '[skip-ci]') &&
!contains(github.event.pull_request.title, '[skip-ci]')
steps:
- run: exit 0
# Build the project for Web using both engine SDK and engine in subdirectory.
# SDK build is published to itch.io.
Web:
if: github.event.pull_request.draft == false
runs-on: ubuntu-20.04
needs: [CheckSkipCI]
strategy:
fail-fast: false
matrix:
ci_build_mode:
- sdk
- subdirectory
env:
ci_platform: web
ci_native_sdk_name: rebelfork-sdk-Linux-clang-rel-dll-x64-latest.zip
ci_target_sdk_name: rebelfork-sdk-Web-rel-lib-latest.zip
ci_emsdk_version: latest
ci_build_mode: ${{ matrix.ci_build_mode }}
ci_publish: ${{ github.ref == 'refs/heads/master' && github.repository == 'rbfx/sample-project' && matrix.ci_build_mode == 'sdk'}}
BINARYEN_CORES: 1
steps:
- uses: mymindstorm/setup-emsdk@v11
with:
version: ${{ env.ci_emsdk_version }}
- name: Checkout Sample Project
uses: actions/checkout@v2
with:
path: ${{ env.ci_source_dir }}
fetch-depth: 1
submodules: true
- name: Checkout the Framework
if: ${{ matrix.ci_build_mode == 'subdirectory' }}
uses: actions/checkout@v2
with:
repository: rbfx/rbfx
path: ${{ env.ci_source_dir }}/../rbfx
fetch-depth: 1
submodules: true
- name: Download native SDK
uses: robinraju/[email protected]
with:
repository: rbfx/rbfx
tag: latest
fileName: ${{ env.ci_native_sdk_name }}
- name: Unzip native SDK
run: |
cd ${{ github.workspace }}
unzip ${{ env.ci_native_sdk_name }}
mv ./SDK ./SDK-native
- name: Download target SDK
if: ${{ matrix.ci_build_mode == 'sdk' }}
uses: robinraju/[email protected]
with:
repository: rbfx/rbfx
tag: latest
fileName: ${{ env.ci_target_sdk_name }}
- name: Unzip target SDK
if: ${{ matrix.ci_build_mode == 'sdk' }}
run: |
cd ${{ github.workspace }}
unzip ${{ env.ci_target_sdk_name }}
mv ./SDK ./SDK-target
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '${{ env.CMAKE_VERSION }}'
- name: Dependencies
shell: bash
run: ${{ env.ci_build_script }} dependencies
- name: Generate
shell: bash
run: ${{ env.ci_build_script }} generate
- name: Build
shell: bash
run: ${{ env.ci_build_script }} build
- name: Prepare
if: ${{ env.ci_publish }}
shell: bash
run: ${{ env.ci_build_script }} prepare
- name: Publish
if: ${{ env.ci_publish }}
uses: KikimoraGames/[email protected]
with:
butlerApiKey: ${{ secrets.BUTLER_API_KEY }}
gameData: ${{ github.workspace }}/cmake-build/bin/project
itchUsername: eugeneko
itchGameId: sample-project
buildChannel: web
# Build the project for Windows using both engine SDK and engine in subdirectory.
Windows:
if: github.event.pull_request.draft == false
runs-on: windows-2022
needs: [CheckSkipCI]
strategy:
fail-fast: false
matrix:
ci_build_mode:
- sdk
- subdirectory
env:
ci_platform: windows
ci_target_sdk_name: rebelfork-sdk-Windows-msvc-rel-dll-x64-latest.zip
ci_build_mode: ${{ matrix.ci_build_mode }}
ci_publish: ${{ github.ref == 'refs/heads/master' && github.repository == 'rbfx/sample-project' && matrix.ci_build_mode == 'sdk'}}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
steps:
- name: Checkout Sample Project
uses: actions/checkout@v3
with:
path: ${{ env.ci_source_dir }}
fetch-depth: 1
submodules: true
- name: Checkout the Framework
if: ${{ matrix.ci_build_mode == 'subdirectory' }}
uses: actions/checkout@v2
with:
repository: rbfx/rbfx
path: ${{ env.ci_source_dir }}/../rbfx
fetch-depth: 1
submodules: true
- name: Download target SDK
if: ${{ matrix.ci_build_mode == 'sdk' }}
uses: robinraju/[email protected]
with:
repository: rbfx/rbfx
tag: latest
fileName: ${{ env.ci_target_sdk_name }}
- name: Unzip target SDK
if: ${{ matrix.ci_build_mode == 'sdk' }}
run: |
cd ${{ github.workspace }}
unzip ${{ env.ci_target_sdk_name }}
mv ./SDK ./SDK-target
- name: Set up butler
if: ${{ env.ci_publish }}
uses: jdno/setup-butler@v1
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: '${{ env.CMAKE_VERSION }}'
- name: Dependencies
shell: bash
run: ${{ env.ci_build_script }} dependencies
- name: Generate
shell: bash
run: ${{ env.ci_build_script }} generate
- name: Build
shell: bash
run: ${{ env.ci_build_script }} build
- name: Prepare
if: ${{ env.ci_publish }}
shell: bash
run: ${{ env.ci_build_script }} prepare
- name: Publish
if: ${{ env.ci_publish }}
run: |
butler push "${{ env.ci_build_dir }}/bin/project" "eugeneko/sample-project:windows"