Files
edgetx-gx12/.github/actions/build_companion/action.yml
T

114 lines
3.4 KiB
YAML

name: 'Build Companion'
inputs:
os:
description: 'OS / Architecture'
required: true
qt-version:
description: 'Qt version'
default: '6.9.3'
qt-arch:
description: 'Qt architecture'
required: runner.os != 'Linux'
sdl2-version:
description: 'Upstream SDL2 version (Windows only)'
default: '2.32.8'
sdl3-version:
description: 'SDL3 version built from source for macOS'
default: '3.4.14'
sdl2-compat-version:
description: 'sdl2-compat version built from source for macOS'
default: '2.32.70'
macos-deployment-target:
description: 'Minimum macOS version the SDL libraries are built for'
default: '11.0'
runs:
using: "composite"
steps:
- name: Install Qt
if: runner.os != 'Linux'
uses: jdpurcell/install-qt-action@v5
env:
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
with:
version: ${{ inputs.qt-version }}
modules: 'qtmultimedia qtserialport'
arch: ${{ inputs.qt-arch }}
cache: true
cache-key-prefix: 'install-qt-action-${{ inputs.qt-arch }}'
# macOS builds SDL from source (see setup-sdl.sh) - cache it so only the first
# run per version pays for it
- name: Cache SDL build
if: runner.os == 'macOS'
uses: actions/cache@v6
with:
path: ${{ runner.temp }}/sdl
key: sdl-${{ runner.os }}-${{ inputs.sdl3-version }}-${{ inputs.sdl2-compat-version }}-${{ inputs.macos-deployment-target }}
- name: Setup SDL
if: runner.os != 'Linux'
shell: bash
env:
ACTION_PATH: ${{ github.action_path }}
SDL2_VERSION: ${{ inputs.sdl2-version }}
SDL3_VERSION: ${{ inputs.sdl3-version }}
SDL2_COMPAT_VERSION: ${{ inputs.sdl2-compat-version }}
MACOS_DEPLOYMENT_TARGET: ${{ inputs.macos-deployment-target }}
run: |
"${ACTION_PATH}/setup-sdl.sh"
- name: Setup MSVC
if: runner.os == 'Windows'
shell: pwsh
run: ${{ github.action_path }}/setup-msvc.ps1
- name: Install NSIS
if: runner.os == 'Windows'
uses: repolevedavaj/install-nsis@v1
with:
nsis-version: '3.11'
- name: Build
shell: bash
env:
CMAKE_BUILD_TYPE: 'Release'
run: |
mkdir output && \
CMAKE_PREFIX_PATH="$QT_ROOT_DIR;$SDL2_ROOT" \
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
- name: Compose release filename
if: always()
run: echo "artifact_name=edgetx-cpn-${{ inputs.os }}-${GITHUB_REF##*/}" >> $GITHUB_ENV
shell: bash
- name: Collect build logs
if: always()
shell: bash
run: |
mkdir -p logs
if [ -d "build" ]; then
find build -name "*.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
find build -name "CMakeOutput.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
find build -name "CMakeError.log" -type f -exec cp {} logs/ \; 2>/dev/null || true
fi
- name: Archive production artifacts
uses: actions/upload-artifact@v7
with:
name: "${{ env.artifact_name }}"
path: ${{github.workspace}}/output
retention-days: 15
- name: Archive build logs
if: always()
uses: actions/upload-artifact@v7
with:
name: "${{ env.artifact_name }}-logs"
path: ${{github.workspace}}/logs
retention-days: 30
if-no-files-found: ignore