Skip to content

Fix: Ardupilot needs to be in offboard/guided mode for goto_location() #3406

Fix: Ardupilot needs to be in offboard/guided mode for goto_location()

Fix: Ardupilot needs to be in offboard/guided mode for goto_location() #3406

Workflow file for this run

name: Build and Test
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
coverage:
name: coverage (ubuntu-20.04)
runs-on: ubuntu-20.04
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ./build/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/third_party/install" >> $GITHUB_ENV
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y lcov python3-future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Coverage -DASAN=ON -DWERROR=OFF -Bbuild -H.
- name: build
run: cmake --build build -j2
- name: unit tests
run: ./build/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/src/system_tests/system_tests_runner
- name: run lcov
run: lcov --capture --directory . --no-external --exclude "*/third_party/*" --output-file lcov.info
- name: check size of lcov.info
run: |
ls -l lcov.info
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./lcov.info"
ubuntu20-non-superbuild:
name: ubuntu-20.04 (non-mavsdk_server, non-superbuild)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install
run: sudo apt-get update && sudo apt-get install -y libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev
- name: install mavlink on the system
run: |
cmake -Bthird_party/mavlink/build -Sthird_party/mavlink
sudo cmake --build third_party/mavlink/build
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DSUPERBUILD=OFF -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release -j2
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
ubuntu-superbuild:
name: ${{ matrix.ubuntu_image }} (mavsdk_server, superbuild)
runs-on: ${{ matrix.ubuntu_image }}
strategy:
matrix:
ubuntu_image: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ matrix.ubuntu_image }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release -j2
- name: install
run: sudo cmake --build build/release --target install
- name: temporary workaround for Ubuntu 22.04
if: ${{ matrix.ubuntu_image }} == "ubuntu-22.04"
run: |
echo 'APT::Get::Always-Include-Phased-Updates "true";' | sudo tee -a /etc/apt/apt.conf.d/99-phased-updates
sudo apt-get update
- name: install examples dependencies
run: sudo apt-get install libsdl2-dev
- name: configure examples
run: cmake -DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install -DCMAKE_BUILD_TYPE=Release -DWERROR=OFF -Bexamples/build -Hexamples
- name: build examples
run: cmake --build examples/build -j2
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
ubuntu20-hunter:
name: ubuntu-20.04 (mavsdk, hunter)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ~/.hunter
key: ${{ github.job }}-${{ hashFiles('~/.hunter/**') }}
- name: install mavlink on the system
run: |
cmake -Bthird_party/mavlink/build -Sthird_party/mavlink
sudo cmake --build third_party/mavlink/build
- name: configure
run: cmake -DSUPERBUILD=OFF -DHUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=$(pwd)/src/cmake/fpic_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=OFF -Bbuild -H.
- name: build
run: cmake --build build -j2
- name: unit tests
run: ./build/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/src/system_tests/system_tests_runner
ubuntu20-proto-check:
name: ubuntu-22.04 (proto check)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y clang-format-12
- uses: actions/cache@v3
id: cache
with:
path: ./build/default/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/default/third_party/install" >> $GITHUB_ENV
- name: build necessary protoc tooling
run: cmake $superbuild $cmake_prefix_path -DBUILD_MAVSDK_SERVER=ON -Bbuild/default -H.
- name: generate code from protos
run: PATH="$PATH:$HOME/.local/bin" tools/generate_from_protos.sh
- name: fix style
run: tools/fix_style.sh . || true
- name: check for diff
run: git diff --exit-code
ubuntu20-check-style:
name: ubuntu-22.04 (check style and docs)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y doxygen clang-format-12
- name: check style
run: ./tools/fix_style.sh .
- name: check docs
run: tools/generate_docs.sh
deb-package:
name: ${{ matrix.container_name }} (package, non-mavsdk_server)
runs-on: ubuntu-20.04
container: mavsdk/mavsdk-${{ matrix.container_name }}
strategy:
matrix:
container_name: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release --target install -- -j2
- name: Package
if: startsWith(github.ref, 'refs/tags/v')
run: tools/create_packages.sh ./install . amd64 libmavsdk-dev
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: '*.deb'
tag: ${{ github.ref }}
overwrite: true
debian-packaging:
name: Ubuntu/Debian packaging (Ubuntu 20.04)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: install packages
run: sudo apt-get update && sudo apt-get install -y build-essential debhelper fakeroot libjsoncpp-dev libcurl4-openssl-dev libtinyxml2-dev libjsoncpp1 libcurl4 libtinyxml2-6a
- name: install mavlink on the system
run: |
cmake -Bthird_party/mavlink/build -Sthird_party/mavlink
sudo cmake --build third_party/mavlink/build
- name: generate changelog
run: ./tools/generate_debian_changelog.sh > debian/changelog
- name: Build package
run: dpkg-buildpackage -us -uc -b
rpm-package:
name: ${{ matrix.container_name }} (package, non-mavsdk_server)
runs-on: ubuntu-20.04
container: mavsdk/mavsdk-${{ matrix.container_name }}
strategy:
matrix:
container_name: [fedora-34, fedora-35, fedora-36]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- name: install dependencies
run: yum -y install perl-IPC-Cmd perl-Pod-Html
- name: configure
run: cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release --target install -- -j2
- name: Package
if: startsWith(github.ref, 'refs/tags/v')
run: tools/create_packages.sh ./install . x86_64 mavsdk-devel
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: '*.rpm'
tag: ${{ github.ref }}
overwrite: true
dockcross-linux-arm:
name: linux-${{ matrix.arch_name }}
runs-on: ubuntu-20.04
strategy:
matrix:
arch_name: [armv6, armv7, arm64]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup dockcross
run: docker run --rm mavsdk/mavsdk-dockcross-linux-${{ matrix.arch_name }}-custom > ./dockcross-linux-${{ matrix.arch_name }}-custom; chmod +x ./dockcross-linux-${{ matrix.arch_name }}-custom
- uses: actions/cache@v3
id: cache
with:
path: ./build/linux-${{ matrix.arch_name }}/third_party/install
key: ${{ github.job }}-linux-${{ matrix.arch_name }}-${{ hashFiles('./third_party/**') }}-4
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/linux-${{ matrix.arch_name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-linux-${{ matrix.arch_name }}-custom /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/linux-${{ matrix.arch_name }}/install -DBUILD_MAVSDK_SERVER=OFF -DBUILD_SHARED_LIBS=ON -DWERROR=OFF -Bbuild/linux-${{ matrix.arch_name }} -H."
- name: build
run: ./dockcross-linux-${{ matrix.arch_name }}-custom cmake --build build/linux-${{ matrix.arch_name }} -j2 --target install
- name: create deb packages
run: ./dockcross-linux-${{ matrix.arch_name }}-custom tools/create_packages.sh ./build/linux-${{ matrix.arch_name }}/install . ${{ matrix.arch_name }} libmavsdk-dev
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: '*.deb'
tag: ${{ github.ref }}
overwrite: true
alpine-linux:
name: alpine 3.16.0 (musl)
runs-on: ubuntu-20.04
container: alpine:3.16.0
steps:
- name: install tools
run: apk update && apk add build-base cmake git linux-headers perl tar python3 py3-pip
- uses: actions/checkout@v3
with:
submodules: recursive
- name: git permission workaround
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --global --add safe.directory /github/workspace
- uses: actions/cache@v3
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DCMAKE_INSTALL_PREFIX=install -DWERROR=OFF -Bbuild/release -H.
- name: build
run: cmake --build build/release --target install -- -j2
- name: unit tests
run: ./build/release/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/release/src/system_tests/system_tests_runner
- name: test (mavsdk_server)
run: ./build/release/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: Upload as artefact
uses: actions/upload-artifact@v3
with:
name: mavsdk_server_musl_x86_64
path: ./install/bin/mavsdk_server
retention-days: 2
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'install/bin/mavsdk_server'
asset_name: 'mavsdk_server_musl_x86_64'
tag: ${{ github.ref }}
overwrite: true
dockcross-linux-musl:
name: ${{ matrix.arch_name }}
runs-on: ubuntu-20.04
strategy:
matrix:
arch_name: [linux-armv6-musl, linux-armv7l-musl, linux-arm64-musl]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup dockcross
run: docker run --rm dockcross/${{ matrix.arch_name }} > ./dockcross-${{ matrix.arch_name }}; chmod +x ./dockcross-${{ matrix.arch_name }}
- uses: actions/cache@v3
id: cache
with:
path: ./build/${{ matrix.arch_name }}/third_party/install
key: ${{ github.job }}-${{ matrix.arch_name }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/${{ matrix.arch_name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-${{ matrix.arch_name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/${{ matrix.arch_name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_MAVSDK_SERVER=ON -DWERROR=OFF -Bbuild/${{ matrix.arch_name }} -H."
- name: build
run: ./dockcross-${{ matrix.arch_name }} cmake --build build/${{ matrix.arch_name }} -j2 --target install
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/${{ matrix.arch_name }}/install/bin/mavsdk_server'
asset_name: 'mavsdk_server_${{ matrix.arch_name }}'
tag: ${{ github.ref }}
overwrite: true
dockcross-android:
name: ${{ matrix.name }}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- name: android-arm
arch: armeabi-v7a
- name: android-arm64
arch: arm64-v8a
- name: android-x86
arch: x86
- name: android-x86_64
arch: x86_64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup dockcross
run: docker run --rm dockcross/${{ matrix.name }} > ./dockcross-${{ matrix.name }}; chmod +x ./dockcross-${{ matrix.name }}
- uses: actions/cache@v3
id: cache
with:
path: ./build/${{ matrix.name }}/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=/work/build/${{ matrix.name }}/third_party/install" >> $GITHUB_ENV
- name: configure
run: ./dockcross-${{ matrix.name }} /bin/bash -c "cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/${{ matrix.name }}/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/${{ matrix.name }} -H."
- name: build
run: ./dockcross-${{ matrix.name }} cmake --build build/${{ matrix.name }} -j2 --target install
- name: create tar with header and library
run: mkdir -p build/${{ matrix.name }}/export/include; cp build/${{ matrix.name }}/install/include/mavsdk/mavsdk_server/mavsdk_server_api.h build/${{ matrix.name }}/export/include; mkdir -p build/${{ matrix.name }}/export/${{ matrix.arch }}; cp build/${{ matrix.name }}/install/lib/libmavsdk_server.so build/${{ matrix.name }}/export/${{ matrix.arch }}; tar -C build/${{ matrix.name }}/export -cf build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar ${{ matrix.arch }} include;
- name: Publish artefacts
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/${{ matrix.name }}/export/mavsdk_server_${{ matrix.name }}.tar'
asset_name: 'mavsdk_server_${{ matrix.name }}.tar'
tag: ${{ github.ref }}
overwrite: true
macOS:
name: ${{ matrix.name }}
runs-on: macos-12
strategy:
matrix:
include:
- name: macOS
build-framework: OFF
- name: macOS-framework
build-framework: ON
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v3
id: cache
with:
path: ./build/macos/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/macos/third_party/install" >> $GITHUB_ENV
- name: set SDKROOT value
run: echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
- name: configure
run: cmake $superbuild $cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/macos/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DMACOS_FRAMEWORK=${{ matrix.build-framework }} -DWERROR=OFF -Bbuild/macos -H.
- name: build
run: cmake --build build/macos -j2 --target install
- name: unit tests
run: ./build/macos/src/unit_tests/unit_tests_runner
- name: system tests
run: ./build/macos/src/system_tests/system_tests_runner
- name: test (mavsdk_server)
run: ./build/macos/src/mavsdk_server/test/unit_tests_mavsdk_server
- name: Upload framework as artefact
if: ${{ matrix.build-framework == 'ON' }}
uses: actions/upload-artifact@v3
with:
name: mavsdk_server_macos.framework
path: ./build/macos/src/mavsdk_server/src/mavsdk_server.framework
retention-days: 2
- name: Publish mavsdk_server_macos to github release
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.build-framework == 'OFF' }}
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/macos/install/bin/mavsdk_server'
asset_name: 'mavsdk_server_macos'
tag: ${{ github.ref }}
overwrite: true
iOS:
name: ${{ matrix.name }}
runs-on: macos-12
strategy:
matrix:
include:
- name: ios
platform: OS64
sdk: iphoneos
- name: ios_simulator
platform: SIMULATOR64
sdk: iphonesimulator
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v3
id: cache
with:
path: ./build/${{ matrix.name }}/third_party/install
key: ${{ github.job }}-${{ matrix.name }}-${{ hashFiles('./third_party/**', './tools/ios.toolchain.cmake') }}
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "superbuild=-DSUPERBUILD=OFF" >> $GITHUB_ENV && echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/${{ matrix.name }}/third_party/install" >> $GITHUB_ENV
- name: set SDK-related environment variables (for non-cmake deps)
run: |
echo "SDKROOT=$(xcrun --sdk ${{ matrix.sdk }} --show-sdk-path)" >> $GITHUB_ENV
- name: install pymavlink dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install wheel
python3 -m pip install future
- name: configure
run: cmake $superbuild $cmake_prefix_path -DENABLE_STRICT_TRY_COMPILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(pwd)/tools/ios.toolchain.cmake -DENABLE_BITCODE=Off -DPLATFORM=${{ matrix.platform }} -DDEPLOYMENT_TARGET=14.0 -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/${{ matrix.name }} -H.
- name: build
run: cmake --build build/${{ matrix.name }} -j2
- uses: actions/upload-artifact@v3
with:
name: mavsdk_server_${{ matrix.name }}.framework
path: ./build/${{ matrix.name }}/src/mavsdk_server/src/mavsdk_server.framework
retention-days: 2
iOS-XCFramework:
name: iOS XCFramework
needs: [macOS, iOS]
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: mavsdk_server_ios.framework
path: ./build/ios/src/mavsdk_server/src/mavsdk_server.framework
- uses: actions/download-artifact@v3
with:
name: mavsdk_server_ios_simulator.framework
path: ./build/ios_simulator/src/mavsdk_server/src/mavsdk_server.framework
- uses: actions/download-artifact@v3
with:
name: mavsdk_server_macos.framework
path: ./build/macos/src/mavsdk_server/src/mavsdk_server.framework
- name: Package
run: bash ./src/mavsdk_server/tools/package_mavsdk_server_framework.bash
- uses: actions/upload-artifact@v3
with:
name: mavsdk_server.xcframework
path: ./build/mavsdk_server.xcframework
retention-days: 2
- name: Publish xcframework
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/mavsdk_server.xcframework.zip'
asset_name: 'mavsdk_server.xcframework.zip'
tag: ${{ github.ref }}
overwrite: true
- name: Publish xcframework checksum
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/mavsdk_server.xcframework.zip.sha256'
asset_name: 'mavsdk_server.xcframework.zip.sha256'
tag: ${{ github.ref }}
overwrite: true
Windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: ./build/release/third_party/install
key: ${{ github.job }}-${{ hashFiles('./third_party/**') }}-2
- name: disable superbuild on cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: |
echo "superbuild=-DSUPERBUILD=OFF" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "cmake_prefix_path=-DCMAKE_PREFIX_PATH=$(pwd)/build/release/third_party/install" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: install packages
run: |
choco install nasm
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: configure
run: cmake -G "Visual Studio 17 2022" $env:superbuild $env:cmake_prefix_path -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/release/install -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DWERROR=OFF -Bbuild/release -S.
- name: build
run: cmake --build build/release -j2 --config Release --target install
- name: Create zip file mavsdk libraries
if: startsWith(github.ref, 'refs/tags/v')
run: cd build/release/install && 7z.exe a -tzip ../../../mavsdk-windows-x64-release.zip . && cd ../../..
- name: Publish mavsdk libraries
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'mavsdk-windows-x64-release.zip'
asset_name: 'mavsdk-windows-x64-release.zip'
tag: ${{ github.ref }}
overwrite: true
- name: Publish mavsdk_server binary
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'build/release/install/bin/mavsdk_server_bin.exe'
asset_name: 'mavsdk_server_win32.exe'
tag: ${{ github.ref }}
overwrite: true