4242 include :
4343 - arch : amd64
4444 runner : ubuntu-24.04
45+ ros_distro : jazzy
46+ image : ros:jazzy-ros-base-noble
4547 - arch : arm64
4648 runner : ubuntu-24.04-arm
49+ ros_distro : jazzy
50+ image : ros:jazzy-ros-base-noble
51+ container :
52+ image : ${{ matrix.image }}
4753
4854 steps :
4955 - name : Checkout repository
5763 env :
5864 INPUT_TAG : ${{ github.event.inputs.tag }}
5965 INPUT_ROS_DISTRO : ${{ github.event.inputs.ros_distro }}
66+ MATRIX_ROS_DISTRO : ${{ matrix.ros_distro }}
6067 DEB_ARCH : ${{ matrix.arch }}
6168 run : |
6269 set -eo pipefail
7380 tag="v${tag}"
7481 fi
7582
76- ros_distro="${INPUT_ROS_DISTRO:-$DEFAULT_ROS_DISTRO }"
77- if [[ "${ros_distro}" != "${DEFAULT_ROS_DISTRO }" ]]; then
78- echo "This workflow currently supports only ROS 2 ${DEFAULT_ROS_DISTRO }." >&2
83+ ros_distro="${INPUT_ROS_DISTRO:-$MATRIX_ROS_DISTRO }"
84+ if [[ "${ros_distro}" != "${MATRIX_ROS_DISTRO }" ]]; then
85+ echo "This containerized deb workflow currently supports only ROS 2 ${MATRIX_ROS_DISTRO }." >&2
7986 echo "Requested: ${ros_distro}" >&2
8087 exit 1
8188 fi
@@ -105,24 +112,13 @@ jobs:
105112 exit 1
106113 fi
107114
108- - name : Install ROS and build tools
115+ - name : Install build tools
109116 shell : bash
110117 run : |
111118 set -eo pipefail
112119
113- sudo apt-get update
114- sudo apt-get install -y curl gnupg lsb-release software-properties-common
115- sudo add-apt-repository universe
116-
117- sudo mkdir -p /etc/apt/keyrings
118- curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
119- | sudo gpg --dearmor -o /etc/apt/keyrings/ros-archive-keyring.gpg
120-
121- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME}") main" \
122- | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
123-
124- sudo apt-get update
125- sudo apt-get install -y \
120+ apt-get update
121+ apt-get install -y \
126122 python3-rosdep \
127123 python3-colcon-core \
128124 python3-colcon-common-extensions \
@@ -136,10 +132,9 @@ jobs:
136132 cmake \
137133 ros-${{ steps.meta.outputs.ros_distro }}-ament-cmake \
138134 ros-${{ steps.meta.outputs.ros_distro }}-ament-cmake-core \
139- ros-${{ steps.meta.outputs.ros_distro }}-ament-package \
140- ros-${{ steps.meta.outputs.ros_distro }}-ros-base
135+ ros-${{ steps.meta.outputs.ros_distro }}-ament-package
141136
142- sudo rosdep init || true
137+ rosdep init || true
143138 rosdep update
144139
145140 source "/opt/ros/${{ steps.meta.outputs.ros_distro }}/setup.bash"
@@ -323,13 +318,14 @@ jobs:
323318 set -eo pipefail
324319
325320 ls -lh *.deb
326- if ! gh release view "$TAG" > /dev/null 2>&1; then
321+ if ! gh release view "$TAG" --repo "${GITHUB_REPOSITORY}" > /dev/null 2>&1; then
327322 gh release create "$TAG" \
323+ --repo "${GITHUB_REPOSITORY}" \
328324 --title "$TAG" \
329325 --notes "Automated release for Debian packages."
330326 fi
331327
332- gh release upload "$TAG" ./*.deb --clobber
328+ gh release upload "$TAG" ./*.deb --repo "${GITHUB_REPOSITORY}" -- clobber
333329
334330 verify_common_deb :
335331 name : verify common deb (${{ matrix.arch }})
@@ -341,8 +337,12 @@ jobs:
341337 include :
342338 - arch : amd64
343339 runner : ubuntu-24.04
340+ image : ros:jazzy-ros-base-noble
344341 - arch : arm64
345342 runner : ubuntu-24.04-arm
343+ image : ros:jazzy-ros-base-noble
344+ container :
345+ image : ${{ matrix.image }}
346346
347347 steps :
348348 - name : Resolve verify metadata
@@ -360,24 +360,23 @@ jobs:
360360 echo "ros_distro=${ROS_DISTRO}" >> "$GITHUB_OUTPUT"
361361 echo "deb_file=${DEB_FILE_PREFIX}_${VERSION}_${DEB_ARCH}.deb" >> "$GITHUB_OUTPUT"
362362
363- - name : Install ROS and base tools
363+ - name : Install verification tools
364364 shell : bash
365365 run : |
366366 set -eo pipefail
367367
368- sudo apt-get update
369- sudo apt-get install -y curl gnupg lsb-release software-properties-common cmake build-essential
370- sudo add-apt-repository universe
371-
372- sudo mkdir -p /etc/apt/keyrings
373- curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key \
374- | sudo gpg --dearmor -o /etc/apt/keyrings/ros-archive-keyring.gpg
368+ apt-get update
369+ apt-get install -y ca-certificates curl cmake build-essential
375370
376- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME}") main" \
377- | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
371+ mkdir -p -m 755 /etc/apt/keyrings
372+ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
373+ -o /etc/apt/keyrings/githubcli-archive-keyring.gpg
374+ chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
375+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
376+ > /etc/apt/sources.list.d/github-cli.list
378377
379- sudo apt-get update
380- sudo apt-get install -y "ros-${{ steps.meta.outputs.ros_distro }}-ros-base"
378+ apt-get update
379+ apt-get install -y gh
381380
382381 - name : Download deb from release
383382 env :
@@ -418,7 +417,7 @@ jobs:
418417 deb_file="${{ steps.meta.outputs.deb_file }}"
419418 ros_distro="${{ steps.meta.outputs.ros_distro }}"
420419
421- sudo dpkg -i "./${deb_file}" || sudo apt-get -f install -y
420+ dpkg -i "./${deb_file}" || apt-get -f install -y
422421
423422 set +u
424423 source "/opt/ros/${ros_distro}/setup.bash"
0 commit comments