Skip to content

Commit d0c5a36

Browse files
committed
do ros setup in the build_debians script
1 parent a93374c commit d0c5a36

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/debian-packages.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,6 @@ jobs:
8181
- name: Checkout code
8282
uses: actions/checkout@v4
8383

84-
- name: Setup ROS repository
85-
run: |
86-
apt-get update -qq
87-
apt-get install -y curl gnupg lsb-release
88-
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
89-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list
90-
apt-get update -qq
91-
shell: bash
92-
env:
93-
DEBIAN_FRONTEND: noninteractive
94-
9584
- name: Build Debian packages
9685
run: |
9786
chmod +x scripts/build_debian_packages.sh

scripts/build_debian_packages.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,23 @@ if [ ! -f "/.dockerenv" ] && [ ! -f "/run/.containerenv" ]; then
8282
read -r
8383
fi
8484

85+
# Setup ROS repository if not already configured
86+
echo "Setting up ROS repository..."
87+
export DEBIAN_FRONTEND=noninteractive
88+
apt-get update -qq
89+
apt-get install -y curl gnupg lsb-release
90+
91+
if [ ! -f "/etc/apt/sources.list.d/ros2.list" ]; then
92+
echo "Adding ROS 2 apt repository..."
93+
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
94+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list
95+
apt-get update -qq
96+
else
97+
echo "ROS 2 repository already configured"
98+
fi
99+
85100
# Install dependencies
86101
echo "Installing build dependencies..."
87-
apt-get update -qq
88102

89103
# Check if we need --break-system-packages for pip
90104
USE_BREAK_SYSTEM_PACKAGES=""
@@ -93,8 +107,7 @@ if [[ "$ROS_DISTRO" == "jazzy" || "$ROS_DISTRO" == "kilted" || "$ROS_DISTRO" ==
93107
fi
94108

95109
# Install system dependencies
96-
export DEBIAN_FRONTEND=noninteractive
97-
apt-get install -y build-essential python3-pip python3-bloom python3-rosdep git lsb-release devscripts debhelper fakeroot python3-colcon-common-extensions cmake
110+
apt-get install -y build-essential python3-pip python3-bloom python3-rosdep git devscripts debhelper fakeroot python3-colcon-common-extensions cmake
98111

99112
# Install Python dependencies
100113
if [ -f "requirements.txt" ]; then

0 commit comments

Comments
 (0)