From c1a8f14cbc922d8f2541531cccb31d701318ce7e Mon Sep 17 00:00:00 2001 From: Tenzin Platter <143778894+TenzinPlatter@users.noreply.github.com> Date: Mon, 8 Dec 2025 16:24:14 +1100 Subject: [PATCH 1/2] ci: update to kilted --- .github/workflows/release.yml | 80 +++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99f63bc..34d8f8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,34 +1,68 @@ name: Tag & Release - on: workflow_dispatch: + inputs: + build_kilted: + type: boolean + default: true + description: "Release for Kilted" + build_jazzy: + type: boolean + default: true + description: "Release for Jazzy" jobs: - release: + setup: + runs-on: ubuntu-latest + outputs: + distros: ${{ steps.set-distros.outputs.distros }} + steps: + - id: set-distros + run: | + distros=() + [ "${{ github.event.inputs.build_jazzy }}" == "true" ] && distros+=("jazzy") + [ "${{ github.event.inputs.build_kilted }}" == "true" ] && distros+=("kilted") + + if [ ${#distros[@]} -eq 0 ]; then + echo "::error::No distros selected. Please enable release for at least one of the available distros." + exit 1 + fi + + echo "distros=$(jq -cn '$ARGS.positional' --args "${distros[@]}")" >> $GITHUB_OUTPUT + build: + needs: setup strategy: fail-fast: true matrix: + distro: ${{ fromJson(needs.setup.outputs.distros) }} job: - - runner: buildjet-4vcpu-ubuntu-2204 - arch: amd64 - ros_distro: iron - github_release: true - - runner: buildjet-4vcpu-ubuntu-2204-arm - arch: arm64 - ros_distro: iron - github_release: false - - runner: buildjet-4vcpu-ubuntu-2204 + - runner: 4vcpu-ubuntu-2404 arch: amd64 - ros_distro: jazzy - github_release: false - - runner: buildjet-4vcpu-ubuntu-2204-arm + - runner: 4vcpu-ubuntu-2404-arm arch: arm64 - ros_distro: jazzy - github_release: false + name: Build - ${{ matrix.job.arch }} - ${{ matrix.distro }} + runs-on: ${{ matrix.job.runner }} + + steps: + - name: Checkout this repository + uses: actions/checkout@v4 - name: Release - ${{ matrix.job.arch }} - runs-on: ${{matrix.job.runner}}} + - name: Semantic release - Build + uses: Greenroom-Robotics/ros_semantic_release_action@main + with: + token: ${{ secrets.API_TOKEN_GITHUB }} + arch: ${{ matrix.job.arch }} + ros_distro: ${{ matrix.distro }} + github_release: false + public: false + changelog: false + skip_build: false + skip_tag: true + release: + name: Create Release + needs: build + runs-on: 2vcpu-ubuntu-2404 steps: - name: Checkout this repository uses: actions/checkout@v3 @@ -37,8 +71,8 @@ jobs: uses: Greenroom-Robotics/ros_semantic_release_action@main with: token: ${{ secrets.API_TOKEN_GITHUB }} - arch: ${{ matrix.job.arch }} - ros_distro: ${{ matrix.job.ros_distro }} - github_release: ${{ matrix.job.github_release }} - public: true - changelog: false \ No newline at end of file + github_release: true + public: false + changelog: false + skip_build: true + skip_tag: false From c44450b200fea50a8222e1af13ddd3a4bd37bb29 Mon Sep 17 00:00:00 2001 From: Tenzin Platter <143778894+TenzinPlatter@users.noreply.github.com> Date: Tue, 9 Dec 2025 10:02:53 +1100 Subject: [PATCH 2/2] chore: add dockerfile --- Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2707e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +ARG ROS_DISTRO=jazzy +FROM ghcr.io/greenroom-robotics/ros_builder:${ROS_DISTRO}-latest + +# Create the package_manifests by deleting everything other than package.xml +WORKDIR /package_manifests +COPY ./ ./ +RUN sudo chown ros:ros . +RUN sudo find . -regextype egrep -not -regex '.*/(package\.xml)$' -type f -delete +RUN sudo find . -type d -empty -delete + +FROM ghcr.io/greenroom-robotics/ros_builder:${ROS_DISTRO}-latest + +ARG API_TOKEN_GITHUB +ARG PACKAGE_NAME +ARG PLATFORM_MODULE="xtypes" + +LABEL org.opencontainers.image.source=https://github.com/Greenroom-Robotics/${PLATFORM_MODULE} + +ENV API_TOKEN_GITHUB=$API_TOKEN_GITHUB +ENV PLATFORM_MODULE=$PLATFORM_MODULE + +RUN sudo mkdir /opt/greenroom && sudo chown ros:ros /opt/greenroom +RUN --mount=type=cache,target=/home/ros/.cache/pip,sharing=locked \ + sudo chown -R ros:ros /home/ros/.cache/pip +RUN pip install git+https://github.com/Greenroom-Robotics/platform_cli.git@main + +WORKDIR /home/package_manifests +RUN platform pkg setup +COPY --from=0 /package_manifests . +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + platform pkg install-deps --package=${PACKAGE_NAME} + +WORKDIR /home/ros/${PLATFORM_MODULE} + +COPY ./ ./ +RUN sudo chown -R ros:ros /home/ros/${PLATFORM_MODULE} +RUN --mount=type=cache,target=/home/ros/.cache/pip,sharing=locked \ + platform poetry install +RUN source ${ROS_OVERLAY}/setup.sh && platform ros build --package=${PACKAGE_NAME} +RUN --mount=type=cache,target=/home/ros/.cache/pip,sharing=locked \ + platform ros install_poetry_deps + +ENV ROS_OVERLAY /opt/greenroom/${PLATFORM_MODULE} +RUN echo 'source ${ROS_OVERLAY}/setup.sh' >> ~/.profile + +CMD tail -f /dev/null