Skip to content

Cont'd

Cont'd #364

Workflow file for this run

name: Build
on:
push:
pull_request:
workflow_dispatch:
env:
BUILD_TYPE: MinSizeRel
# NOTE NOTE NOTE MANUALLY KEEP WINDOWS BUILD TYPE IN SYNC
# vvvvvvvvvvvvvvvvvvvvv since this apparently does NOT work
# binary_path: build/client/${{ env.build_type }}/SonyHeadphonesClient.exe
jobs:
build:
name: Build ${{ matrix.os }} ${{ matrix.arch }}
strategy:
matrix:
include:
- os: windows-latest
arch: x64
binary_path: build/client/MinSizeRel/SonyHeadphonesClient.exe
artifact_name: "SonyHeadphonesClient-win-x64"
script: ""
- os: windows-11-arm
arch: arm64
binary_path: build/client/MinSizeRel/SonyHeadphonesClient.exe
artifact_name: "SonyHeadphonesClient-win-arm64"
script: ""
- os: ubuntu-latest
arch: x64
binary_path: build/client/SonyHeadphonesClient
artifact_name: "SonyHeadphonesClient-linux-x64"
script: "sudo apt-get update && sudo apt-get install -y libbluetooth-dev libdbus-1-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev libcurl4-openssl-dev"
gcc: 14
- os: ubuntu-24.04-arm
arch: arm64
binary_path: build/client/SonyHeadphonesClient
artifact_name: "SonyHeadphonesClient-linux-arm64"
script: "sudo apt-get update && sudo apt-get install -y libbluetooth-dev libdbus-1-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules xorg-dev libcurl4-openssl-dev"
gcc: 14
- os: macos-latest
arch: universal
binary_path: build/client/SonyHeadphonesClient.zip
artifact_name: "SonyHeadphonesClient-macos-universal"
script: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Download Packages
run: ${{ matrix.script }}
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake (Windows)
working-directory: ${{github.workspace}}/build
if: runner.os == 'Windows'
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMDR_ENABLE_CODEGEN=OFF -DMDR_CLIENT_DEBUGGER=ON -A ${{ matrix.arch }}
- name: Configure CMake (Linux)
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
working-directory: ${{github.workspace}}/build
if: runner.os == 'Linux'
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMDR_ENABLE_CODEGEN=OFF -DMDR_CLIENT_DEBUGGER=ON
- name: Configure CMake (macOS)
working-directory: ${{github.workspace}}/build
if: runner.os == 'macOS'
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DMDR_ENABLE_CODEGEN=OFF -DMDR_CLIENT_DEBUGGER=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --target SonyHeadphonesClient
- name: Build packet replay runner
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target mdr_tests
- name: Replay packet sets
working-directory: ${{github.workspace}}/build
shell: bash
run: ctest --build-config $BUILD_TYPE --output-on-failure --no-tests=error
- name: Strip Symbols (Linux)
if: runner.os == 'Linux'
working-directory: ${{github.workspace}}
# Strip symbols from the binary to reduce size
run: strip --strip-unneeded ${{matrix.binary_path}}
- name: Pack (macOS)
if: runner.os == 'macOS'
working-directory: ${{github.workspace}}/build/client
run: zip -r SonyHeadphonesClient.zip SonyHeadphonesClient.app
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: ${{ matrix.artifact_name }}
# A file, directory or wildcard pattern that describes what to upload
path: ${{github.workspace}}/${{matrix.binary_path}}