-
Notifications
You must be signed in to change notification settings - Fork 37
129 lines (110 loc) · 4.84 KB
/
windows.yml
File metadata and controls
129 lines (110 loc) · 4.84 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
name: Windows
on:
push:
tags:
- "*"
jobs:
build-windows:
name: Windows
runs-on: windows-2022
env:
BOOST_ROOT: C:/local/boost_1_83_0
steps:
- uses: actions/checkout@master
- name: Setup msbuild
uses: microsoft/setup-msbuild@v2
- name: Restore Boost
uses: actions/cache@v4
id: restore-boost
with:
path: ${{env.BOOST_ROOT}}
key: boost_1_83_0-msvc-14.3-64
- name: Install Boost
if: steps.restore-boost.outputs.cache-hit != 'true'
shell: powershell
run: |
$Url = "https://archives.boost.io/release/1.83.0/binaries/boost_1_83_0-msvc-14.3-64.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${env:BOOST_ROOT}"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
host: "windows"
target: "desktop"
modules: "qtcharts"
install-deps: "true"
- name: Clone conceal-core
shell: powershell
run: |
Remove-Item cryptonote -Recurse -Force -ErrorAction Ignore
git clone https://github.com/ConcealNetwork/conceal-core cryptonote
- name: Pre-build setup
shell: powershell
run: |
$search = "set\(CN_VERSION "
$ccx_version = ((Get-Content CryptoNoteWallet.cmake | Select-String $search) | %{$_ -replace $search, ""}) | %{$_ -replace "\)", ""}
# Update "CMakeLists.txt" with cmake dir
$qt5_cmake = "${{ env.Qt5_Dir }}/lib/cmake" -replace '[\\]', '\\' -replace '[/]', '\\'
$file = "CMakeLists.txt"
$find = '^set\(CMAKE_PREFIX_PATH.+'
$replace = "set(CMAKE_PREFIX_PATH `"$($qt5_cmake)`")"
(Get-Content $file) | %{$_ -replace $find, $replace} | Set-Content $file
# Update installer/windows/ConcealInstaller.iss with the current version
$file = "installer/windows/ConcealInstaller.iss"
$find = "^#define AppVersion.+"
$replace = "#define AppVersion '$ccx_version'"
(Get-Content $file) | %{$_ -replace $find, $replace} | Set-Content $file
- name: Build
shell: powershell
id: build
run: |
$build_folder = "build"
$release_folder = "Release"
$ccx_version = "${{ github.ref }}" -replace 'refs/tags/'
$release_name = "ccx-desktop-win64-v$ccx_version"
lrelease src/languages/cn.ts
lrelease src/languages/ru.ts
lrelease src/languages/tr.ts
lrelease src/languages/fr.ts
New-Item "$build_folder\$release_folder" -ItemType Directory
cd "$build_folder"
cmake -G "Visual Studio 17 2022" ..
msbuild conceal-desktop.sln /p:Configuration=Release /m:2
echo "build_folder=${build_folder}" >> $env:GITHUB_OUTPUT
echo "release_folder=${release_folder}" >> $env:GITHUB_OUTPUT
echo "release_name=${release_name}" >> $env:GITHUB_OUTPUT
echo "ccx_version=${ccx_version}" >> $env:GITHUB_OUTPUT
- name: Pack
shell: powershell
id: pack
run: |
$build_folder = "${{ steps.build.outputs.build_folder }}"
$release_name = "${{ steps.build.outputs.release_name }}"
$release_folder = "${{ steps.build.outputs.release_folder }}"
cd "$build_folder/$release_folder"
mkdir "Final"
cp "C:\Program Files\OpenSSL\libcrypto*.dll" "Final/"
cp "C:\Program Files\OpenSSL\libssl*.dll" "Final/"
windeployqt --release conceal-desktop.exe --dir "Final/" --no-translations --no-opengl-sw
mv Final ../../installer/windows/build
mv conceal-desktop.exe ../../installer/windows/build/
cd ../../installer/windows/
iscc ConcealInstaller.iss
cd bin
Compress-Archive -Path Conceal*.exe -DestinationPath "$release_name.zip"
$sha256 = (Get-FileHash "$release_name.zip").Hash
$asset_path = "installer/windows/bin/$release_name.zip"
echo "sha256=${sha256}" >> $env:GITHUB_OUTPUT
echo "release_name=${release_name}.zip" >> $env:GITHUB_OUTPUT
echo "asset_path=${asset_path}" >> $env:GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2.0.4
with:
files: ${{ steps.pack.outputs.asset_path }}
name: Conceal Desktop v${{ steps.build.outputs.ccx_version }}
body: |
[Download for Windows](../../releases/download/${{ steps.build.outputs.ccx_version }}/${{ steps.pack.outputs.release_name }}) **${{ steps.pack.outputs.release_name }}**
`SHA256 : ${{ steps.pack.outputs.sha256 }}`
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}