forked from xpilot-project/xpilot
-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (129 loc) · 5.99 KB
/
linux.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
name: "Build xPilot for Linux"
on:
workflow_call:
workflow_dispatch:
env:
BUILD_TYPE: Release
VATSIM_CLIENT_ID: ${{ secrets.VATSIM_CLIENT_ID }}
VATSIM_CLIENT_KEY: ${{ secrets.VATSIM_CLIENT_KEY }}
CONFIG_ENCRYPTION_KEY: ${{ secrets.CONFIG_ENCRYPTION_KEY }}
CLIENT_DIR: ${{ github.workspace }}/client
PLUGIN_DIR: ${{ github.workspace }}/plugin
IB_URL: https://xpilot-project.org/ib/installbuilder-enterprise-22.8.0-linux-x64-installer.run
IB_LICENSE: ${{ secrets.INSTALLBUILDER_LICENSE }}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev \
libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev \
libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev \
libxcb-render-util0-dev libxcb-util-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev \
libglu1-mesa-dev freeglut3-dev mesa-common-dev libglfw3-dev libgles2-mesa-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl \
gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
- uses: actions/checkout@v3
with:
submodules: recursive
### Buid Plugin ###
- name: Build plugin
working-directory: ${{ env.PLUGIN_DIR }}
run: |
mkdir build && cd build
cmake .. && cmake --build . --config ${{ env.BUILD_TYPE }}
- name: Package plugin
run: |
mkdir -p ${{ github.workspace }}/xPilot/lin_x64
cp ${{ env.PLUGIN_DIR }}/build/lin_x64/xPilot.xpl ${{ github.workspace }}/xPilot/lin_x64
cp ${{ env.PLUGIN_DIR }}/3rdparty/fmod/libfmod.so ${{ github.workspace }}/xPilot/lin_x64
cp -R ${{ env.PLUGIN_DIR }}/Resources ${{ github.workspace }}/xPilot/
- name: Extract debug symbols
if: github.ref_type == 'tag' && contains(github.ref_name, 'v')
working-directory: ${{ env.PLUGIN_DIR }}/build/lin_x64
run: |
objcopy --only-keep-debug xPilot.xpl xPilot.debug
cp ${{ env.PLUGIN_DIR }}/build/lin_x64/xPilot.debug ${{ github.workspace }}/xPilot/lin_x64
- name: Fix FMOD rpath
working-directory: ${{ github.workspace }}/xPilot/lin_x64
run: |
sudo apt-get install patchelf
patchelf --set-rpath '$ORIGIN' xPilot.xpl
patchelf --replace-needed libfmod.so.13 libfmod.so xPilot.xpl
### Build Client ###
- name: Download Qt
uses: robinraju/[email protected]
with:
repository: "xpilot-project/qt6"
tag: "v6.3.2"
fileName: "linux.7z"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Setup Qt
run: |
7z x -oqt6 linux.7z
echo "Qt6_DIR=$(pwd)/qt6" >> $GITHUB_ENV
echo "QT_PLUGIN_PATH=$(pwd)/qt6/plugins" >> $GITHUB_ENV
echo "QML2_IMPORT_PATH=$(pwd)/qt6/qml" >> $GITHUB_ENV
echo "$(pwd)/qt6/bin" >> $GITHUB_PATH
chmod -R +x qt6
- name: Build client
working-directory: ${{ env.CLIENT_DIR }}
run: |
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DVATSIM_CLIENT_ID=${{ env.VATSIM_CLIENT_ID }} \
-DVATSIM_CLIENT_KEY=${{ env.VATSIM_CLIENT_KEY }} \
-DCONFIG_ENCRYPTION_KEY=${{ env.CONFIG_ENCRYPTION_KEY }} \
-DCMAKE_PREFIX_PATH=${{ env.Qt6_DIR }} \
-DOPENSSL_ROOT_DIR=${{ github.workspace }}/externals/linux/openssl
cmake --build . --config ${{ env.BUILD_TYPE }}
mv ${{ env.CLIENT_DIR }}/build/xPilot ${{ env.CLIENT_DIR }}/build/xpilot
- name: Build AppImage
working-directory: ${{ env.CLIENT_DIR }}
run: |
chmod +x ../scripts/appimage.sh
../scripts/appimage.sh
- name: Get version
run: |
echo "XPILOT_VERSION=$(cat xpilot.json | jq -r 'if .is_beta == true then "\(.version.major).\(.version.minor).\(.version.patch)-beta.\(.beta_number)" else "\(.version.major).\(.version.minor).\(.version.patch)" end')" >> $GITHUB_ENV
- name: Setup InstallBuilder
run: |
curl -k -L ${{ env.IB_URL }} --output ib.run
chmod +x ib.run
./ib.run --mode unattended --prefix ../ib
../ib/bin/builder --version
echo "$IB_LICENSE" > lic.xml
echo "CLIENT_BUILD_DIR=${{ github.workspace }}/dist" >> $GITHUB_ENV
echo "PLUGIN_BUILD_DIR=${{ github.workspace }}/xPilot" >> $GITHUB_ENV
- name: Create installer
run: |
../ib/bin/builder build installer/linux.xml \
--license lic.xml \
--setvars project.outputDirectory=$(pwd) \
--setvars project.version=${{ env.XPILOT_VERSION }}
- name: Rename Installer
shell: bash
run: |
mv xPilot-${{ env.XPILOT_VERSION }}-linux-x64-installer.run xPilot-${{ env.XPILOT_VERSION }}-Linux.run
chmod +x xPilot-${{ env.XPILOT_VERSION }}-Linux.run
- name: Upload installer artifact
uses: actions/upload-artifact@v3
with:
name: xPilot-${{ env.XPILOT_VERSION }}-Linux.zip
path: |
xPilot-${{ env.XPILOT_VERSION }}-Linux.run
- name: Create artifacts archive
run: |
mkdir -p linux/plugin
cp -R ${{ github.workspace }}/xPilot linux/plugin/
cp ${{ env.CLIENT_DIR }}/build/xpilot linux/xPilot
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Linux.zip
path: ${{ github.workspace }}/linux