Skip to content

Refactor plugin internals into focused modules; heli and report path fixes #71

Refactor plugin internals into focused modules; heli and report path fixes

Refactor plugin internals into focused modules; heli and report path fixes #71

Workflow file for this run

name: Build
on:
pull_request:
branches: [main]
push:
tags:
- 'v*'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install tools
run: |
sudo apt-get update -q
sudo apt-get install -y clang clang-tidy libgl-dev unzip curl
- name: Setup dependencies
run: make setup
- name: Configure (generate compile_commands.json)
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-Wno-dev
- name: Run clang-tidy
run: clang-tidy -p build src/*.cpp
build-macos:
needs: [lint]
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Setup dependencies
run: make setup
- name: Build
run: |
RELEASE_FLAG=""
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then RELEASE_FLAG="-DRELEASE=ON"; fi
cmake -B build -DCMAKE_BUILD_TYPE=Release $RELEASE_FLAG -Wno-dev
cmake --build build --parallel
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: xp_pilot-macos
path: build/xp_pilot.xpl
build-linux:
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: sudo apt-get update -q && sudo apt-get install -y libgl-dev
- name: Setup dependencies
run: make setup
- name: Build
run: |
RELEASE_FLAG=""
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then RELEASE_FLAG="-DRELEASE=ON"; fi
cmake -B build -DCMAKE_BUILD_TYPE=Release $RELEASE_FLAG -Wno-dev
cmake --build build --parallel
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: xp_pilot-linux
path: build/xp_pilot.xpl
build-windows:
needs: [lint]
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Install make
run: choco install make --no-progress -y
- name: Setup dependencies
shell: bash
run: make setup
- name: Build
shell: bash
run: |
RELEASE_FLAG=""
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then RELEASE_FLAG="-DRELEASE=ON"; fi
cmake -B build -A x64 $RELEASE_FLAG
cmake --build build --config Release
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: xp_pilot-windows
path: build/Release/xp_pilot.xpl
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [lint, build-macos, build-linux, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Download macOS artifact
uses: actions/download-artifact@v8
with:
name: xp_pilot-macos
path: dist/macos
- name: Download Linux artifact
uses: actions/download-artifact@v8
with:
name: xp_pilot-linux
path: dist/linux
- name: Download Windows artifact
uses: actions/download-artifact@v8
with:
name: xp_pilot-windows
path: dist/windows
- name: Build ZIP
run: |
mkdir -p dist/xp_pilot/mac_x64
mkdir -p dist/xp_pilot/lin_x64
mkdir -p dist/xp_pilot/win_x64
mkdir -p dist/xp_pilot/data
cp dist/macos/xp_pilot.xpl dist/xp_pilot/mac_x64/xp_pilot.xpl
cp dist/linux/xp_pilot.xpl dist/xp_pilot/lin_x64/xp_pilot.xpl
cp dist/windows/xp_pilot.xpl dist/xp_pilot/win_x64/xp_pilot.xpl
cp data/flight_logger_profiles.json dist/xp_pilot/data/
# Map overlay data (coastlines and lakes). Without it the track map simply
# draws no water, so a missing file would ship as a silent feature loss.
cp data/coastlines.dat data/cities.dat dist/xp_pilot/data/
test -s dist/xp_pilot/data/coastlines.dat
test -s dist/xp_pilot/data/cities.dat
# SkunkCrafts control files into the staging tree, BEFORE the zip, so
# the release ZIP also carries the cfg (manual installs become
# updater-discoverable). Version from the tag (v1.2.3 -> 1.2.3).
python3 tools/skunkcrafts/generate.py \
--tree dist/xp_pilot --version "${GITHUB_REF_NAME#v}"
cd dist && zip -r xp_pilot.zip xp_pilot/
- name: Create release with assets
uses: softprops/action-gh-release@v2
with:
files: dist/xp_pilot.zip
generate_release_notes: true
- name: Publish SkunkCrafts update tree
if: startsWith(github.ref, 'refs/tags/v')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
STAGE=dist/xp_pilot
pushd "$STAGE"
git init -q
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -q -m "release ${GITHUB_REF_NAME}"
git branch -M release
git push --force \
"https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" release
popd