Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/meson-build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
name: Meson Build System

# Basically, only rebuilds and tests the project when C++ is changed
# Commented out to facilitate testing
# Builds the plugin and relay on every branch push and pull request, and keeps
# both files as workflow artifacts. The path filters are commented out to
# facilitate testing. Tags are built by release.yml, which calls this workflow.
on:
push:
branches: ['**']
# paths:
# - "**.cpp"
# - "**.h"
Expand All @@ -13,13 +15,15 @@ on:
# - "**.cpp"
# - "**.h"
workflow_dispatch:
# Lets release.yml reuse this build instead of repeating its steps.
workflow_call:

permissions:
contents: read

jobs:
build-on-windows:
name: Build and Test on Windows with Meson
name: Build the plugin and relay on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -38,6 +42,24 @@ jobs:
cd xplane_plugin/
meson setup build
meson compile -C build

- name: Build the relay
working-directory: relay
run: cargo build --release

- name: Upload the plugin
uses: actions/upload-artifact@v4
with:
name: plugin
path: xplane_plugin/build/PilotDataSync.xpl
if-no-files-found: error

- name: Upload the relay
uses: actions/upload-artifact@v4
with:
name: relay
path: relay/target/release/relay.exe
if-no-files-found: error
# - name: Test the Meson Project
# run: |
# cd xplane_plugin/
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Release

# A v* tag publishes a GitHub Release. A manual run is a dry run: it builds
# and uploads the files as workflow artifacts, and publishes nothing.
on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build the plugin and relay
uses: ./.github/workflows/meson-build.yml

publish:
name: Publish the GitHub Release
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download the plugin and relay
uses: actions/download-artifact@v4
with:
path: release-files
merge-multiple: true

- name: Create the release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: >-
gh release create "$GITHUB_REF_NAME" --generate-notes
release-files/PilotDataSync.xpl release-files/relay.exe
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Run from the repo root, in order, per component:
- Baton: `cd xplane_plugin/subprojects/baton && cargo test`
- Inference: `cd inference && uv sync`, then `uv run python -m pilot_inference.<group>.<module>`. `uv run pytest` runs the tests in `inference/tests/`; the event classification scripts are mostly untested.

CI is in `.github/workflows/` (`meson-build.yml`, `super-linter.yml`). Run `meson setup` with the cross-file for your OS if not on native Windows (see README).
CI is in `.github/workflows/` (`meson-build.yml`, `super-linter.yml`, `release.yml`: a `v*` tag publishes the plugin and `relay.exe` to a GitHub Release, a manual run is a dry run). Run `meson setup` with the cross-file for your OS if not on native Windows (see README).

## Gotchas

Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ Then:

Start the components in this order: iMotions (or the mock server) → relay → X-Plane. The relay is a TCP client, and any flight data that arrives before its TCP connection is up is discarded.

## Download the built files

Lab PCs do not need to build anything. Download `PilotDataSync.xpl` and `relay.exe` from the repo's [GitHub Releases page](https://github.com/oss-slu/PilotDataSynchronization/releases).

- `PilotDataSync.xpl` goes into X-Plane's `Resources/plugins/PilotDataSync/win_x64/` folder. See [1. X-Plane plugin](#1-x-plane-plugin).
- `relay.exe` can live anywhere. Run it by double-clicking it. It needs no VC++ redistributable. Double-clicking it opens a console window next to the relay window, where its diagnostic messages go (see [2. Relay](#2-relay)).

> Not yet confirmed on a clean lab PC. The DLLs that `relay.exe` loads were checked, and none is part of the VC++ redistributable, but no one has run it on a PC without the redistributable installed. If you try it on one, please confirm it and delete this note.

Build from source only when you want to change the code, or while no release has been published yet. A release is published by pushing a `v*` tag, such as `v0.1.0`.

To try a branch on the lab PC before it merges, open its CI run under the repo's Actions tab. Every run keeps both files as workflow artifacts.

## Prerequisites

| Tool | Version | Needed for | Notes |
Expand Down
3 changes: 3 additions & 0 deletions relay/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Link the C runtime statically so relay.exe runs on a PC without the VC++ redistributable.
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
Loading