-
-
Notifications
You must be signed in to change notification settings - Fork 10
195 lines (181 loc) · 7.21 KB
/
build.yml
File metadata and controls
195 lines (181 loc) · 7.21 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
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
name: Build and create packages
on:
push:
branches:
- main
- github-actions
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
env:
APP_NAME: codepointer
jobs:
build-cmake:
name: Build ${{ matrix.config.name }} Qt ${{ matrix.qt_version }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows MSVC"
build_dir: "windows-msvc"
os: windows-2022
cc: "cl"
cxx: "cl"
- name: "Windows Clang"
build_dir: "windows-clang"
os: windows-2022
cc: "clang"
cxx: "clang++"
- name: "Ubuntu GCC"
build_dir: "linux-gcc"
os: ubuntu-22.04
cc: "gcc"
cxx: "g++"
- name: "Ubuntu Clang"
build_dir: "linux-clang"
os: ubuntu-22.04
cc: "clang"
cxx: "clang++"
- name: "macOS"
build_dir: "macos"
os: macos-latest
cc: "clang"
cxx: "clang++"
qt_version:
- "6.10.2"
include:
- generators: "Ninja"
- build_type: "Release"
steps:
- uses: actions/checkout@v5
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.31.0"
- name: Install Qt
uses: jurplel/install-qt-action@v4.1.1
with:
version: ${{ matrix.qt_version }}
modules: "qt5compat"
cache: true
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install cmake-format
run: pip3 install cmake-format
- name: Set up Clang 19.1.7
if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'clang'
uses: egor-tensin/setup-clang@v1
with:
version: 19.1.7
platform: x64
- name: Install missing packages (linux)
if: matrix.config.os == 'ubuntu-22.04'
run: sudo apt install -y libcups2-dev
- name: Setup MSVC (Windows)
if: matrix.config.cxx == 'cl'
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
run: >
cmake
-B build/${{ matrix.config.build_dir }}
-G "${{ matrix.generators }}"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER=${{ matrix.config.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }}
-DBUILD_VERSION=OFFICIAL
- name: Build
run: cmake --build build/${{ matrix.config.build_dir }} --parallel --verbose
- name: Install
run: >
cmake --install build/${{ matrix.config.build_dir }}
--prefix dist/${{ matrix.config.build_dir }}/usr
- name: Set version tag or commit SHA
shell: bash
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "version=${GITHUB_REF##refs/tags/}" >> $GITHUB_ENV
else
echo "version=${GITHUB_SHA::7}" >> $GITHUB_ENV
fi
- name: Create TGZ archive (Linux)
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc'
shell: bash
run: |
mkdir -p dist/${{ env.APP_NAME }}
ln -s ../${{ matrix.config.build_dir }}/usr \
dist/${{ env.APP_NAME }}/${{ env.APP_NAME }}-${{ matrix.config.build_dir }}-${{ env.version }}
tar -czhf \
dist/${{ env.APP_NAME }}-${{ matrix.config.build_dir }}-qt${{ matrix.qt_version }}-${{ env.version }}.tar.gz \
-C dist/${{ env.APP_NAME }} .
- name: Create AppImage (Linux)
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc'
run: |
sudo apt install -y fuse libxkbcommon-x11-0 libxcb-cursor-dev libxkbcommon-dev
mkdir -p dist/${{ matrix.config.build_dir }}/usr/plugins/{iconengines,platforms}
cp -av ${QT_ROOT_DIR}/plugins/iconengines/* dist/${{ matrix.config.build_dir }}/usr/plugins/iconengines/
cp -av ${QT_ROOT_DIR}/plugins/platforms/libqwayland*.so dist/${{ matrix.config.build_dir }}/usr/plugins/platforms/
export LD_LIBRARY_PATH=dist/${{ matrix.config.build_dir }}/usr/lib:$LD_LIBRARY_PATH
export OUTPUT=build/${{ env.APP_NAME }}-${{ env.version }}-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
./linuxdeploy-x86_64.AppImage \
--appdir dist/${{ matrix.config.build_dir }} \
--plugin qt \
--output appimage
- name: Upload AppImage (Linux)
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.version }}-x86_64.AppImage
path: build/${{ env.APP_NAME }}-${{ env.version }}-x86_64.AppImage
- name: Upload TGZ archive (Linux)
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.cc == 'gcc'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ matrix.config.build_dir }}-qt${{ matrix.qt_version }}-${{ env.version }}.tar.gz
path: dist/${{ env.APP_NAME }}-${{ matrix.config.build_dir }}-qt${{ matrix.qt_version }}-${{ env.version }}.tar.gz
- name: windeployqt (Windows)
if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl'
shell: cmd
run: |
windeployqt --release --no-translations --no-system-d3d-compiler --no-compiler-runtime --no-opengl-sw dist/${{ matrix.config.build_dir }}/usr/bin/${{ env.APP_NAME }}.exe
- name: Create setup (Windows)
if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl'
uses: Minionguyjpro/Inno-Setup-Action@v1.2.7
with:
path: setup_script.iss
options: /O+
- name: Rename and upload setup (Windows)
if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl'
shell: cmd
run: |
copy dist\${{ env.APP_NAME }}-win64.exe dist\${{ env.APP_NAME }}-${{ env.version }}-x86_64.exe
- name: Upload renamed setup (Windows)
if: matrix.config.os == 'windows-2022' && matrix.config.cc == 'cl'
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-${{ env.version }}-x86_64.exe
path: dist/${{ env.APP_NAME }}-${{ env.version }}-x86_64.exe
create-release:
name: Draft GitHub Release
needs: build-cmake
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v5
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./artifacts
- name: Create Draft Release
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --generate-notes --draft
- name: Upload assets to release
run: gh release upload ${{ github.ref_name }} ./artifacts/*