-
Notifications
You must be signed in to change notification settings - Fork 2
181 lines (177 loc) · 6.27 KB
/
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
---
name: build
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
inputs:
sign:
description: "Sign installers?"
required: false
type: boolean
default: false
jobs:
android-build:
name: Android build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"ubuntu-24.04"
]
env:
# Of these, only ANDROID_NDK_ROOT should be used by Qt, but override the others set by default in the runner just in case
ANDROID_NDK: /usr/local/lib/android/sdk/ndk/21.4.7075529
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/21.4.7075529
ANDROID_NDK_LATEST_HOME: /usr/local/lib/android/sdk/ndk/21.4.7075529
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/21.4.7075529
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install python3-sphinx python3-sphinx-rtd-theme
- name: Install the NDK version required by Qt 5.15.x
run: '$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "ndk;21.4.7075529"'
- name: Accept the NDK license
run: "yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses"
- name: Install Qt
uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0 # pinned for security, review code for secret leakage when upgrading
with:
version: "5.15.2"
target: android
cache: true
- name: Compile Metakit for all Android ABIs
run: packaging/android/build_metakit.sh
- name: Generate binary translation files to include in the build
run: |
lrelease portabase.pro
lrelease resources/translations/qt*.ts
- name: Generate Makefile
run: qmake portabase.pro
env:
QMAKESPEC: android-clang
- name: Build AAB package for upload to Google Play and an APK for local testing
run: make -j$(nproc) aab
- name: Archive built AAB
uses: actions/upload-artifact@v4
with:
name: android-aab
path: android-build/build/outputs/bundle/release/*.aab
- name: Archive built APK
uses: actions/upload-artifact@v4
with:
name: android-apk
path: android-build/build/outputs/apk/debug/*.apk
linux-build:
name: Linux build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"ubuntu-20.04",
"ubuntu-22.04",
"ubuntu-24.04"
]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential debhelper python3-sphinx python3-sphinx-rtd-theme qtbase5-dev qttools5-dev-tools
- name: Read the PortaBase version from file
id: getversion
run: echo "PORTABASE_VERSION=$(cat packaging/version_number)" >> $GITHUB_ENV
- name: Build package
run: packaging/linux/debian.sh
- name: Archive built package
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.os }}-package"
path: build/debian/*.deb
- name: Verify that package installs cleanly
run: sudo apt-get install ./build/debian/portabase_${{ env.PORTABASE_VERSION }}_amd64.deb
mac-build:
name: macOS build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"macos-12",
# "macos-13", # Both of these are broken due to https://bugreports.qt.io/browse/QTBUG-117225, not fixed until Qt 6.5.3
# "macos-14"
]
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Qt
uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0 # pinned for security, review code for secret leakage when upgrading
with:
version: "5.15.2"
cache: true
- name: Build Metakit
run: packaging/mac/build_metakit.sh
- name: Install Sphinx and Read the Docs theme
run: pip install Sphinx sphinx_rtd_theme
- if: ${{ ! inputs.signed }}
name: Build unsigned installer for testing
run: packaging/mac/build.sh
- if: ${{ inputs.signed }}
name: Build signed installer for release
run: packaging/mac/build.sh --sign
- name: Archive built installer
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.os }}-installer"
path: build/*.dmg
windows-build:
name: Windows build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["windows-2022"] # windows-2019 runner image doesn't come with Inno Setup, skip for now
env:
msys2bash: 'C:\shells\msys2bash.cmd'
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Qt
uses: jurplel/install-qt-action@f03f05556819ceb3781ee2f455ec44c339d683c0 # pinned for security, review code for secret leakage when upgrading
with:
version: "5.15.2"
arch: "win64_mingw81"
tools: "tools_mingw,qt.tools.win64_mingw810"
cache: true
- name: Configure and build Metakit
run: ${{ env.msys2bash}} -c "packaging/windows/build_metakit.sh '${{ env.IQTA_TOOLS }}\mingw810_64\bin'"
- name: Install Sphinx and Read the Docs theme
run: pip install Sphinx sphinx_rtd_theme
- name: Compile PortaBase
run: packaging\windows\build.bat
- if: ${{ ! inputs.signed }}
name: Build unsigned installer for testing
run: packaging\windows\installer.bat
- if: ${{ inputs.signed }}
name: Build signed installer for release
run: packaging\windows\installer.bat --sign
- name: Archive built installer
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: build/*.dmg