Update windows.yml #20
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: | |
- "*" | |
workflow_dispatch: | |
tags: | |
- "*" | |
jobs: | |
build-windows: | |
name: Windows | |
runs-on: windows-2019 | |
env: | |
BOOST_ROOT: C:/tools/boost/x86_64 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup msbuild | |
uses: microsoft/[email protected] | |
- name: Install Boost | |
shell: powershell | |
run: | | |
echo "${env:BOOST_ROOT}" | |
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-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@v2 | |
with: | |
host: "windows" | |
target: "desktop" | |
modules: "qttools5 qtcharts" | |
install-deps: "true" | |
- name: Clone fuego | |
shell: powershell | |
run: | | |
Remove-Item cryptonote -Recurse -Force -ErrorAction Ignore | |
git clone https://github.com/usexfg/fuego cryptonote | |
- name: Pre-build setup | |
shell: powershell | |
run: | | |
$search = "set\(CN_VERSION " | |
$xfg_version = ((Get-Content CryptoNoteWallet.cmake | Select-String $search) | %{$_ -replace $search, ""}) | %{$_ -replace "\)", ""} | |
$xfg_version = $xfg_version + ".0" | |
# Update "CMakeLists.txt" with cmake dir | |
$qt5_cmake = "${{ env.Qt5_Dir }}/lib/cmake" -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 FuegoWallet.nsi with the current version | |
$file = "FuegoWallet.nsi" | |
$find = "^!define VERSION.+" | |
$replace = "!define VERSION '$xfg_version.0'" | |
(Get-Content $file) | %{$_ -replace $find, $replace} | Set-Content $file | |
- name: Build | |
shell: powershell | |
id: build | |
run: | | |
$build_folder = "build" | |
$release_folder = "Release" | |
$xfg_version = "${{ github.ref }}" -replace 'refs/tags/' | |
#$sha = "${{ github.sha }}" | |
#$xfg_version = $sha.SubString(0,7) | |
$release_name = "fuego-desktop-win64-v$xfg_version" | |
New-Item "$build_folder\$release_folder" -ItemType Directory | |
cd "$build_folder" | |
cmake -G "Visual Studio 16 2019" .. | |
# msbuild FUEGO-GUI.sln /p:Configuration=Release /m:2 | |
msbuild Fuego-Wallet.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 "xfg_version=${xfg_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" | |
choco install openssl -y | |
cp "C:\Program Files\OpenSSL-Win64\libcrypto*.dll" "Final/" | |
cp "C:\Program Files\OpenSSL-Win64\libssl*.dll" "Final/" | |
windeployqt --release Fuego-Wallet.exe --dir "Final/" --no-translations --no-opengl-sw | |
cd ../../ | |
makensis FuegoWallet.nsi | |
cd "$build_folder/$release_folder" | |
Compress-Archive -Path Fuego-Setup.exe -DestinationPath "$release_name.zip" | |
$sha256 = (Get-FileHash "$release_name.zip").Hash | |
$asset_path = "./$build_folder/$release_folder/$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@v1 | |
with: | |
files: ${{ steps.pack.outputs.asset_path }} | |
name: Fuego Desktop v${{ steps.build.outputs.xfg_version }} | |
body: | | |
<img src="https://cdn-icons-png.flaticon.com/512/226/226771.png" width="16"> [Download for Windows](../../releases/download/${{ steps.build.outputs.xfg_version }}/${{ steps.pack.outputs.release_name }}) ${{ steps.pack.outputs.release_name }} | |
`SHA256 : ${{ steps.pack.outputs.sha256 }}` | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |