115 lines
3.3 KiB
YAML
115 lines
3.3 KiB
YAML
name: MacOSX Companion
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- '[0-9]+.[0-9]+'
|
|
tags:
|
|
- v*
|
|
paths: &trigger-paths
|
|
- '.github/workflows/macosx_cpn.yml'
|
|
- 'companion/**'
|
|
- 'tools/build-companion.sh'
|
|
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- '[0-9]+.[0-9]+'
|
|
paths: *trigger-paths
|
|
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: Release
|
|
QT_VERSION: "6.9.3"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-15-intel
|
|
if: |
|
|
github.event_name != 'pull_request' ||
|
|
!contains(github.event.pull_request.labels.*.name, 'ci: skip-cpn-macos')
|
|
steps:
|
|
- name: Select XCode version
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: '16.0'
|
|
|
|
- name: Check out the repo
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Setup Python 3.12
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- 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: Install Qt
|
|
uses: jdpurcell/install-qt-action@v5
|
|
env:
|
|
AQT_CONFIG: ${{ github.workspace }}/tools/aqt-settings.ini
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
modules: 'qtmultimedia qtserialport'
|
|
setup-python: 'false'
|
|
cache: true
|
|
cache-key-prefix: 'install-qt-action-macOS'
|
|
|
|
- name: Install dependencies
|
|
run: python3 -m pip install --upgrade pip Pillow lz4 clang jinja2 pydantic
|
|
|
|
- name: Install SDL2
|
|
run: brew install SDL2
|
|
|
|
- name: Build
|
|
working-directory: ${{github.workspace}}
|
|
shell: bash
|
|
env:
|
|
CMAKE_BUILD_PARALLEL_LEVEL: 3
|
|
run: |
|
|
mkdir output && mkdir logs && \
|
|
tools/build-companion.sh "$(pwd)" "$(pwd)/output/" 2>&1 | tee logs/build-main.log
|
|
|
|
- name: Collect build logs
|
|
if: always()
|
|
shell: bash
|
|
run: |
|
|
# Create logs directory if it doesn't exist
|
|
mkdir -p logs
|
|
|
|
# Copy all build logs from the build directory
|
|
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: Compose release filename
|
|
if: always()
|
|
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
|
|
run: echo "artifact_name=edgetx-cpn-osx-${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
|
|
- name: Archive production artifacts
|
|
if: success()
|
|
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
|