diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d06509..abac038 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,23 +13,18 @@ jobs: strategy: fail-fast: false matrix: - include: - - source_tag: focal - target_tag: focal - ros_version: ros - - source_tag: jammy - target_tag: jammy - ros_version: ros2 - - source_tag: noble - target_tag: noble - ros_version: ros2 - - source_tag: noble - target_tag: noble-testing - ros_version: ros2-testing - name: "ubuntu-${{ matrix.target_tag }}" + platform: [linux/amd64, linux/arm64] + base_image_tag: [focal, jammy, noble] + ros_testing: [false, true] + exclude: + - base_image_tag: focal + ros_testing: true + - base_image_tag: jammy + ros_testing: true + name: "ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing' || ''}} ${{ matrix.platform }}" # always use latest linux worker, as it should not have any impact # when it comes to building docker images. - runs-on: ubuntu-latest + runs-on: ubuntu-24.04${{ matrix.platform == 'linux/arm64' && '-arm' || '' }} steps: - name: Checkout repository @@ -55,19 +50,20 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64,linux/arm64 + platforms: "${{ matrix.platform }}" push: ${{ github.event_name != 'pull_request' }} build-args: | BASE_IMAGE_NAME=ubuntu - BASE_IMAGE_TAG=${{ matrix.source_tag }} + BASE_IMAGE_TAG=${{ matrix.base_image_tag }} VCS_REF=${{ github.sha }} ROS_DISTRO=none - ROS_VERSION=${{ matrix.ros_version }} + ROS_TESTING=${{ matrix.ros_testing && 'true' || '' }} tags: | - rostooling/setup-ros-docker:ubuntu-${{ matrix.target_tag }}-latest - ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.target_tag }}:latest + rostooling/setup-ros-docker:ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing' || ''}}-latest + ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.base_image_tag }}${{ matrix.ros_testing && '-testing' || ''}}:latest ros_variant: + if: false strategy: fail-fast: false matrix: diff --git a/Dockerfile b/Dockerfile index 227d1fe..b897796 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ ARG VCS_REF # The ROS distribution being targeted by this image ARG ROS_DISTRO -# Override default APT sources, "ros", "ros2, or "ros2-testing" -ARG ROS_VERSION='' +# Use ros testing apt repositories instead of main +ARG ROS_TESTING='' # Additional APT packages to be installed # diff --git a/setup-ros.sh b/setup-ros.sh index 810e59b..2cd9e38 100755 --- a/setup-ros.sh +++ b/setup-ros.sh @@ -35,17 +35,18 @@ curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr RTI_CONNEXT_DDS="" -if [ -z $ROS_VERSION ]; then - ROS_VERSION='ros2' - case ${ROS_DISTRO} in - "noetic") - ROS_VERSION="ros" - ;; - *) - RTI_CONNEXT_DDS="rti-connext-dds-6.0.1" - ROS_VERSION="ros2" - ;; - esac +ROS_VERSION='ros2' +case ${ROS_DISTRO} in + "noetic") + ROS_VERSION="ros" + ;; + *) + RTI_CONNEXT_DDS="rti-connext-dds-6.0.1" + ROS_VERSION="ros2" + ;; +esac +if [ "${ROS_TESTING}" = "true" ]; then + ROS_VERSION="${ROS_VERSION}-testing" fi echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/${ROS_VERSION}/ubuntu $(lsb_release -sc) main" |\