forked from jing332/xmly-downloader-qt5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor_build.ps1
70 lines (60 loc) · 2.28 KB
/
appveyor_build.ps1
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
if ("true" -eq $env:CI_WINDOWS) {
# Install Qt-static
curl -LJO https://github.com/lkeegan/qt5-static/releases/download/5.14.2/qt5-static-win32.zip
7z x qt5-static-win32.zip
$env:PATH = "$env:APPVEYOR_BUILD_FOLDER\install\bin;C:\go114\bin;C:\msys64\mingw64\bin;" + $env:PATH
# Build Go
Set-Location .\cgoqt
go build -buildmode=c-archive
Set-Location ..\
# Build Qt
mkdir .\build
Set-Location .\build
qmake CONFIG+=release ..\xmly-downloader-qt5.pro
mingw32-make -j2
mkdir xmly-downloader-qt5_windows
Copy-Item .\release\xmly-downloader-qt5.exe .\xmly-downloader-qt5_windows
7z a xmly-downloader-qt5_windows_v$env:APPVEYOR_BUILD_VERSION.zip .\xmly-downloader-qt5_windows
}
elseif ("true" -eq $env:CI_LINUX) {
# Install library
sudo apt-get install -y libglib2.0-dev
sudo apt-get install -y libxkbcommon-dev
# Install Qt-static
mkdir qt5
Set-Location qt5
curl -LJO https://github.com/lkeegan/qt5-static/releases/download/5.14.2/qt5-static-linux.tgz
tar xzf qt5-static-linux.tgz
$env:PATH = "$env:APPVEYOR_BUILD_FOLDER/qt5/usr/local/qt5-static/bin:" + $env:PATH
# Build Go
Set-Location ..\cgoqt
go build -buildmode=c-archive
Set-Location ..\
# Build Qt
mkdir build
Set-Location build
qmake CONFIG+=release ..\xmly-downloader-qt5.pro
make -j2
mkdir xmly-downloader-qt5_linux
Copy-Item xmly-downloader-qt5 .\xmly-downloader-qt5_linux
Write-Output '#!/bin/bash\n./xmly-downloader-qt5' > .\xmly-downloader-qt5_linux\xmly-downloader-qt5.sh
tar zcvf xmly-downloader-qt5_linux_v$env:APPVEYOR_BUILD_VERSION.tar.gz xmly-downloader-qt5_linux
}
elseif ("true" -eq $env:CI_MACOS) {
# Install Qt-static
mkdir qt5
Set-Location qt5
curl -LJO https://github.com/lkeegan/qt5-static/releases/download/5.14.2/qt5-static-osx.tgz
tar xzf qt5-static-osx.tgz
$env:PATH = "$env:APPVEYOR_BUILD_FOLDER/qt5/usr/local/qt5-static/bin:" + $env:PATH
# Build Go
Set-Location ..\cgoqt
go build -buildmode=c-archive
Set-Location ..\
# Build Qt
mkdir build
Set-Location build
qmake CONFIG+=release ..\xmly-downloader-qt5.pro
make -j2
tar zcvf xmly-downloader-qt5_macos_v$env:APPVEYOR_BUILD_VERSION.tar.gz xmly-downloader-qt5.app
}