Skip to content

Commit

Permalink
Merge pull request #192 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
0.1.4
  • Loading branch information
tonymorony committed Jun 6, 2020
2 parents 1e9dcda + 38a9ff0 commit 9ab2e2b
Show file tree
Hide file tree
Showing 37 changed files with 1,087 additions and 239 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/atomicdexpro_cd.yml
Expand Up @@ -3,7 +3,7 @@ name: AtomicDex-Pro CD releases
on:
push:
branches:
- dev
- temporary_disabled

jobs:

Expand Down
189 changes: 107 additions & 82 deletions .github/workflows/atomicdexpro_ci.yml
Expand Up @@ -2,23 +2,23 @@ name: AtomicDEX Pro CI

on:
pull_request:
types: [opened, edited, reopened]
types: [opened, synchronize, reopened]
schedule:
- cron: '0 0 * * 1'

jobs:

linux-build:
name: Linux Build
runs-on: ubuntu-18.04
runs-on: ubuntu-16.04

steps:
- uses: actions/checkout@v2

- name: Install QT (Linux)
uses: jurplel/install-qt-action@v2
with:
version: '5.14.1'
version: '5.14.2'
host: 'linux'
target: 'desktop'
dir: '${{ github.workspace }}'
Expand All @@ -34,7 +34,7 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update # prevents repo404 errors on apt-remove below
sudo apt-get remove php5.6-fpm php7.0-fpm php7.1-fpm php7.2-fpm php7.3-fpm php7.3-common php7.4-fpm msodbcsql17
sudo apt-get remove php* msodbcsql17 mysql*
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get upgrade -y
Expand All @@ -51,72 +51,80 @@ jobs:
autoconf \
unzip \
libssl-dev \
libxkbcommon-x11-0 \
git -y
# set clang version
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 777
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 777
# set gnu compilers version
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 777
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 777
# get llvm
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 9
sudo apt-get update
sudo apt-get install libc++abi-9-dev libc++-9-dev -y
export CXXFLAGS=-stdlib=libc++
export LDFLAGS=-stdlib=libc++
export CXX=clang++-9
export CC=clang-9
# get right cmake version
wget https://github.com/Kitware/CMake/releases/download/v3.17.1/cmake-3.17.1.tar.gz -O cmake.tar.gz
tar xvzf cmake.tar.gz
cd cmake-3.17.1
./bootstrap
sudo make install
# get llvm
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 9
cd ..
# get libwally
git clone https://github.com/KomodoPlatform/libwally-core.git
cd libwally-core
./tools/autogen.sh
./configure --disable-shared
sudo make -j2 install
# set clang version
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100
# cleanup
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
git clone https://github.com/KomodoPlatform/vcpkg vcpkg-repo
cd vcpkg-repo
./bootstrap-vcpkg.sh
sudo ./vcpkg integrate install
./vcpkg install doctest
./vcpkg install pthread
rm -rf ./downloads
rm -rf ./buildtrees
cd ..
- name: Build (Linux)
run: |
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/5.14.1/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/5.14.1
cd ci_tools_atomic_dex
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/5.14.2/gcc_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/5.14.2
export PATH=${{ github.workspace }}/Qt/5.14.2/gcc_64/bin:$PATH
export PATH=$HOME/.nimble/bin:$PATH
export CXXFLAGS=-stdlib=libc++
export LDFLAGS=-stdlib=libc++
export CXX=clang++-9
export CC=clang-9
cd ci_tools_atomic_dex
nimble build -y
# duplicating because got suspicion that update-alternatives doesnt save between steps
# set clang version
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 777
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 777
# set gnu compilers version
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 777
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 777
./ci_tools_atomic_dex --install_dependencies
./ci_tools_atomic_dex build debug
rm -rf ./vcpkg-repo/downloads
rm -rf ./vcpkg-repo/buildtrees
ls build-Debug/bin/AntaraAtomicDexAppDir/usr/bin/atomic_qt
- name: Pack Installer (Linux)
run: |
sudo apt-get update
sudo apt-get install libxrender-dev \
libxkbcommon-dev \
libxkbcommon-x11-0 \
fontconfig-config -y
python3 -m aqt tool linux tools_ifw 3.2.2 qt.tools.ifw.32
export QT_IFW_PATH=$PWD/Tools/QtInstallerFramework/3.2/
cd ci_tools_atomic_dex
./create_installer_linux.sh Debug
ls ./installer/AtomicDEX-Pro-Installer
- name: Upload artifacts (Linux)
./ci_tools_atomic_dex bundle debug
- name: Upload bundle artifact (Linux)
uses: actions/upload-artifact@v1
with:
name: AtomicDEX-Pro-Installer-linux
path: ./ci_tools_atomic_dex/installer/AtomicDEX-Pro-Installer
name: dexpro-ubuntu-debug.tar.gz
path: ./ci_tools_atomic_dex/bundle-Debug/AntaraAtomicDexAppDir.tar.gz


