-
-
Notifications
You must be signed in to change notification settings - Fork 30
226 lines (197 loc) · 7.48 KB
/
nightly-builds.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
221
222
223
224
225
226
name: nightly-builds
on:
push:
paths-ignore:
- 'documentation/**'
pull_request:
paths-ignore:
- 'documentation/**'
jobs:
build-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
cmake_preset: windows-x86-debug
build_conf: Debug
devenv_arch: amd64_x86
- os: windows-latest
cmake_preset: windows-x64-debug
build_conf: Debug
devenv_arch: amd64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Create build environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{ github.workspace }}/build
- uses: ilammy/[email protected]
with:
arch: ${{ matrix.devenv_arch }}
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Configure CMake
working-directory: ${{ github.workspace }}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake "${{ github.workspace }}" --preset ${{ matrix.cmake_preset }}
- name: Build
working-directory: ${{ github.workspace }}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ matrix.build_conf }} --parallel 8
- name: Prepare artifacts
run: |
mkdir artifacts\
mkdir -p publish\primext\bin
mkdir -p publish\primext\devkit
move build\${{ matrix.build_conf }}\* publish\
move game_dir\* publish\primext
Compress-Archive -Path publish\* -Destination artifacts\primext-${{ matrix.cmake_preset }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifact-${{ matrix.cmake_preset }}
path: artifacts/*
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
cmake_preset: linux-x64-debug
build_conf: Debug
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Create build environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{ github.workspace }}/build
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib cmake ninja-build
sudo apt-get install qtbase5-dev
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: ${{ github.workspace }}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: cmake $GITHUB_WORKSPACE --preset ${{ matrix.cmake_preset }}
- name: Build
working-directory: ${{ github.workspace }}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ matrix.build_conf }} --parallel 8
- name: Prepare artifacts
run: |
mkdir artifacts/
mkdir -p publish/primext/bin
mkdir -p publish/primext/devkit
cp -r build/${{ matrix.build_conf }}/primext/* publish/primext/
cp build/${{ matrix.build_conf }}/primext_run publish/
cp -r game_dir/* publish/primext
pushd publish
zip -r ../artifacts/primext-${{ matrix.cmake_preset }}.zip ./*
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifact-${{ matrix.cmake_preset }}
path: artifacts/*
build-android:
runs-on: ubuntu-latest
strategy:
matrix:
conf: [Debug]
env:
BUILD_TYPE: ${{ matrix.conf }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib cmake ninja-build
- name: Setup Java
uses: actions/[email protected]
with:
distribution: 'microsoft'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Build
run: chmod +x ./gradlew && ./gradlew assembleDebug
working-directory: android
env:
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/26.1.10909125
- name: Prepare artifacts
run: |
mkdir artifacts/
cp android/app/build/outputs/apk/debug/app-debug.apk artifacts/primext-debug.apk
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifact-android-debug
path: artifacts/*
release:
name: release-builds
runs-on: ubuntu-latest
needs: [build-windows, build-linux]
steps:
- name: Check for pull request
uses: 8BitJonny/[email protected]
id: pr-check
with:
# Verbose setting SHA when using Pull_Request event trigger to fix #16. (For push even trigger this is not necessary.)
sha: ${{ github.event.pull_request.head.sha }}
- name: Fetch artifacts
if: ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
uses: actions/[email protected]
with:
path: artifacts/
- name: Remove old release
if: ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: continious
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Repackage binaries and allow GitHub to process removed release for few seconds
if: ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
continue-on-error: true
run: |
cd artifacts/
for i in artifact-*; do
mv "$i"/* .
rm -rf "$i"
done
ls -R .
cd ../
sleep 20s
- name: Upload new release
if: ${{ always() && github.ref == 'refs/heads/master' && steps.pr-check.outputs.pr_found == 'false' }}
uses: softprops/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: artifacts/*
tag_name: continious
draft: false
prerelease: true
name: PrimeXT Continuous Build