diff --git a/.github/workflows/upload-debians.yaml b/.github/workflows/upload-debians.yaml new file mode 100644 index 00000000..bc552052 --- /dev/null +++ b/.github/workflows/upload-debians.yaml @@ -0,0 +1,30 @@ +name: Build Debians +on: + push: + tags: + - 'v*' + +jobs: + build_debians: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: psdk_ros2 + - uses: actions/checkout@v4 + with: + repository: dji-sdk/Payload-SDK + ref: 3.5 + path: Payload-SDK + - name: ROS 2 Build Debian Package + id: build + run: | + mv psdk_ros2/debian/create_debians.sh . + sudo ./create_debians.sh + ls . + - uses: d1ceward/draft-assets-release-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: | + ${{ steps.build.outputs.INTERFACES_DEB }} + ${{ steps.build.outputs.WRAPPER_DEB }} diff --git a/debian/50-my-packages.list b/debian/50-my-packages.list new file mode 100644 index 00000000..93e95b82 --- /dev/null +++ b/debian/50-my-packages.list @@ -0,0 +1 @@ +yaml file:///rosdep.yaml diff --git a/debian/create_debians.sh b/debian/create_debians.sh new file mode 100755 index 00000000..9a2388a5 --- /dev/null +++ b/debian/create_debians.sh @@ -0,0 +1,66 @@ +#!/bin/bash +locale # check for UTF-8 + +apt update && apt install locales +locale-gen en_US en_US.UTF-8 +update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +export LANG=en_US.UTF-8 + +apt install software-properties-common +add-apt-repository universe + +apt update && apt install curl -y +curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null + + +apt update +apt install -y --no-install-recommends python3-pip python3-bloom python3-catkin-pkg dpkg-dev debhelper dh-python libopus-dev ffmpeg libavcodec-dev libavformat-dev libavfilter-dev libusb-1.0-0-dev +ln -snf /usr/lib/x86_64-linux-gnu/libopus.a /usr/local/lib +pip3 install rosdep +rosdep init +mv psdk_ros2/debian/50-my-packages.list /etc/ros/rosdep/sources.list.d +mv psdk_ros2/debian/rosdep.yaml / + +# store the current dir +CUR_DIR=$(pwd) + +# Update ROS deps +rosdep update + +rosdep keys --from-paths . --ignore-src --rosdistro humble | \ + xargs rosdep resolve --rosdistro humble | \ + awk '/#apt/{getline; print}' > ./rosdep_requirements.txt +apt install -y --no-install-recommends $(cat ./rosdep_requirements.txt) + +PACKAGE_LIST=( + psdk_ros2/psdk_interfaces \ + psdk_ros2/psdk_wrapper +) + +for PACKAGE in ${PACKAGE_LIST[@]}; do + echo "" + echo "Creating debian for $PACKAGE..." + + # We have to go to the ROS package parent directory + cd $PACKAGE; + bloom-generate rosdebian --ros-distro humble + debian/rules "binary --parallel --dpkg-shlibdeps-params=--ignore-missing-info" + + cd .. + DEB_FILE=$(find *.deb); + if ! [[ $? -eq 0 ]]; then + exit 1 + fi + dpkg -i $DEB_FILE + cp $DEB_FILE $CUR_DIR + rm *.deb *.ddeb + cd $CUR_DIR + +done + +echo "INTERFACES_DEB=$(find *interfaces*.deb)" >> $GITHUB_OUTPUT +echo "WRAPPER_DEB=$(find *wrapper*.deb)" >> $GITHUB_OUTPUT + +echo "Complete!" diff --git a/debian/rosdep.yaml b/debian/rosdep.yaml new file mode 100644 index 00000000..0b2e9b39 --- /dev/null +++ b/debian/rosdep.yaml @@ -0,0 +1,4 @@ +psdk_wrapper: + ubuntu: [ros-humble-psdk-wrapper] +psdk_interfaces: + ubuntu: [ros-humble-psdk-interfaces] diff --git a/docs/requirements.txt b/docs/requirements.txt index 2575df69..9d324a65 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,11 @@ -exhale +sphinx==4.5.0 +breathe==4.32.0 +exhale==0.3.6 myst_parser -breathe -sphinx_rtd_theme \ No newline at end of file +sphinx_rtd_theme +sphinxcontrib-applehelp<=1.0.7 +sphinxcontrib-devhelp<=1.0.5 +sphinxcontrib-jsmath<=1.0.1 +sphinxcontrib_htmlhelp<=2.0.4 +sphinxcontrib-serializinghtml<=1.1.9 +sphinxcontrib-qthelp<=1.0.6