macos-build:
name: MacOS Build
Expand All @@ -125,7 +133,15 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Qt (Mac)
id: cache-qt-mac
uses: actions/cache@v1
with:
path: '${{ github.workspace }}/Qt/5.14.2'
key: ${{ runner.os }}-qt

- name: Install QT (MacOS)
if: steps.cache-qt-mac.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
Expand All @@ -148,8 +164,20 @@ jobs:
ninja \
git \
boost \
gcc
gcc \
llvm@9
export CC=/usr/local/opt/llvm@9/bin/clang
# get curl
git clone https://github.com/curl/curl.git
cd curl
git checkout curl-7_70_0
./buildconf
./configure --disable-shared --enable-static --without-libidn2 --without-ssl --without-nghttp2 --disable-ldap --with-darwinssl
make install
cd ../
# get libbitcoin
git clone --depth 1 --branch version5 --single-branch "https://github.com/libbitcoin/secp256k1"
cd secp256k1
Expand All @@ -166,14 +194,17 @@ jobs:
make
sudo make install
sudo update_dyld_shared_cache
# get SDKs
git clone https://github.com/phracker/MacOSX-SDKs $HOME/sdk
- name: Build (MacOS)
run: |
export QT_INSTALL_CMAKE_PATH=${{ github.workspace }}/Qt/5.14.2/clang_64/lib/cmake
export QT_ROOT=${{ github.workspace }}/Qt/5.14.2
cd ci_tools_atomic_dex
nimble build -y
./ci_tools_atomic_dex bundle debug
./ci_tools_atomic_dex bundle debug --osx_sdk=$HOME/sdk/MacOSX10.13.sdk --compiler=/usr/local/opt/llvm@9/bin/clang++
ls bundle-Debug/atomicDEX-Pro.dmg
- name: Upload artifacts (MacOS)
Expand All @@ -189,10 +220,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Cache Qt (Win)
id: cache-qt-win
uses: actions/cache@v1
with:
path: 'C:\Qt\5.14.2'
key: ${{ runner.os }}-qt

