-
Notifications
You must be signed in to change notification settings - Fork 74
153 lines (132 loc) · 5.17 KB
/
Copy pathbuild.yml
File metadata and controls
153 lines (132 loc) · 5.17 KB
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
# Build matrix: each platform job installs Qt, runs ./configure.sh (which
# handles deps, qtapng, themes, cmake+ninja, and windeployqt on Windows),
# then deploys + uploads.
name: CI Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
formatting-check:
name: formatting-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clang-format style check for C++
uses: jidicula/clang-format-action@v4.12.0
with:
clang-format-version: '17'
check-path: 'src'
fallback-style: LLVM
build-windows:
needs: formatting-check
runs-on: windows-latest
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.5.3
target: desktop
arch: win64_mingw
tools: 'tools_mingw1310'
cache: true
cache-key-prefix: install-qt-action
modules: 'qtimageformats qtwebsockets qtmultimedia'
- name: Configure and build
shell: bash
run: ./configure.sh QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
- name: Run tests
shell: bash
run: ctest --output-on-failure
- name: Stage MinGW runtime DLLs
shell: pwsh
run: |
Copy-Item "$Env:IQTA_TOOLS\mingw1310_64\bin\libgcc_s_seh-1.dll" bin\
Copy-Item "$Env:IQTA_TOOLS\mingw1310_64\bin\libstdc++-6.dll" bin\
Copy-Item "$Env:IQTA_TOOLS\mingw1310_64\bin\libwinpthread-1.dll" bin\
- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: Attorney_Online-Windows
path: ${{ github.workspace }}/bin
build-linux:
needs: formatting-check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
aqtversion: '==3.1.*'
version: '6.5.3'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
cache: true
cache-key-prefix: install-qt-action
modules: 'qtimageformats qtwebsockets qtmultimedia'
- name: Install system build tools
run: sudo apt-get update && sudo apt-get install -y ninja-build patchelf libxcb-cursor0
- name: Configure and build
run: ./configure.sh QT_PATH="$QT_ROOT_DIR" BUILD_TYPE=Release
- name: Run tests
env:
QT_QPA_PLATFORM: offscreen
run: ctest --output-on-failure
- name: Stage APNG plugin for AppImage
run: |
mkdir -p "$QT_ROOT_DIR/plugins/imageformats"
cp qtapng/plugins/imageformats/libqapng.so "$QT_ROOT_DIR/plugins/imageformats/"
- name: Package dynamic tarball
shell: bash
run: |
cd "${{ github.workspace }}/bin"
cp ../data/logo-client.png ./icon.png
cp ../README_LINUX.md .
cp ../scripts/DYNAMIC_INSTALL.sh ./INSTALL.sh
chmod +x INSTALL.sh Attorney_Online
patchelf --add-rpath . Attorney_Online
cd ..
tar --transform='flags=r;s|bin|Attorney Online|' -cvf Attorney_Online-Dynamic.tar bin
- name: Build AppImage
shell: bash
run: |
# from https://github.com/probonopd/go-appimage/blob/master/src/appimagetool/README.md
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)
mv appimagetool-*-x86_64.AppImage appimagetool
chmod +x appimagetool
mkdir -p AppDir/usr/bin AppDir/usr/lib/plugins/imageformats AppDir/usr/share/applications
cp bin/Attorney_Online AppDir/usr/bin
cp bin/lib*.so AppDir/usr/lib 2>/dev/null || true
cp scripts/Attorney_Online.desktop AppDir/usr/share/applications
cp data/logo-client.png AppDir/Attorney_Online.png
GIT_SHORT_SHA="${GITHUB_SHA::8}"
QTDIR="$QT_ROOT_DIR" ./appimagetool deploy AppDir/usr/share/applications/Attorney_Online.desktop
ARCH=x86_64 VERSION=${GIT_SHORT_SHA} ./appimagetool AppDir
- name: Package AppImage tarball
shell: bash
run: |
mkdir bin-appimage
cp -r bin/base bin-appimage
cp data/logo-client.png bin-appimage/icon.png
cp README_LINUX.md bin-appimage
cp scripts/APPIMAGE_INSTALL.sh bin-appimage/INSTALL.sh
cp Attorney_Online-*-x86_64.AppImage bin-appimage
chmod +x bin-appimage/INSTALL.sh bin-appimage/Attorney_Online-*-x86_64.AppImage
tar --transform='flags=r;s|bin-appimage|Attorney Online|' -cvf Attorney_Online-AppImage.tar bin-appimage
- name: Upload Dynamic Artifact
uses: actions/upload-artifact@master
with:
name: Attorney_Online-Linux-Dynamic
path: Attorney_Online-Dynamic.tar
- name: Upload AppImage Artifact
uses: actions/upload-artifact@master
with:
name: Attorney_Online-Linux-AppImage
path: Attorney_Online-AppImage.tar