changes for external build

use XRPLF repos

build develop-next branch; self-hosted runner

force linux runner
This commit is contained in:
Michael Legleux
2022-04-29 13:33:07 -07:00
parent 8bf44c978e
commit f2f2f92aa6
6 changed files with 50 additions and 25 deletions

View File

@@ -1,10 +1,10 @@
name: Build Clio
on:
push:
branches: [master, develop]
branches: [master, develop, develop-next]
pull_request:
branches: [master, develop]
branches: [master, develop, develop-next]
jobs:
lint:
name: Lint
@@ -12,30 +12,36 @@ jobs:
steps:
- name: Get source
uses: actions/checkout@v3
- name: Run clang-format
uses: XRPLF/clio-build/lint@main
build_clio:
uses: XRPLF/clio-gha/lint@main
build_clio:
name: Build
runs-on: ubuntu-20.04
runs-on: [self-hosted, Linux]
needs: lint
steps:
- name: Get clio repo
- name: Get Clio repo
uses: actions/checkout@v3
with:
path: clio_src
- name: Get gha repo
ref: 'develop-next'
- name: Get Clio CI repo
uses: actions/checkout@v3
with:
repository: XRPLF/clio-build
ref: main
path: gha # must be the same as defined in XRPLF/clio-build
path: clio_ci
repository: 'XRPLF/clio-ci'
- name: Get GitHub actions repo
uses: actions/checkout@v3
with:
repository: XRPLF/clio-gha
path: gha # must be the same as defined in XRPLF/clio-gha
- name: Build
uses: XRPLF/clio-build/build@main
uses: XRPLF/clio-gha/build@main
# - name: Artifact clio_tests
# uses: actions/upload-artifact@v2
# with:

View File

@@ -16,6 +16,7 @@ ExternalProject_Add(postgres
${POSTGRES_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pgcommon${CMAKE_STATIC_LIBRARY_SUFFIX}}
${POSTGRES_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pgport${CMAKE_STATIC_LIBRARY_SUFFIX}}
)
ExternalProject_Get_Property (postgres BINARY_DIR)
foreach(_lib ${POSTGRES_LIBS})
add_library(${_lib} STATIC IMPORTED GLOBAL)
@@ -26,5 +27,5 @@ foreach(_lib ${POSTGRES_LIBS})
INTERFACE_INCLUDE_DIRECTORIES ${POSTGRES_INSTALL_DIR}/include)
target_link_libraries(clio PUBLIC ${POSTGRES_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${_lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
endforeach()
add_dependencies(clio postgres)
target_include_directories(clio PUBLIC ${POSTGRES_INSTALL_DIR}/include)

View File

@@ -1,4 +0,0 @@
execute_process(
COMMAND ln -s ${CMAKE_INSTALL_PREFIX}/${CLIO_INSTALL_DIR}/bin/clio_server /usr/local/bin/clio_server
COMMAND_ECHO STDOUT
)

View File

@@ -0,0 +1,16 @@
[Unit]
Description=Clio XRPL API server
Documentation=https://github.com/XRPLF/clio.git
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=@CLIO_INSTALL_DIR@/bin/clio_server @CLIO_INSTALL_DIR@/etc/config.json
Restart=on-failure
User=clio
Group=clio
[Install]
WantedBy=multi-user.target

View File

@@ -1,7 +1,10 @@
set(CLIO_INSTALL_DIR /opt/clio)
set(CLIO_INSTALL_DIR "/opt/clio")
set(CMAKE_INSTALL_PREFIX ${CLIO_INSTALL_DIR})
install(TARGETS clio_server DESTINATION bin)
# install(TARGETS clio_tests DESTINATION bin) # NOTE: Do we want to install the tests?
install(FILES example-config.json DESTINATION etc/clio)
install(SCRIPT "${CMAKE_SOURCE_DIR}/CMake/install/PostInstall.cmake")
install(FILES example-config.json DESTINATION etc RENAME config.json)
configure_file("${CMAKE_SOURCE_DIR}/CMake/install/clio.service.in" "${CMAKE_BINARY_DIR}/clio.service")
install(FILES "${CMAKE_BINARY_DIR}/clio.service" DESTINATION /lib/systemd/system)

View File

@@ -81,3 +81,6 @@ if(BUILD_TESTS)
endif()
include(CMake/install/install.cmake)
if(PACKAGING)
include(CMake/packaging.cmake)
endif()