- name: Install QT (Win)
if: steps.cache-qt-win.outputs.cache-hit != 'true'
uses: jurplel/install-qt-action@v2
with:
version: '5.14.1'
version: '5.14.2'
host: 'windows'
target: 'desktop'
dir: 'C:\'
Expand All @@ -201,15 +240,18 @@ jobs:
- name: Build (Win)
shell: powershell
run: |
$Env:QT_INSTALL_CMAKE_PATH = "C:\Qt\5.14.1\msvc2017_64"
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
$Env:QT_INSTALL_CMAKE_PATH = "C:\Qt\5.14.2\msvc2017_64"
cd ci_tools_atomic_dex
scoop install nim --global
scoop install llvm --global
scoop install ninja --global
scoop install cmake --global
scoop install git --global
scoop install 7zip --global
# clear scoop cache
scoop cache rm 7zip
Expand All @@ -219,38 +261,21 @@ jobs:
scoop cache rm llvm
scoop cache rm nim
cd ci_tools_atomic_dex
$file = 'src\generate.nim'
$regex = '(?<=g_vcpkg_cmake_script_path & ")[^"]*'
(Get-Content $file) -replace $regex, ' -DVCPKG_TARGET_TRIPLET=x64-windows ' | Set-Content $file
nimble.exe build -y
& cmd /c 'git clone https://github.com/KomodoPlatform/vcpkg vcpkg-repo 2>&1'
cd vcpkg-repo
.\bootstrap-vcpkg.bat
.\vcpkg.exe integrate install
.\vcpkg.exe install entt
.\vcpkg.exe install folly
.\vcpkg.exe install boost-multiprecision
.\vcpkg.exe install boost-random
.\vcpkg.exe install doctest
.\vcpkg.exe install fmt
.\vcpkg.exe install curl
.\vcpkg.exe install nlohmann-json
rd -r ".\buildtrees\" -ErrorAction SilentlyContinue
rd -r ".\downloads\" -ErrorAction SilentlyContinue
.\vcpkg.exe install range-v3
.\vcpkg.exe install libsodium
.\vcpkg.exe install date
.\vcpkg.exe install pthreads
.\vcpkg.exe install zlib
.\vcpkg.exe install gtest
.\vcpkg.exe install jsoncpp
rd -r ".\buildtrees\" -ErrorAction SilentlyContinue
rd -r ".\downloads\" -ErrorAction SilentlyContinue
cd ..
nimble build -y
# downloading debug dlls because powershell build doesnt put it
$SHAORIG = "A31827929A4D73EB71BD6986C38EB16D4E779DC3880EFA520869D00C3C0E2AB9"
$DWFILE = ($PWD | select -exp Path) + '\debuglibs-win-dexpro.zip'
(New-Object System.Net.WebClient).DownloadFile('https://github.com/KomodoPlatform/depot/releases/download/0.1/debuglibs-win-atomicdexpro.zip', $DWFILE)
$SHADW = Get-FileHash -Algorithm SHA256 .\debuglibs-win-dexpro.zip | select -exp Hash
if ($SHADW -ne $SHAORIG) {Throw "Wrong hash: $SHADW =! $SHAORIG"}
cmd /c '.\ci_tools_atomic_dex.exe --install_dependencies 2>&1'
cmd /c '.\ci_tools_atomic_dex.exe build debug 2>&1'
7z e -o'build-Debug\bin\' .\debuglibs-win-dexpro.zip
cmd /c '.\ci_tools_atomic_dex.exe bundle debug 2>&1'
ls bundle-Debug/bundle.zip
Expand Down
20 changes: 15 additions & 5 deletions CMakeLists.txt
Expand Up @@ -42,16 +42,21 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX TRUE)
endif()

if (UNIX AND NOT APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()

##! We fetch our dependence
if (APPLE)
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.0.1928/mm2-df9540360-Darwin-Release.zip)
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.0.2002/mm2-3a9680fa4-Darwin-Release.zip)
elseif (UNIX AND NOT APPLE)
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.0.1928/mm2-df9540360-Linux-Release.zip)
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.0.2002/mm2-3a9680fa4-Linux-Release.zip)
else ()
FetchContent_Declare(mm2
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.0.1928/mm2-df9540360-Windows_NT-Debug.zip)
URL https://github.com/KomodoPlatform/atomicDEX-API/releases/download/beta-2.0.2002/mm2-3a9680fa4-Windows_NT-Release.zip)
endif ()

FetchContent_Declare(jl777-coins
Expand All @@ -66,6 +71,9 @@ if (UNIX)
else ()
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/coins COPYONLY)
configure_file(${mm2_SOURCE_DIR}/mm2.exe ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/mm2.exe COPYONLY)
configure_file(${mm2_SOURCE_DIR}/msvcp140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/msvcp140.dll COPYONLY)
configure_file(${mm2_SOURCE_DIR}/msvcr100.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/msvcr100.dll COPYONLY)
configure_file(${mm2_SOURCE_DIR}/vcruntime140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/mm2/vcruntime140.dll COPYONLY)
endif ()

FetchContent_Declare(libqr_code
Expand Down Expand Up @@ -149,8 +157,10 @@ else ()
)
endif ()

add_compile_definitions(LOGURU_WITH_FILEABS=1)
target_compile_definitions(atomic_qt
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
PRIVATE
$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_include_directories(atomic_qt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
$<$<PLATFORM_ID:Darwin>:${CMAKE_CURRENT_SOURCE_DIR}/src/osx>
${libqr_code_SOURCE_DIR}/src)
Expand All @@ -170,7 +180,7 @@ target_link_libraries(atomic_qt
antara::http_client
Folly::folly
Folly::folly_deps
$<$<PLATFORM_ID:Darwin>:curl>
$<$<PLATFORM_ID:Darwin>:/usr/local/lib/libcurl.a>
)
#target_enable_asan(atomic_qt)

Expand Down

0 comments on commit 9ab2e2b

Please sign in to comment.