Update to support streamdeck modules #65
This file contains hidden or 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: Build and Package | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.os }} ${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| arch: x64 | |
| - os: macos-latest | |
| arch: x64 | |
| - os: macos-14 | |
| arch: arm64 | |
| - os: ubuntu-latest | |
| arch: x64 | |
| - os: ubuntu-latest | |
| arch: arm64 | |
| raspios: raspios_lite_arm64:latest | |
| - os: ubuntu-latest | |
| arch: arm | |
| raspios: raspios_lite:latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Setup and Build On RaspiOS | |
| if: matrix.raspios != '' | |
| uses: pguyot/arm-runner-action@v2 | |
| id: build_image | |
| with: | |
| base_image: ${{ matrix.raspios }} | |
| cpu: cortex-a7 | |
| import_github_env: true | |
| optimize_image: false | |
| image_additional_mb: 128 | |
| copy_repository_path: ${{github.workspace}} | |
| copy_artifact_path: ./build | |
| copy_artifact_dest: ${{github.workspace}}/build | |
| commands: | | |
| sudo apt update | |
| sudo apt-get install -y pipx libudev-dev libusb-1.0-0-dev cmake | |
| pipx install conan | |
| conan profile detect --force | |
| conan install . --output-folder=build --build=missing | |
| cmake . -B "build" -DCMAKE_TOOLCHAIN_FILE="build/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
| cmake --build "build" --target screamdeck | |
| - name: Install Package | |
| if: runner.os == 'Linux' && matrix.raspios == '' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev libusb-1.0-0-dev | |
| - name: Install Conan | |
| if: matrix.raspios == '' | |
| uses: turtlebrowser/get-conan@v1.2 | |
| - name: Acquire/Build Conan Dependencies | |
| if: matrix.raspios == '' | |
| run: | | |
| conan profile detect --force | |
| conan install ${{github.workspace}} --output-folder=build --build=missing | |
| - name: Configure & Build (Windows) | |
| if: runner.os == 'Windows' && matrix.raspios == '' | |
| run: | | |
| cmake . -B "build" -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="build/conan_toolchain.cmake" | |
| cmake --build "build" --target screamdeck --config ${{env.BUILD_TYPE}} | |
| - name: Configure & Build (Posix) | |
| if: runner.os != 'Windows' && matrix.raspios == '' | |
| run: | | |
| cmake . -B "build" -DCMAKE_TOOLCHAIN_FILE="build/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
| cmake --build "build" --target screamdeck | |
| - name: Upload Built Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.os }}_${{ matrix.arch }}_package | |
| path: | | |
| include/*.h | |
| **/*.dll | |
| **/*.dylib | |
| **/*.so | |
| if-no-files-found: error | |
| package: | |
| name: Package | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - name: Download All Packages | |
| uses: actions/download-artifact@v4 | |
| - name: Delete Package Artifacts | |
| uses: geekyeggo/delete-artifact@v4 | |
| with: | |
| name: | | |
| windows-latest_x64_package | |
| macos-latest_x64_package | |
| macos-14_arm64_package | |
| ubuntu-latest_x64_package | |
| ubuntu-latest_arm64_package | |
| ubuntu-latest_arm_package | |
| - name: Copy To Staging Directory | |
| run: | | |
| mkdir -p ~/package/screamdeck | |
| mkdir -p ~/package/screamdeck/bin/win_x64 | |
| cp -r windows-latest_x64_package/build/* ~/package/screamdeck/bin/win_x64 | |
| mkdir -p ~/package/screamdeck/bin/macos_x64 | |
| cp macos-latest_x64_package/build/* ~/package/screamdeck/bin/macos_x64 | |
| mkdir -p ~/package/screamdeck/bin/macos_arm64 | |
| cp macos-14_arm64_package/build/* ~/package/screamdeck/bin/macos_arm64 | |
| mkdir -p ~/package/screamdeck/bin/linux_x64 | |
| cp ubuntu-latest_x64_package/build/* ~/package/screamdeck/bin/linux_x64 | |
| mkdir -p ~/package/screamdeck/bin/linux_arm64 | |
| cp ubuntu-latest_arm64_package/build/* ~/package/screamdeck/bin/linux_arm64 | |
| mkdir -p ~/package/screamdeck/bin/linux_arm | |
| cp ubuntu-latest_arm_package/build/* ~/package/screamdeck/bin/linux_arm | |
| - name: Upload Combined Packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: screamdeck_${{github.ref_name}}_${{github.sha}} | |
| path: ~/package |