-
-
Notifications
You must be signed in to change notification settings - Fork 31
214 lines (192 loc) · 5.97 KB
/
linux-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
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
name: Linux-Build
on:
pull_request:
push:
paths-ignore:
- '.github/workflows/windows-build.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04]
arch: [x64]
mode: [debug, releasedbg]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
env:
OBS_VERSION: '26.0.0'
steps:
- name: Get current date as package key
id: pkg_key
run: echo "::set-output name=key::$(date +'%W')"
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Kinect SDKs
uses: actions/checkout@v4
continue-on-error: true
with:
repository: SirLynix/kinect-sdks
token: ${{ secrets.KINECT_SDKS_PAT }}
path: ${{ github.workspace }}/kinect-sdks
# Install OBS studio & Kinect for Azure dependencies
- name: Install apt dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
checkinstall \
cmake \
git \
libmbedtls-dev \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfdk-aac-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libluajit-5.1-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
pkg-config \
python3-dev \
qtbase5-dev \
libqt5svg5-dev \
swig \
libxcb-randr0-dev \
libxcb-xfixes0-dev \
libx11-xcb-dev \
libxcb1-dev \
libxss-dev \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
file \
dpkg-dev \
qemu \
binfmt-support \
qemu-user-static \
pkg-config \
ninja-build \
doxygen \
clang \
python3 \
gcc \
g++ \
git \
git-lfs \
nasm \
cmake \
powershell \
libgl1-mesa-dev \
libsoundio-dev \
libjpeg-dev \
libvulkan-dev \
libx11-dev \
libxcursor-dev \
libxinerama-dev \
libxrandr-dev \
libusb-1.0-0-dev \
libssl-dev \
libudev-dev \
mesa-common-dev \
uuid-dev
# Cache OBS Studio
- name: Retrieve OBS Studio cache
uses: actions/cache@v3
id: obs-cache
with:
path: ${{ github.workspace }}/obs-studio
key: Linux-OBS-Studio-${{ env.OBS_VERSION }}
# Build obs-studio
- name: Clone OBS
if: steps.obs-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
fetch-depth: 0 # for tags
# Checkout OBS to the wanted version
- name: Checkout OBS-Studio release (${{ env.OBS_VERSION }})
if: steps.obs-cache.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_VERSION }}
git submodule update
# Configure and build obs
- name: Build OBS-Studio
if: steps.obs-cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
mkdir ./build64
cd ./build64
cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES ..
make -j4 libobs
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev
# Prepare environment
- name: Configure build
run:
printf "LibObs = {\n Include = [[${{ github.workspace }}/obs-studio/libobs]],\n Lib64 = [[${{ github.workspace }}/obs-studio/build64/libobs]]\n}\n\nObsPlugins={}" > config.lua
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "::set-output name=hash::$(xmake l utils.ci.packageskey)"
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Linux-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.pkg_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --yes --verbose
env:
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt
# Build the plugin
- name: Build obs-kinect
run: xmake --verbose
env:
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt
# Install the result files
- name: Install obs-kinect
run: xmake package -vo package
env:
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt
# Upload artifacts
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
path: package