Skip to content

Commit 26ea7ed

Browse files
committed
feat: add Linux .deb packaging via CPack
Add CPack DEB configuration to CMakeLists.txt with runtime dependencies for X11/GL. Add deb-amd64 job to release workflow that builds, smoke tests, and uploads .deb to the GitHub Release.
1 parent e2f7018 commit 26ea7ed

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,53 @@ jobs:
234234
env:
235235
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
236236

237+
# ── Job 2c: Linux amd64 .deb ──────────────────────────────────────────────
238+
deb-amd64:
239+
name: Deb (amd64)
240+
needs: source-tarball
241+
runs-on: ubuntu-latest
242+
243+
steps:
244+
- uses: actions/checkout@v4
245+
with:
246+
submodules: true
247+
248+
- name: Install build dependencies
249+
run: |
250+
sudo apt-get update
251+
sudo apt-get install -y libgl1-mesa-dev libx11-dev libxrandr-dev \
252+
libxinerama-dev libxcursor-dev libxi-dev
253+
254+
- name: Configure
255+
run: |
256+
cmake -B build \
257+
-DCMAKE_BUILD_TYPE=Release \
258+
-DCMAKE_INSTALL_PREFIX=/usr \
259+
-DMAVSIM_VERSION=${{ needs.source-tarball.outputs.version }}
260+
261+
- name: Build
262+
run: cmake --build build --config Release
263+
264+
- name: Package .deb
265+
run: cd build && cpack -G DEB
266+
267+
- name: Smoke test
268+
run: |
269+
sudo dpkg -i build/*.deb
270+
which mavsim-viewer
271+
ls /usr/share/mavsim-viewer/models/
272+
ls /usr/share/mavsim-viewer/shaders/
273+
ls /usr/share/mavsim-viewer/fonts/
274+
275+
- name: Upload .deb to release
276+
run: gh release upload ${{ github.ref_name }} build/*.deb
277+
env:
278+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
279+
237280
# ── Job 3: Publish the release ─────────────────────────────────────────────
238281
publish-release:
239282
name: Publish release
240-
needs: [bottle-arm64, bottle-x86_64]
283+
needs: [bottle-arm64, bottle-x86_64, deb-amd64]
241284
runs-on: ubuntu-latest
242285

243286
steps:

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,18 @@ if(NOT BUILD_TESTING_ONLY)
103103
install(DIRECTORY textures/ DESTINATION ${CMAKE_INSTALL_DATADIR}/mavsim-viewer/textures
104104
FILES_MATCHING PATTERN "*.png")
105105
install(FILES fonts/OFL.txt DESTINATION ${CMAKE_INSTALL_DATADIR}/mavsim-viewer/fonts)
106+
107+
# CPack packaging
108+
set(CPACK_PACKAGE_NAME "mavsim-viewer")
109+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "3D MAVLink vehicle viewer for SITL simulation")
110+
set(CPACK_PACKAGE_CONTACT "https://github.com/mavlink/mavsim-viewer")
111+
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
112+
set(CPACK_DEBIAN_PACKAGE_DEPENDS
113+
"libgl1, libx11-6, libxrandr2, libxinerama1, libxcursor1, libxi6")
114+
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
115+
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
116+
if(DEFINED MAVSIM_VERSION)
117+
set(CPACK_PACKAGE_VERSION "${MAVSIM_VERSION}")
118+
endif()
119+
include(CPack)
106120
endif()

0 commit comments

Comments
 (0)