-
Notifications
You must be signed in to change notification settings - Fork 157
283 lines (267 loc) · 10.2 KB
/
ccpp.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: Automatic build
on:
push:
branches:
- 'main'
pull_request:
branches:
- '**'
release:
types: [ created ]
env:
QT_VERSION: '6.5.2'
jobs:
Linux:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install dependencies
run: |
sudo apt update
sudo apt install libxss1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 binutils cmake pkg-config libx11-dev xcb libx11-xcb-dev libxkbcommon-x11-dev libssl-dev libxss-dev libxmu-dev
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
- name: Install Adwaita-qt
run: |
git clone https://github.com/FedoraQt/adwaita-qt.git adwaita-qt
cd adwaita-qt
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT6=ON
make -j2
sudo make install
- name: Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j2
Flatpak-test-build:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
container:
image: docker.io/bilelmoussaoui/flatpak-github-actions:kde-6.4
options: --privileged
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- 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: marvinpinto/action-automatic-releases@latest
if: github.event_name == 'push'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-flatpak"
prerelease: true
title: "Development Build (Flatpak)"
files: org.fedoraproject.MediaWriter.flatpak
#Flatpak:
#if: github.event_name == 'release'
#runs-on: ubuntu-latest
#steps:
#- uses: actions/checkout@v1
#with:
#fetch-depth: 1
#- name: Install dependencies
#run: |
#sudo apt update
#sudo apt install flatpak flatpak-builder
#- name: Install Flatpak KDE SDK
#run: |
#sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
#sudo flatpak install --system -y flathub org.kde.Platform//5.15
#sudo flatpak install --system -y flathub org.kde.Sdk//5.15
#- name: Build the Flatpak package
#run: |
#TAG_NAME=$(bash ./dist/get-tag-name.sh)
#pushd dist/flatpak
#sudo flatpak-builder --repo=flatpak-repo --force-clean flatpak-build org.fedoraproject.MediaWriter.json
#flatpak build-bundle flatpak-repo org.fedoraproject.MediaWriter.flatpak org.fedoraproject.MediaWriter
#mv org.fedoraproject.MediaWriter.flatpak ../../org.fedoraproject.MediaWriter-$TAG_NAME.flatpak
#popd
#- name: Upload to GitHub
#if: github.event_name == 'release'
#shell: bash
#run: |
#TAG_NAME=$(bash ./dist/get-tag-name.sh)
#bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="org.fedoraproject.MediaWriter-$TAG_NAME.flatpak"
macOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qtimageformats
- name: Set env (push)
if: github.event_name == 'push' || github.event_name == 'release'
run: echo "TAG_NAME=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
- name: Set env (release)
if: github.event_name == 'release'
run: echo "TAG_NAME=$(bash ./dist/get-tag-name.sh)" >> $GITHUB_ENV
- name: Build
if: github.event_name == 'push' || github.event_name == 'release'
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: |
bash dist/mac/build.sh build
- name: Insert dependencies
if: github.event_name == 'push' || github.event_name == 'release'
run: |
bash dist/mac/build.sh deps
- name: Sign (TBD)
if: github.event_name == 'release'
run: |
true # bash dist/mac/build.sh sign
- name: Package
if: github.event_name == 'push' || github.event_name == 'release'
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: |
bash dist/mac/build.sh dmg
- name: Notarize (TBD)
if: github.event_name == 'release'
run: |
true # bash dist/mac/build.sh notarize
- name: Upload to GitHub (release)
if: github.event_name == 'release'
env:
TAG_NAME: ${{ env.TAG_NAME }}
run: |
bash dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-osx-$TAG_NAME.unnotarized.dmg"
- name: Upload to GitHub (Development build)
if: github.event_name == 'push' || github.event_name == 'pull_request'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-macos"
prerelease: true
title: "Development Build (MacOS)"
files: FedoraMediaWriter-osx-${{ env.TAG_NAME }}.unnotarized.dmg
Windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Set env (push)
if: github.event_name == 'push' || github.event_name == 'release'
run: echo "TAG_NAME=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
- name: Install dependencies
shell: bash
run: |
choco install nsis
choco install dos2unix
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
arch: win64_mingw
version: ${{env.QT_VERSION}}
- name: Build xz-utils
shell: bash
if: ${{ !steps.cache-qt.outputs.cache-hit }}
run: |
git clone https://git.tukaani.org/xz.git
cd xz
git checkout v5.2
cd ..
sed -i 's/#include "config.h"//' xz/src/common/common_w32res.rc
sed -i 's/PACKAGE_NAME/"liblzma"/' xz/src/common/common_w32res.rc
sed -i 's/PACKAGE_URL/"https:\/\/tukaani.org\/xz\/"/' xz/src/common/common_w32res.rc
mkdir xz/build
cd xz/build
cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" -DBUILD_SHARED_LIBS=ON ..
mingw32-make -j2 VERBOSE=1
mingw32-make install
- name: Build MediaWriter
shell: bash
run: |
find /d -name libstdc++-6.dll
mkdir build
cd build
cmake -DCMAKE_SH="CMAKE_SH-NOTFOUND" -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$Qt6_DIR" ..
mingw32-make -j2 VERBOSE=1
- name: Windeployqt
if: github.event_name == 'push' || github.event_name == 'release'
shell: bash
run: |
mkdir -p build/app/release
cd build/app/release
mv ../../src/app/helper.exe .
mv ../../src/app/mediawriter.exe .
$Qt6_DIR/bin/windeployqt.exe --qmldir ../../.. mediawriter.exe
cp $Qt6_DIR/bin/libstdc++-6.dll .
cp $Qt6_DIR/bin/libwinpthread-1.dll .
cp $Qt6_DIR/bin/libgcc_s_seh-1.dll .
cp $Qt6_DIR/bin/liblzma.dll .
cp /c/Program\ Files/OpenSSL/bin/*.dll .
- name: Installer
if: github.event_name == 'push' || github.event_name == 'release'
env:
TAG_NAME: ${{ env.TAG_NAME }}
shell: bash
run: |
VERSION_STRIPPED=$(sed "s/-.*//" <<< "${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"
makensis -DCERTPATH="" -DCERTPASS="" dist/win/mediawriter_native.tmp.nsi
if [[ "$TAG_NAME" != "" ]]; then
mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64-$TAG_NAME.exe"
else
mv dist/win/FMW-setup.exe ./"FedoraMediaWriter-win64.exe"
fi
- name: Upload to GitHub (release)
if: github.event_name == 'release'
env:
TAG_NAME: ${{ env.TAG_NAME }}
shell: bash
run: |
bash ./dist/upload-to-github.sh github_api_token=${{ secrets.GITHUB_TOKEN }} tag="$TAG_NAME" filename="FedoraMediaWriter-win64-$TAG_NAME.exe"
- name: Get version for WinGet publish (release)
id: get-version
if: github.event_name == 'release'
run: |
$WINGET_VER=$(bash ./dist/get-tag-name.sh)
echo "::set-output name=version::$WINGET_VER"
shell: bash
- name: Publish to WinGet (release)
if: github.event_name == 'release'
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Fedora.FedoraMediaWriter
version: ${{ steps.get-version.outputs.version }}
token: ${{ secrets.WINGET_TOKEN }}
- name: Upload to GitHub (Development build)
if: github.event_name == 'push'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-windows"
prerelease: true
title: "Development Build (Windows)"
files: FedoraMediaWriter-win64.exe