From e5cf26054cccadc709e4b4999949f9be10ac201f Mon Sep 17 00:00:00 2001 From: 1bananas1 Date: Fri, 13 Nov 2026 09:14:29 -0600 Subject: [PATCH 1/2] Issue #257 solved: publish PilotDataSync.xpl and relay.exe from CI meson-build.yml now also builds the relay and keeps both files as workflow artifacts on every run. release.yml reuses that build; a v* tag publishes both files to a GitHub Release, and a manual run is a dry run. relay/.cargo/config.toml links the C runtime statically, so relay.exe needs no VC++ redistributable (checked locally: no vcruntime140 or api-ms-win-crt imports). The README says where to download them. --- .github/workflows/meson-build.yml | 20 ++++++++++++++ .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++ README.md | 11 ++++++++ relay/.cargo/config.toml | 3 ++ 4 files changed, 80 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 relay/.cargo/config.toml diff --git a/.github/workflows/meson-build.yml b/.github/workflows/meson-build.yml index 33a0b92..6cf7dda 100644 --- a/.github/workflows/meson-build.yml +++ b/.github/workflows/meson-build.yml @@ -13,6 +13,8 @@ on: # - "**.cpp" # - "**.h" workflow_dispatch: + # Lets release.yml reuse this build instead of repeating its steps. + workflow_call: permissions: contents: read @@ -38,6 +40,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: PilotDataSync-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/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cf87cb6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +--- +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: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download the plugin + uses: actions/download-artifact@v4 + with: + name: PilotDataSync-plugin + path: release-files + + - name: Download the relay + uses: actions/download-artifact@v4 + with: + name: relay + path: release-files + + - 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 diff --git a/README.md b/README.md index d38e681..994702c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,17 @@ 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. + +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 | diff --git a/relay/.cargo/config.toml b/relay/.cargo/config.toml new file mode 100644 index 0000000..c068bbd --- /dev/null +++ b/relay/.cargo/config.toml @@ -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"] From 15eed4a4589eea6177e504177f5e3d8af4ac8b4b Mon Sep 17 00:00:00 2001 From: 1bananas1 Date: Fri, 13 Nov 2026 09:17:41 -0600 Subject: [PATCH 2/2] Issue #257: address review of the release workflow A manual run started on a tag ref no longer publishes: the publish job needs a tag push. meson-build.yml builds branches only, so a v* tag is built once, by release.yml. One download step fetches both artifacts, now named plugin and relay. AGENTS.md lists release.yml, and the README notes that the no-redistributable claim is unconfirmed on a clean lab PC and that relay.exe opens a console window. --- .github/workflows/meson-build.yml | 10 ++++++---- .github/workflows/release.yml | 12 +++--------- AGENTS.md | 2 +- README.md | 4 +++- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/meson-build.yml b/.github/workflows/meson-build.yml index 6cf7dda..5bc1265 100644 --- a/.github/workflows/meson-build.yml +++ b/.github/workflows/meson-build.yml @@ -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" @@ -21,7 +23,7 @@ permissions: 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 @@ -48,7 +50,7 @@ jobs: - name: Upload the plugin uses: actions/upload-artifact@v4 with: - name: PilotDataSync-plugin + name: plugin path: xplane_plugin/build/PilotDataSync.xpl if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf87cb6..1cf59a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,22 +20,16 @@ jobs: publish: name: Publish the GitHub Release needs: build - if: startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest permissions: contents: write steps: - - name: Download the plugin + - name: Download the plugin and relay uses: actions/download-artifact@v4 with: - name: PilotDataSync-plugin - path: release-files - - - name: Download the relay - uses: actions/download-artifact@v4 - with: - name: relay path: release-files + merge-multiple: true - name: Create the release env: diff --git a/AGENTS.md b/AGENTS.md index fc7852f..087bf21 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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..`. `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 diff --git a/README.md b/README.md index 994702c..bc893ad 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ Start the components in this order: iMotions (or the mock server) → relay → 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. +- `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`.