Skip to content

Commit

Permalink
Merge pull request #38 from umdlife/feat/build-debians
Browse files Browse the repository at this point in the history
CI Debian build
  • Loading branch information
biancabnd authored Jan 15, 2024
2 parents 178c1f3 + 8dab14a commit e0b7202
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/upload-debians.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions debian/50-my-packages.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yaml file:///rosdep.yaml
66 changes: 66 additions & 0 deletions debian/create_debians.sh
Original file line number Diff line number Diff line change
@@ -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!"
4 changes: 4 additions & 0 deletions debian/rosdep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
psdk_wrapper:
ubuntu: [ros-humble-psdk-wrapper]
psdk_interfaces:
ubuntu: [ros-humble-psdk-interfaces]
13 changes: 10 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
exhale
sphinx==4.5.0
breathe==4.32.0
exhale==0.3.6
myst_parser
breathe
sphinx_rtd_theme
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

0 comments on commit e0b7202

Please sign in to comment.