Fix etcd keepalive and watcher #101
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: Generate Native Libs | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: Build Platform Specific Native Libs | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
arch: [x86_64] | |
include: | |
- os: windows-latest | |
preset: npitaya-default | |
cmake_path: build/_builds | |
cppstd: "17" | |
- os: ubuntu-latest | |
preset: npitaya-release | |
cmake_path: build/_builds/Release | |
cppstd: gnu17 | |
- os: macos-latest | |
preset: npitaya-release | |
cmake_path: build/_builds/Release | |
arch: x86_64 | |
cppstd: gnu17 | |
- os: macos-latest | |
preset: npitaya-release | |
cmake_path: build/_builds/Release | |
arch: armv8 | |
cppstd: gnu17 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Conan | |
id: conan | |
uses: turtlebrowser/get-conan@main | |
env: | |
PIP_BREAK_SYSTEM_PACKAGES: 1 | |
- name: Update conan profile | |
run: conan profile detect | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Using the builtin GitHub Cache Action for .conan | |
id: cache-conan-restore | |
uses: actions/cache/restore@v3 | |
env: | |
cache-name: cache-conan-modules | |
with: | |
path: ~/.conan2/ | |
key: ${{ runner.os }}-${{ matrix.arch }}-builder-${{ env.cache-name }}-${{ hashFiles('cpp-lib/conanfile.py') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.arch }}-builder-${{ env.cache-name }}- | |
- name: Install Dependencies | |
run: conan install . -of build -s build_type=${{env.BUILD_TYPE}} -s arch=${{matrix.arch}} -s:b compiler.cppstd=${{ matrix.cppstd }} -s compiler.cppstd=${{ matrix.cppstd }} --build=missing | |
working-directory: cpp-lib | |
- name: Configure CMake | |
run: cmake --preset ${{matrix.preset}} -DBUILD_TESTING=OFF | |
working-directory: cpp-lib | |
- name: Build | |
run: cmake --build ${{matrix.cmake_path}} --config ${{env.BUILD_TYPE}} --target pitaya_cpp | |
working-directory: cpp-lib | |
- uses: actions/cache/save@v3 | |
if: always() | |
env: | |
cache-name: cache-conan-modules | |
with: | |
path: ~/.conan2/ | |
key: ${{ runner.os }}-${{ matrix.arch }}-builder-${{ env.cache-name }}-${{ hashFiles('cpp-lib/conanfile.py') }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: prebuilt-libs-${{ matrix.os }}-${{ matrix.arch }} | |
path: | | |
cpp-lib/build/**/*pitaya_cpp.dll | |
cpp-lib/build/**/*pitaya_cpp.so | |
cpp-lib/build/**/*pitaya_cpp.dylib | |
cpp-lib/build/**/*pitaya_cpp.bundle | |
consolidate_archive: | |
name: Consolidate all libs into single package | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- name: Download platform specific artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: downloaded-artifacts | |
- name: Process Libs | |
run: | | |
mkdir macos-fat macos-arm64 macos-x86_64 linux-x86_64 windows-x86_64 macos-fat-unity | |
lipo -create prebuilt-libs-macos-latest-armv8/_builds/Release/libpitaya_cpp.dylib prebuilt-libs-macos-latest-x86_64/_builds/Release/libpitaya_cpp.dylib -output macos-fat/libpitaya_cpp.dylib | |
cp macos-fat/libpitaya_cpp.dylib macos-fat-unity/libpitaya_cpp.bundle | |
mv prebuilt-libs-macos-latest-armv8/_builds/Release/libpitaya_cpp.dylib macos-arm64 | |
mv prebuilt-libs-macos-latest-x86_64/_builds/Release/libpitaya_cpp.dylib macos-x86_64 | |
mv prebuilt-libs-ubuntu-latest-x86_64/_builds/Release/libpitaya_cpp.so linux-x86_64 | |
mv prebuilt-libs-windows-latest-x86_64/_builds/Release/pitaya_cpp.dll windows-x86_64/libpitaya_cpp.dll | |
working-directory: downloaded-artifacts | |
- name: 'Upload Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: prebuilt-libs-all-archs | |
path: | | |
./**/*pitaya_cpp.dll | |
./**/*pitaya_cpp.so | |
./**/*pitaya_cpp.dylib | |
./**/*pitaya_cpp.bundle | |
working-directory: downloaded-artifacts |