From 9c6d74c3a286ed8ef10514c1040d1c8094724ee2 Mon Sep 17 00:00:00 2001 From: Andy Sweet Date: Mon, 2 Oct 2023 09:24:55 -0700 Subject: [PATCH] Add build and release steps for macOS and linux (#34) Closes #28 --------- Co-authored-by: Alan Liddell --- .github/workflows/build.yml | 72 +++++++++++++++++++++++++++++++++-- .github/workflows/release.yml | 69 ++++++++++++++++++++++++++++++++- CHANGELOG.md | 8 +++- cmake/simd.cmake | 19 +++++---- 4 files changed, 153 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 245e21b..290a695 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,13 +43,77 @@ jobs: with: arch: amd64_x86 - - name: Package + - name: CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 + + - name: Build run: | - cmake -B ${{github.workspace}}/pack -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 - cmake --build ${{github.workspace}}/pack --config Release - cpack --config ${{github.workspace}}/pack/CPackConfig.cmake -C Release -G ZIP + cmake --build ${{github.workspace}}/build--config Release + cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP - uses: actions/upload-artifact@v3 with: name: windows-latest Release binaries path: ${{github.workspace}}/*.zip + + linux-build: + name: "Build on Ubuntu" + runs-on: + - ubuntu-latest + + permissions: + actions: write + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + + - name: CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 + + - name: Build + run: | + cmake --build ${{github.workspace}}/build --config Release + cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP + + - uses: actions/upload-artifact@v3 + with: + name: ubuntu-latest Release binaries + path: ${{github.workspace}}/*.zip + + mac-build: + name: "Build on Mac" + runs-on: macos-latest + + permissions: + actions: write + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v3 + with: + submodules: true + + - name: CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" + + - name: Build + run: | + cmake --build ${{github.workspace}}/build --config Release + cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP + + - uses: actions/upload-artifact@v3 + with: + name: macos-latest Release binaries + path: ${{github.workspace}}/*.zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 574b015..2ab006e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,9 +61,11 @@ jobs: ctest -C Release -L anyplatform --output-on-failure ctest -C Release -L acquire-driver-spinnaker --output-on-failure - - name: Package + - name: CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 + + - name: Build run: | - cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 cmake --build ${{github.workspace}}/build --config Release cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP @@ -72,9 +74,72 @@ jobs: name: Windows Release binaries path: ${{github.workspace}}/*.zip + linux-build: + name: "Build on Ubuntu" + runs-on: + - ubuntu-latest + + permissions: + actions: write + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v3 + with: + submodules: true + + - name: CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 + + - name: Build + run: | + cmake --build ${{github.workspace}}/build --config Release + cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP + + - uses: actions/upload-artifact@v3 + with: + name: ubuntu-latest Release binaries + path: ${{github.workspace}}/*.zip + + mac-build: + name: "Build on Mac" + runs-on: macos-latest + + permissions: + actions: write + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v3 + with: + submodules: true + + - name: CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" + + - name: Build + run: | + cmake --build ${{github.workspace}}/build --config Release + cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP + + - uses: actions/upload-artifact@v3 + with: + name: macos-latest Release binaries + path: ${{github.workspace}}/*.zip + release: needs: - windows-build + - linux-build + - mac-build name: "Release" runs-on: "ubuntu-latest" diff --git a/CHANGELOG.md b/CHANGELOG.md index 674ba00..c41fca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.1.1](https://github.com/acquire-project/acquire-driver-spinnaker/compare/v0.1.0...v0.1.1) - 2023-10-02 + +### Added + +- CI macOS and Linux builds to make release process compatible with [acquire-python](https://github.com/acquire-project/acquire-python) ([#34](https://github.com/acquire-project/acquire-driver-spinnaker/pull/34)). + ## [0.1.0](https://github.com/acquire-project/acquire-driver-spinnaker/tree/v0.1.0) - 2023-09-29 ### Added -- Initial support for the Oryx [ORX-10GS-51S5M-C](https://www.flir.com/products/oryx-10gige/?model=ORX-10GS-51S5M-C&vertical=machine+vision&segment=iis) 10GigE camera ([#18](https://github.com/acquire-project/acquire-driver-spinnaker/pull/18)) +- Initial support for the Oryx [ORX-10GS-51S5M-C](https://www.flir.com/products/oryx-10gige/?model=ORX-10GS-51S5M-C&vertical=machine+vision&segment=iis) 10GigE camera ([#18](https://github.com/acquire-project/acquire-driver-spinnaker/pull/18)). - Initial support for the Blackfly [BFLY-U3-23S6M-C](https://www.flir.com/products/blackfly-usb3/?model=BFLY-U3-23S6M-C&vertical=machine+vision&segment=iis) USB3 camera ([#4](https://github.com/acquire-project/acquire-driver-spinnaker/pull/4)). diff --git a/cmake/simd.cmake b/cmake/simd.cmake index d94a069..e600426 100644 --- a/cmake/simd.cmake +++ b/cmake/simd.cmake @@ -1,12 +1,15 @@ include(cmake/TargetArch.cmake) function(target_enable_simd tgt) - target_architecture(arch) - set(is_gcc_like "$,$>") - set(is_msvc_like "$,$>") - set(is_arch_x64 "$") - target_compile_options(${tgt} PRIVATE - $<$:-mavx2> - $<$:/arch:AVX2> - ) + if(NOT APPLE) + # Broken on osx github runners for some reason + target_architecture(arch) + set(is_gcc_like "$,$>") + set(is_msvc_like "$,$>") + set(is_arch_x64 "$") + target_compile_options(${tgt} PRIVATE + $<$:-mavx2> + $<$:/arch:AVX2> + ) + endif() endfunction()