Add boost to env on Windows runner #168
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: Build check | |
on: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '*' # We don't want this to run on release | |
pull_request: | |
jobs: | |
build-windows: | |
name: Windows | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Install boost | |
uses: MarkusJx/[email protected] | |
id: install-boost | |
with: | |
boost_version: 1.84.0 | |
toolset: msvc | |
- name: Install OpenSSL | |
run: choco install openssl | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '5.15.2' | |
host: 'windows' | |
target: 'desktop' | |
install-deps: 'true' | |
- name: Build | |
shell: powershell | |
id: build | |
env: | |
GIT_REDIRECT_STDERR: '2>&1' | |
VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\' | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
run: | | |
$build_folder = "build" | |
$krb_ver = git describe --tags --abbrev=0 | |
$release_name = "Karbo-wallet-win64-${krb_ver}" | |
$release_folder = "Release" | |
echo "$release_name" | |
set CMAKE_PREFIX_PATH="$($qt5_cmake)" | |
$qt5_cmake = "${{ env.Qt5_Dir }}/lib/cmake" -replace '[/]', '\\' | |
mkdir "$build_folder" | |
cd "$build_folder" | |
Start-Process cmake -ArgumentList "-DBOOST_ROOT=""$env:BOOST_ROOT"" -DBOOST_INCLUDE_DIRS=""$env:BOOST_ROOT/include"" -G ""Visual Studio 16 2019"" -A x64 -DARCH=default",".." -NoNewWindow -Wait | |
Start-Process msbuild -ArgumentList "KarbowanecWallet.sln","/p:Configuration=Release" -NoNewWindow -Wait | |
$build_path = "./$build_folder" | |
mkdir "$release_folder/$release_name" | |
mkdir "$release_folder/$release_name/languages" | |
cp languages/*.qm "$release_folder/$release_name/languages/" | |
cd "$release_folder" | |
cp KarbowanecWallet.exe "$release_name/" | |
cp "C:/Program Files/OpenSSL/bin/libssl*.dll" "$release_name/" | |
cp "C:/Program Files/OpenSSL/bin/libcrypto*.dll" "$release_name/" | |
cp "../../COPYING" "$release_name/LICENSE.txt" | |
cp "../../*.bat" "$release_name/" | |
windeployqt --release KarbowanecWallet.exe --dir "$release_name/" | |
Compress-Archive -Path "$release_name/" -DestinationPath "$release_name.zip" | |
$sha256a = (Get-FileHash "$release_name.zip").Hash | |
$asset_path_archive = "./$build_folder/$release_folder/$release_name.zip" | |
echo "sha256a=${sha256a}" >> $env:GITHUB_OUTPUT | |
echo "release_name_archive=${release_name}.zip" >> $env:GITHUB_OUTPUT | |
echo "asset_path_archive=${asset_path_archive}" >> $env:GITHUB_OUTPUT | |
cd ../ | |
makensis WindowsInstall.nsi | |
cd "$release_folder" | |
Compress-Archive -Path "KarbowanecWallet-Setup.exe" -DestinationPath "$release_name-install.zip" | |
$sha256i = (Get-FileHash "$release_name-install.zip").Hash | |
$asset_path_install = "./$build_folder/$release_folder/$release_name-install.zip" | |
echo "sha256i=${sha256i}" >> $env:GITHUB_OUTPUT | |
echo "release_name_install=${release_name}-install.zip" >> $env:GITHUB_OUTPUT | |
echo "asset_path_install=${asset_path_install}" >> $env:GITHUB_OUTPUT | |
- name: Create Archive Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ steps.build.outputs.asset_path_archive }} | |
name: ${{ steps.build.outputs.release_name_archive }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Installer Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ steps.build.outputs.asset_path_install }} | |
name: ${{ steps.build.outputs.release_name_install }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-macos: | |
name: macOS | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '5.15.2' | |
install-deps: 'true' | |
- name: Setup Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Install other deps | |
run: | | |
brew install gcc boost openssl | |
brew link boost --force | |
- name: Build | |
id: build | |
run: | | |
build_folder="build/release" | |
krb_ver=$(git describe --tags --abbrev=0) | |
release_name="Karbo-wallet-macOS-$krb_ver" | |
app_name="KarbowanecWallet.app" | |
lang_folder="/Contents/Resources/languages" | |
mkdir -p "$build_folder" | |
cd "$build_folder" | |
cmake -D ARCH=default -D CMAKE_C_FLAGS="-mmacosx-version-min=10.12" -D CMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -D CMAKE_BUILD_TYPE=Release ../.. | |
make | |
mkdir "$app_name$lang_folder" | |
cp languages/*.qm "$app_name$lang_folder" | |
macdeployqt "$app_name" | |
cpack | |
mv *.dmg "$release_name".dmg | |
sha256=$(shasum -a 256 "$release_name".dmg | awk '{ print toupper($1) }') | |
asset_path="./$build_folder/$release_name.dmg" | |
echo "sha256=${sha256}" >> $GITHUB_OUTPUT | |
echo "release_name=${release_name}.zip" >> $GITHUB_OUTPUT | |
echo "asset_path=${asset_path}" >> $GITHUB_OUTPUT | |
echo "krb_ver=${krb_ver}" >> $GITHUB_OUTPUT | |
env: | |
MACOSX_DEPLOYMENT_TARGET: '10.12' | |
- name: Create Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ steps.build.outputs.asset_path }} | |
name: ${{ steps.build.outputs.release_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-ubuntu22: | |
name: Ubuntu 22.04 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Build | |
id: build | |
run: | | |
sudo apt update -y | |
sudo apt install -y qtbase5-dev qttools5-dev qttools5-dev-tools libboost-all-dev | |
build_folder="build/release" | |
krb_ver=$(git describe --tags --abbrev=0) | |
release_name=Karbo-wallet-ubuntu-22.04-$krb_ver | |
app_name="KarbowanecWallet" | |
mkdir -p "$build_folder" | |
cd "$build_folder" | |
cmake -D ARCH=default -D CMAKE_BUILD_TYPE=Release -D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -D BOOST_IGNORE_SYSTEM_PATHS_DEFAULT=ON -D BOOST_ROOT=/usr ../.. | |
make | |
cpack | |
tar -czf "$release_name".tar.gz *.deb | |
sha256=$(shasum -a 256 "$release_name".tar.gz | awk '{print toupper($1)}') | |
asset_path="./$build_folder/$release_name".tar.gz | |
echo "sha256=${sha256}" >> $GITHUB_OUTPUT | |
echo "release_name=${release_name}.tar.gz" >> $GITHUB_OUTPUT | |
echo "asset_path=${asset_path}" >> $GITHUB_OUTPUT | |
echo "krb_ver=${krb_ver}" >> $GITHUB_OUTPUT | |
- name: Create Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ steps.build.outputs.asset_path }} | |
name: ${{ steps.build.outputs.release_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-ubuntu20: | |
name: Ubuntu 20.04 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
- name: Build | |
id: build | |
run: | | |
sudo apt update -y | |
sudo apt install -y qt5-default qttools5-dev qttools5-dev-tools libboost-all-dev | |
build_folder="build/release" | |
krb_ver=$(git describe --tags --abbrev=0) | |
release_name=Karbo-wallet-ubuntu-20.04-$krb_ver | |
app_name="KarbowanecWallet" | |
mkdir -p "$build_folder" | |
cd "$build_folder" | |
cmake -D ARCH=default -D CMAKE_BUILD_TYPE=Release -D CMAKE_POSITION_INDEPENDENT_CODE:BOOL=true -D BOOST_IGNORE_SYSTEM_PATHS_DEFAULT=ON -D BOOST_ROOT=/usr ../.. | |
make | |
cpack | |
tar -czf "$release_name".tar.gz *.deb | |
sha256=$(shasum -a 256 "$release_name".tar.gz | awk '{print toupper($1)}') | |
asset_path="./$build_folder/$release_name".tar.gz | |
echo "sha256=${sha256}" >> $GITHUB_OUTPUT | |
echo "release_name=${release_name}.tar.gz" >> $GITHUB_OUTPUT | |
echo "asset_path=${asset_path}" >> $GITHUB_OUTPUT | |
echo "krb_ver=${krb_ver}" >> $GITHUB_OUTPUT | |
- name: Create Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ steps.build.outputs.asset_path }} | |
name: ${{ steps.build.outputs.release_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |