Skip to content

Commit

Permalink
Build windows installer workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneLin0708 committed Aug 12, 2024
1 parent d8c98d7 commit 3d1d8c5
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 19 deletions.
10 changes: 10 additions & 0 deletions .github/conan_profiles/macos-14-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=armv8
compiler=apple-clang
compiler.cppstd=gnu20
compiler.libcxx=libc++
compiler.version=15
os=Macos
os.version=12.0
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
10 changes: 10 additions & 0 deletions .github/conan_profiles/macos-14-x64
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
arch=x86_64
compiler=apple-clang
compiler.cppstd=gnu20
compiler.libcxx=libc++
compiler.version=15
os=Macos
os.version=12.0
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
9 changes: 9 additions & 0 deletions .github/conan_profiles/ubuntu-22.04-x64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
compiler=gcc
compiler.cppstd=gnu20
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
9 changes: 9 additions & 0 deletions .github/conan_profiles/windows-2022-x64
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
arch=x86_64
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.version=194
os=Windows
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
60 changes: 42 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
name: Build binaries
name: Build Installer

on: [push, workflow_dispatch]
on:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
os: [windows-2022, macos-13, ubuntu-22.04]
os_arch: [{ os: windows-2022, arch: x64 }]

name: ${{ matrix.os }}-build
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os_arch.os }}

env:
OS_ARCH: ${{ matrix.os_arch.os }}-${{ matrix.os_arch.arch }}

steps:
- uses: lukka/get-cmake@latest
- name: Install conan
run: pip install conan ninja

- name: conan cache
id: conan_cache
uses: actions/cache@v4
with:
path: ~/.conan2
key: ${{ env.OS_ARCH }}-conan

- name: Checkout code
uses: actions/checkout@v4

- uses: ilammy/msvc-dev-cmd@v1
- name: Setup Compiler (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os_arch.os == 'windows-2022'

- name: Install OpenCL (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
if: matrix.os_arch.os == 'ubuntu-22.04'
run: |
sudo apt-get install -y ocl-icd-opencl-dev
Expand All @@ -27,20 +43,28 @@ jobs:
version: '5.15.2'
cache: true

- uses: actions/checkout@v3
- name: Conan setup
run: |
conan config install .github/conan_profiles/${{ env.OS_ARCH }} -tf profiles
- name: Install libxdaq
run: |
git submodule update --init --recursive
conan create libxdaq-dist --profile:all ${{ env.OS_ARCH }} -s build_type=Release --build=missing
- name: Build and Install
- name: Build XDAQ-OE
run: |
cmake -S . -B build -G "Ninja Multi-Config"
cmake --build build --config Release
conan install . --build=missing --profile:all ${{ env.OS_ARCH }} -s build_type=Release
cmake -S . -B build/Release --preset conan-release
cmake --build build/Release --preset conan-release
cmake --build build/Release --preset conan-release --target package
- name: tar binaries to keep file permissions
working-directory: build
- name: Tar binaries to keep file permissions
run: |
tar -cvf Release.tar Release
tar -cvf build/package.tar build/Release/package
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: XDAQ-RHX ${{ matrix.os }}
path: build/Release.tar
name: ${{ env.OS_ARCH }}
path: build/package.tar
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "libxdaq-dist"]
path = libxdaq-dist
url = https://github.com/kontex-neuro/libxdaq-dist.git
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)

set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version")

project(XDAQ-RHX VERSION 1.1.5 LANGUAGES CXX)
project(XDAQ-RHX VERSION 1.2.0 LANGUAGES CXX)

SET(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake
Expand Down Expand Up @@ -124,6 +124,8 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include (InstallRequiredSystemLibraries)

set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}/package)

set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_NSIS_DISPLAY_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR "KonteX Neuroscience")
Expand Down
1 change: 1 addition & 0 deletions libxdaq-dist
Submodule libxdaq-dist added at 817390

0 comments on commit 3d1d8c5

Please sign in to comment.