Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 57 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
github_release: true
public: false
changelog: false
skip_build: true
skip_tag: false
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Loading