-
Notifications
You must be signed in to change notification settings - Fork 163
212 lines (180 loc) · 7.46 KB
/
pr-check.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
name: pr-check
on: [pull_request]
env:
QT_VERSION: '6.8.0'
jobs:
Linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install liblzma
run: |
sudo apt update
sudo apt install liblzma-dev
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Build
run: |
mkdir build
cd build
cmake ..
make -j5
Flatpak:
runs-on: ubuntu-24.04
container:
image: docker.io/bilelmoussaoui/flatpak-github-actions:kde-6.6
options: --privileged
steps:
- uses: actions/checkout@v4
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: "org.fedoraproject.MediaWriter.flatpak"
manifest-path: "dist/flatpak/org.fedoraproject.MediaWriter.json"
cache-key: flatpak-builder-${{ github.sha }}
- uses: actions/upload-artifact@v4
with:
name: org.fedoraproject.MediaWriter.flatpak
path: org.fedoraproject.MediaWriter.flatpak
macOS:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtimageformats
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel
- name: Bundle
run: |
"$QT_ROOT_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant
# No idea why but macdeployqt deploys debug libs too, just remove them, maybe fix this sometimes
for i in `find build/src/app/FedoraMediaWriter.app/ -name '*.dSYM'`; do rm -fr "$i"; done
cd build/src/app/
"$QT_ROOT_DIR"/bin/macdeployqt FedoraMediaWriter.app -dmg -always-overwrite -appstore-compliant
mv FedoraMediaWriter.dmg ../../../FedoraMediaWriter-osx.dmg
- uses: actions/upload-artifact@v4
with:
name: FedoraMediaWriter-osx.dmg
path: FedoraMediaWriter-osx.dmg
macOS-arm64:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
modules: qtimageformats
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel
- name: Bundle
run: |
"$QT_ROOT_DIR"/bin/macdeployqt build/src/app/FedoraMediaWriter.app -qmldir=src/app/qml -executable=build/src/app/FedoraMediaWriter.app/Contents/MacOS/helper -appstore-compliant
# No idea why but macdeployqt deploys debug libs too, just remove them, maybe fix this sometimes
for i in `find build/src/app/FedoraMediaWriter.app/ -name '*.dSYM'`; do rm -fr "$i"; done
cd build/src/app/
"$QT_ROOT_DIR"/bin/macdeployqt FedoraMediaWriter.app -dmg -always-overwrite -appstore-compliant
mv FedoraMediaWriter.dmg ../../../FedoraMediaWriter-osx-arm64.dmg
- uses: actions/upload-artifact@v4
with:
name: FedoraMediaWriter-osx-arm64.dmg
path: FedoraMediaWriter-osx-arm64.dmg
Windows-MSVC:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies
shell: bash
run: |
choco install nsis
choco install dos2unix
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
arch: win64_msvc2022_64
cache: true
cache-key-prefix: ${{ github.job }}-qt
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build xz-utils
shell: bash
if: ${{ !steps.cache-qt.outputs.cache-hit }}
run: |
# eval "$(./dist/win/make-vs2022-env.bat)"
git clone https://git.tukaani.org/xz.git
cd xz
git checkout v5.4.5
sed -i 's/#include "config.h"//' src/common/common_w32res.rc
sed -i 's/PACKAGE_NAME/"liblzma"/' src/common/common_w32res.rc
sed -i 's/PACKAGE_URL/"https:\/\/tukaani.org\/xz\/"/' src/common/common_w32res.rc
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$QT_ROOT_DIR" -DBUILD_SHARED_LIBS=ON ..
cmake --build .
cmake --install .
- name: Build MediaWriter
shell: bash
run: |
# eval "$(./dist/win/make-vs2022-env.bat)"
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$QT_ROOT_DIR" ..
cmake --build .
cmake --install .
- name: Windeployqt
shell: bash
run: |
mkdir -p build/app/release
cd build/app/release
mv ../../src/app/helper.exe .
mv ../../src/app/mediawriter.exe .
cp $QT_ROOT_DIR/bin/liblzma.dll .
$QT_ROOT_DIR/bin/windeployqt.exe mediawriter.exe helper.exe liblzma.dll --verbose 2 --qmldir ../../.. --compiler-runtime --release
find . -type d -not -path '*/\.*' | sed 's/^\.\///g' | sed 's@\/@\\@g' | grep -v "^.$" > uninstall.log
find . -type f -not -path '*/\.*' | sed 's/^\.\///g' | sed 's@\/@\\@g' | sort >> uninstall.log
- name: Installer
shell: bash
run: |
VERSION_STRIPPED=$(sed "s/-.*//" <<< "${{ env.TAG_NAME }}")
if [[ "$VERSION_STRIPPED" == "" ]]; then
VERSION_STRIPPED=0.0.0
fi
VERSION_MAJOR=$(cut -d. -f1 <<< "${VERSION_STRIPPED}")
VERSION_MINOR=$(cut -d. -f2 <<< "${VERSION_STRIPPED}")
VERSION_BUILD=$(cut -d. -f3 <<< "${VERSION_STRIPPED}")
INSTALLED_SIZE=$(du -k -d0 "build/app/release" | cut -f1)
cp "dist/win/mediawriter_native.nsi" "dist/win/mediawriter_native.tmp.nsi"
sed -i "s/#!define VERSIONMAJOR/!define VERSIONMAJOR ${VERSION_MAJOR}/" "dist/win/mediawriter_native.tmp.nsi"
sed -i "s/#!define VERSIONMINOR/!define VERSIONMINOR ${VERSION_MINOR}/" "dist/win/mediawriter_native.tmp.nsi"
sed -i "s/#!define VERSIONBUILD/!define VERSIONBUILD ${VERSION_BUILD}/" "dist/win/mediawriter_native.tmp.nsi"
sed -i "s/#!define INSTALLSIZE/!define INSTALLSIZE ${INSTALLED_SIZE}/" "dist/win/mediawriter_native.tmp.nsi"
unix2dos < "LICENSE.GPL-2" > "build/app/release/LICENSE.GPL-2.txt"
unix2dos < "LICENSE.LGPL-2" > "build/app/release/LICENSE.LGPL-2.txt"
echo "LICENSE.GPL-2.txt" >> build/app/release/uninstall.log
echo "LICENSE.LGPL-2.txt" >> build/app/release/uninstall.log
makensis -DCERTPATH="" -DCERTPASS="" dist/win/mediawriter_native.tmp.nsi
mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64.exe"
- uses: actions/upload-artifact@v4
with:
name: FedoraMediaWriter-win64.exe
path: FedoraMediaWriter-win64.exe