Merge pull request #197 from ConcealNetwork/development #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v1.1.3 | |
- name: Restore Boost | |
uses: actions/cache@v3 | |
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://sourceforge.net/projects/boost/files/boost-binaries/1.83.0/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 | |
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@v0.1.15 | |
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 }} |