From 5c016e108dead8d1714de07462ea45915299da48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2?= Date: Wed, 30 Dec 2020 14:48:54 +0100 Subject: [PATCH] packets_creation: add the icub packet creation via gh action --- .ci/create_icub-common_deb.sh | 6 +- .ci/create_icub-main_deb.sh | 214 +++++++++++++++++++----- .ci/packages_vars.sh | 39 ++++- .github/workflows/ci.yml | 48 +++--- .github/workflows/packages_creation.yml | 118 +++++++------ 5 files changed, 303 insertions(+), 122 deletions(-) diff --git a/.ci/create_icub-common_deb.sh b/.ci/create_icub-common_deb.sh index b0ae782a03..e8f8bac738 100755 --- a/.ci/create_icub-common_deb.sh +++ b/.ci/create_icub-common_deb.sh @@ -185,10 +185,10 @@ fini() rm "$_CONTROL_FILE" fi - export ICUB_PACKAGE_NAME="icub-common_${ICUB_PACKAGE_VERSION}-${ICUB_DEBIAN_REVISION_NUMBER}~${PLATFORM_RELEASE}_${PLATFORM_HARDWARE}.deb" - echo $ICUB_PACKAGE_NAME > ICUB_PACKAGE_NAME.txt + export ICUB_COMMON_PACKAGE_NAME="icub-common_${ICUB_PACKAGE_VERSION}-${ICUB_DEBIAN_REVISION_NUMBER}~${PLATFORM_RELEASE}_${PLATFORM_HARDWARE}.deb" + echo $ICUB_COMMON_PACKAGE_NAME > ICUB_COMMON_PACKAGE_NAME.txt ls - log "${COL_OK}${ICUB_PACKAGE_NAME} CREATED" + log "${COL_OK}${ICUB_COMMON_PACKAGE_NAME} CREATED" } check_and_install_deps() diff --git a/.ci/create_icub-main_deb.sh b/.ci/create_icub-main_deb.sh index 70642b5e05..0a3ad8aa15 100644 --- a/.ci/create_icub-main_deb.sh +++ b/.ci/create_icub-main_deb.sh @@ -32,9 +32,12 @@ VARS_FILE="${SCRIPT_PATH}/packages_vars.sh" _WHO_AM_I=$(whoami) _EQUIVS_BIN=$(which equivs-build || true) _LSB_BIN=$(which lsb_release || true) -_PLATFORM_KEY="" +__PLATFORM_RELEASE="" _PLATFORM_HARDWARE="" _CONTROL_FILE="" +ICUB_SCRIPT_DIR=$(pwd) + + # ##################################################### print_defs () @@ -52,7 +55,7 @@ print_defs () echo " _WHO_AM_I is $_WHO_AM_I" echo " _EQUIVS_BIN is $_EQUIVS_BIN" echo " _LSB_BIN is $_LSB_BIN" - echo " _PLATFORM_KEY is $_PLATFORM_KEY" + echo " __PLATFORM_RELEASE is $__PLATFORM_RELEASE" echo " _PLATFORM_HARDWARE is $_PLATFORM_HARDWARE" echo " _CONTROL_FILE is $_CONTROL_FILE " } @@ -161,9 +164,9 @@ init() ;; esac - _CONTROL_FILE="icub-common.${_PLATFORM_RELEASE}-${PLATFORM_HARDWARE}.control" + _CONTROL_FILE="icub.${_PLATFORM_RELEASE}-${PLATFORM_HARDWARE}.control" - if [ "$PACKAGE_VERSION" == "" ]; then + if [ "$ICUB_PACKAGE_VERSION" == "" ]; then exit_err "Package version string is empty" fi @@ -179,16 +182,21 @@ init() exit_err "Distro $_PLATFORM_HARDWARE is not supported, we support only $SUPPORTED_TARGET_LIST" fi + if [ "$_WHO_AM_I" != "root" ]; then + sudo apt-get update + else + apt-get update + fi + log "$0 ${COL_OK}STARTED" } fini() { - if [ -f "$_CONTROL_FILE" ]; then - rm "$_CONTROL_FILE" - fi - - log "$0 ${COL_OK}ENDED" + echo $ICUB_MAIN_PACKAGE_NAME > ${ICUB_SCRIPT_DIR}/ICUB_MAIN_PACKAGE_NAME.txt + mv $ICUB_MAIN_PACKAGE_NAME ${ICUB_SCRIPT_DIR} + ls + log "${COL_OK}${ICUB_MAIN_PACKAGE_NAME} CREATED" } check_and_install_deps() @@ -196,14 +204,12 @@ check_and_install_deps() export DEBIAN_FRONTEND=noninteractive if [ "$_WHO_AM_I" != "root" ]; then - sudo apt-get update - else - apt-get update + export _SUDO=sudo fi if [ "$_LSB_BIN" == "" ]; then if [ "$_WHO_AM_I" != "root" ]; then log "installing lsb_release, so we may need your password" - sudo apt-get install -y lsb-release + $_SUDO apt-get install -y lsb-release else log "installing lsb_release" apt-get install -y lsb-release @@ -213,7 +219,7 @@ check_and_install_deps() if [ "$_EQUIVS_BIN" == "" ]; then if [ "$_WHO_AM_I" != "root" ]; then log "installing equivs, so we may need your password" - sudo apt-get install -y equivs + $_SUDO apt-get install -y equivs else log "installing equivs" apt-get install -y equivs @@ -222,45 +228,175 @@ check_and_install_deps() fi } -create_control_file() + +create_deb() { - _ICUB_COMMON_DEPENDENCIES="" - for dep in $ICUB_DEPS_COMMON ; do - if [ "$_ICUB_COMMON_DEPENDENCIES" == "" ]; then - _ICUB_COMMON_DEPENDENCIES="$dep" - else - _ICUB_COMMON_DEPENDENCIES="${_ICUB_COMMON_DEPENDENCIES}, $dep" - fi - done - _PLAT_DEPS_TAG="ICUB_DEPS_${_PLATFORM_RELEASE}" - for pdep in ${!_PLAT_DEPS_TAG} ; do - if [ "$_ICUB_COMMON_DEPENDENCIES" == "" ]; then - _ICUB_COMMON_DEPENDENCIES="$pdep" - else - _ICUB_COMMON_DEPENDENCIES="${_ICUB_COMMON_DEPENDENCIES}, $pdep" - fi - done - echo "Package: icub-common -Version: ${PACKAGE_VERSION}-${ICUB_DEBIAN_REVISION_NUMBER}~${_PLATFORM_RELEASE} + # Generate dpkg DEBIAN folder + mkdir -p ${D_ICUB_INSTALL_DIR}/DEBIAN + # Generate 'conffiles' file + touch ${D_ICUB_INSTALL_DIR}/DEBIAN/conffiles + + # Generate dpkg DEBIAN/control file + touch ${D_ICUB_INSTALL_DIR}/DEBIAN/control + mkdir -p ${D_ICUB_INSTALL_DIR}/usr/share/doc/icub + cp ${D_ICUB_ROOT}/COPYING ${D_ICUB_INSTALL_DIR}/usr/share/doc/icub/copyright + cp ${D_ICUB_ROOT}/AUTHORS ${D_ICUB_INSTALL_DIR}/usr/share/doc/icub/AUTHORS + touch ${D_ICUB_INSTALL_DIR}/DEBIAN/md5sums + + _CONTROL_FILE=${D_ICUB_INSTALL_DIR}/DEBIAN/control + + SIZE=$(du -s $D_ICUB_INSTALL_DIR/) + SIZE=$(echo $SIZE | awk '{ split($0, array, "/" ); print array[1] }') + echo "Size: $SIZE" + echo "Package: icub +Version: ${ICUB_PACKAGE_VERSION}-${ICUB_DEBIAN_REVISION_NUMBER}~${_PLATFORM_RELEASE} Section: contrib/science Priority: optional Architecture: $_PLATFORM_HARDWARE -Depends: $_ICUB_COMMON_DEPENDENCIES, cmake (>=${CMAKE_MIN_REQ_VER}) +Depends: icub-common (= ${ICUB_PACKAGE_VERSION}~${_PLATFORM_RELEASE}), yarp (>= ${YARP_REQUIRED_VERSION}) +Installed-Size: $SIZE Homepage: http://www.icub.org Maintainer: ${ICUB_PACKAGE_MAINTAINER} -Description: List of dependencies for iCub software (metapackage) - This metapackage lists all the dependencies needed to install the icub platform software or to download the source code and compile it directly onto your machine." | tee $_CONTROL_FILE +Description: Software platform for iCub humanoid robot with simulator. + The iCub is the humanoid robot developed as part of the European project + RobotCub and subsequently adopted by more than 20 laboratories worldwide. + It has 53 motors that move the head, arms & hands, waist, and legs. It can + see and hear, it has the sense of proprioception and movement. + . + This package provides the standard iCub software platform and apps to + interact with the real iCub robot, or with the included simulator." | tee $_CONTROL_FILE + + # Build package + export ICUB_MAIN_PACKAGE_NAME="iCub${ICUB_PACKAGE_VERSION}-${ICUB_DEBIAN_REVISION_NUMBER}~${_PLATFORM_RELEASE}.deb" + echo $ICUB_MAIN_PACKAGE_NAME + cd ${D_ICUB_INSTALL_DIR} && dpkg -b ${D_ICUB_INSTALL_DIR} $ICUB_MAIN_PACKAGE_NAME + if [ "$?" != "0" ]; then + echo "Error: unable to build the package" + exit 1 + fi } -create_deb() +install_deps() { - $_EQUIVS_BIN $_CONTROL_FILE + ###------------------- Handle cmake ----------------------### + echo "Installing CMAKE in the environment" + + if [ "$_PLATFORM_RELEASE" == "bionic" ]; then + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | $_SUDO apt-key add - + $_SUDO apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' + DEBIAN_FRONTEND=noninteractive; $_SUDO apt-get install $APT_OPTIONS cmake + else + DEBIAN_FRONTEND=noninteractive; $_SUDO apt-get install $APT_OPTIONS cmake + fi + + if [ "$?" != "0" ]; then + echo "Error: unable to install cmake" + exit 1 + fi + +###------------------- Handle YCM ----------------------### + echo "Installing YCM package" + YCM_URL_TAG="YCM_PACKAGE_URL_${_PLATFORM_RELEASE}" + wget ${!YCM_URL_TAG} -O /tmp/ycm.deb + DEBIAN_FRONTEND=noninteractive; $_SUDO dpkg --ignore-depends=libjs-sphinxdoc -i /tmp/ycm.deb; $_SUDO apt-get install $APT_OPTIONS -f + + if [ "$?" != "0" ]; then + echo "Error: unable to install ycm" + exit 1 + fi + +###----------- Handle iCub deps from icub-common -------### + echo "Installing icub-common dependencies in the environment" + DEP_TAG="ICUB_DEPS_${_PLATFORM_RELEASE}" + _DEPENDENCIES="$ICUB_DEPS_COMMON ${!DEP_TAG}" + DEBIAN_FRONTEND=noninteractive; $_SUDO apt-get install $APT_OPTIONS $_DEPENDENCIES + + if [ "$?" != "0" ]; then + echo "Error: unable to install dependencies" + exit 1 + fi + +###------------------- Handle IpOpt --------------------### +## It seems already handeled by $_SUDO apt install coinor-libipopt-dev + +###------------------- Handle YARP --------------------### + echo "Installing YARP package" + YARP_URL_TAG="YARP_PACKAGE_URL_${_PLATFORM_RELEASE}" + wget ${!YARP_URL_TAG} -O /tmp/yarp.deb + DEBIAN_FRONTEND=noninteractive; $_SUDO dpkg -i /tmp/yarp.deb + + if [ "$?" != "0" ]; then + echo "Error: unable to install yarp" + exit 1 + fi +} + +build_icub() { + + #echo "Cloning icub sources from ${ICUB_REPO_URL}" + #git clone $ICUB_REPO_URL + #if [ "$?" != "0" ]; then + # echo "Error: unable to clone icub repositoy from ${ICUB_REPO_URL}" + # exit 1 + #fi + cd ${ICUB_SCRIPT_DIR} + export D_ICUB_ROOT=$(pwd) + git checkout v$ICUB_PACKAGE_VERSION + if [ "$?" != "0" ]; then + echo "Error: unable to checkout to v$ICUB_PACKAGE_VERSION" + exit 1 + fi + + mkdir build && cd build + + CMAKE_OPTIONS_TAG="CMAKE_OPTIONS_${PLATFORM_KEY}" + _SPECIAL_DIST_CMAKE_OPTIONS="${!CMAKE_OPTIONS_TAG}" + export D_ICUB_INSTALL_DIR=$(pwd)/install + cmake $ICUB_CMAKE_OPTIONS -DCMAKE_INSTALL_PREFIX=$D_ICUB_INSTALL_DIR/usr .. + + make -j && make install + if [ "$?" != "0" ]; then + echo "Error: unable to checkout to build and/or install icub-main" + exit 1 + fi +} + +fix_relocatable_files(){ + ICUB_INI_PATH="$D_ICUB_INSTALL_DIR/usr/share/yarp/config/path.d" + ICUB_INI_FILE="iCub.ini" + + echo "Fixing iCub.ini in path.d" + # this fixes missing iCub.ini file + if [ ! -e "${ICUB_INI_PATH}/${ICUB_INI_FILE}" ] + then + mkdir -p $ICUB_INI_PATH + ls $ICUB_INI_PATH + touch ${ICUB_INI_PATH}/${ICUB_INI_FILE} + echo ###### This file is automatically generated by CMake. >> ${ICUB_INI_PATH}/${ICUB_INI_FILE} + echo [search iCub] >> ${ICUB_INI_PATH}/${ICUB_INI_FILE} + echo path "/usr/share/iCub">> ${ICUB_INI_PATH}/${ICUB_INI_FILE} + fi + echo "Fix path inside cmake files" + _cmake_files=$(find ${D_ICUB_INSTALL_DIR} -name "*.cmake") + for f in $_cmake_files ; do + sed -i "s|$D_ICUB_INSTALL_DIR||g" $f + done + + echo "Fix path inside ini files" + _ini_files=$(find ${D_ICUB_INSTALL_DIR} -name "*.ini") + for f in $_ini_files ; do + sed -i "s|$D_ICUB_INSTALL_DIR||g" $f + done + } main() { - create_control_file + install_deps + build_icub + # Probably this step is not needed anymore after cmake components/modernization + fix_relocatable_files create_deb } diff --git a/.ci/packages_vars.sh b/.ci/packages_vars.sh index 4265d85902..212bac8d48 100644 --- a/.ci/packages_vars.sh +++ b/.ci/packages_vars.sh @@ -9,9 +9,18 @@ # LATEST MODIFICATION DATE (YYYY-MM-DD): 2020-06-11 # YCM_PACKAGE="ycm-cmake-modules" -YCM_PACKAGE_URL_bionic="https://launchpad.net/~robotology/+archive/ubuntu/ppa/+files/${YCM_PACKAGE}_0.12.0-1~ubuntu18.04~robotology1_all.deb" -YCM_PACKAGE_URL_buster="https://launchpad.net/~robotology/+archive/ubuntu/ppa/+files/${YCM_PACKAGE}_0.12.0-1_all.deb" -YCM_PACKAGE_URL_focal="https://launchpad.net/~robotology/+archive/ubuntu/ppa/+files/${YCM_PACKAGE}_0.12.0-1_all.deb" +YCM_REQUIRED_VERSION="0.12.0" +YCM_PACKAGE_URL_buster="https://github.com/robotology/ycm/releases/download/v${YCM_REQUIRED_VERSION}/${YCM_PACKAGE}_${YCM_REQUIRED_VERSION}-1.debian10.robotology1_all.deb" +YCM_PACKAGE_URL_bionic="https://github.com/robotology/ycm/releases/download/v${YCM_REQUIRED_VERSION}/${YCM_PACKAGE}_${YCM_REQUIRED_VERSION}-1.ubuntu18.04.robotology2_all.deb" +YCM_PACKAGE_URL_focal="https://github.com/robotology/ycm/releases/download/v${YCM_REQUIRED_VERSION}/${YCM_PACKAGE}_${YCM_REQUIRED_VERSION}-1.ubuntu20.04.robotology1_all.deb" + +YARP_REQUIRED_VERSION="3.4.0" +YARP_PACKAGE_URL_buster="https://github.com/robotology/yarp/releases/download/v${YARP_REQUIRED_VERSION}/yarp-${YARP_REQUIRED_VERSION}-2.buster_amd64.deb" +YARP_PACKAGE_URL_bionic="https://github.com/robotology/yarp/releases/download/v${YARP_REQUIRED_VERSION}/yarp-${YARP_REQUIRED_VERSION}-2.bionic_amd64.deb" +YARP_PACKAGE_URL_focal="https://github.com/robotology/yarp/releases/download/v${YARP_REQUIRED_VERSION}/yarp-${YARP_REQUIRED_VERSION}-2.focal_amd64.deb" + +APT_OPTIONS="-q -y" + SUPPORTED_DISTRO_LIST="buster bionic focal" SUPPORTED_TARGET_LIST="amd64" CMAKE_MIN_REQ_VER="3.12.0" @@ -19,6 +28,28 @@ ICUB_DEPS_COMMON="libace-dev libboost-filesystem-dev libboost-system-dev libboos ICUB_DEPS_bionic="libode6" ICUB_DEPS_focal="libode8" ICUB_DEPS_buster="libode8" -ICUB_REPO_URL="https://github.com/robotology/icub-main" +#TO BE CHANGED!!! +ICUB_REPO_URL="https://github.com/Nicogene/icub-main.git" ICUB_PACKAGE_MAINTAINER="Matteo Brunettini " export ICUB_DEBIAN_REVISION_NUMBER="1" # Always use a revision number >=1 + +ICUB_CMAKE_OPTIONS="\ + -DCMAKE_BUILD_TYPE=Release \ + -DICUB_USE_SDL=ON \ + -DICUB_USE_ODE=ON \ + -DIPOPT_DIR=/usr \ + -DICUB_USE_IPOPT=ON \ + -DICUB_USE_GLUT=ON \ + -DENABLE_icubmod_canmotioncontrol=OFF \ + -DENABLE_icubmod_cartesiancontrollerclient=ON \ + -DENABLE_icubmod_cartesiancontrollerserver=ON \ + -DENABLE_icubmod_fakecan=ON \ + -DENABLE_icubmod_gazecontrollerclient=ON \ + -DENABLE_icubmod_skinprototype=ON \ + -DENABLE_icubmod_socketcan=ON \ + -DENABLE_icubmod_static_grabber=ON \ + -DENABLE_icubmod_xsensmtx=OFF \ + -DYARP_FORCE_DYNAMIC_PLUGINS=ON" +CMAKE_OPTIONS_focal="" +CMAKE_OPTIONS_bionic="" +CMAKE_OPTIONS_buster="" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f4dccf673..d3054081e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: pull_request: schedule: # * is a special character in YAML so you have to quote this string - # Execute a "nightly" build at 2 AM UTC + # Execute a "nightly" build at 2 AM UTC - cron: '0 2 * * *' jobs: @@ -19,18 +19,18 @@ jobs: steps: - uses: actions/checkout@master - + - name: Environment Variables shell: bash run: env - - # Remove apt repos that are known to break from time to time - # See https://github.com/actions/virtual-environments/issues/323 + + # Remove apt repos that are known to break from time to time + # See https://github.com/actions/virtual-environments/issues/323 - name: Remove broken apt repos [Ubuntu] if: matrix.os == 'ubuntu-latest' run: | for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done - + # ============ # DEPENDENCIES # ============ @@ -45,20 +45,20 @@ jobs: wget https://github.com/robotology/robotology-superbuild-dependencies-vcpkg/releases/download/${latest_tag}/vcpkg-robotology.zip unzip vcpkg-robotology.zip -d C:/ echo "VCPKG_INSTALLATION_ROOT=C:/robotology/vcpkg" >> ${GITHUB_ENV} - + - name: Dependencies [macOS] if: matrix.os == 'macOS-latest' run: | brew install ace cmake eigen gsl ipopt opencv pkg-config qt5 - + - name: Dependencies [Ubuntu] if: matrix.os == 'ubuntu-latest' run: | sudo apt update sudo apt install -y git build-essential cmake libace-dev coinor-libipopt-dev libeigen3-dev swig libopencv-dev qtbase5-dev \ qtdeclarative5-dev qtmultimedia5-dev libtinyxml-dev libgsl-dev libpython3-dev swig - - - name: Source-based Dependencies [Windows] + + - name: Source-based Dependencies [Windows] if: matrix.os == 'windows-latest' shell: bash run: | @@ -67,7 +67,7 @@ jobs: git clone https://github.com/robotology/ycm.git --depth 1 --branch master cd ycm && mkdir -p build && cd build cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. - cmake --build . --config ${{ matrix.build_type }} --target INSTALL + cmake --build . --config ${{ matrix.build_type }} --target INSTALL # YARP cd ${GITHUB_WORKSPACE} git clone https://github.com/robotology/yarp.git --depth 1 --branch master @@ -82,8 +82,8 @@ jobs: cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake \ -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. cmake --build . --config ${{ matrix.build_type }} --target INSTALL - - - name: Source-based Dependencies [Ubuntu/macOS] + + - name: Source-based Dependencies [Ubuntu/macOS] if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' shell: bash run: | @@ -92,7 +92,7 @@ jobs: git clone https://github.com/robotology/ycm.git --depth 1 --branch master cd ycm && mkdir -p build && cd build cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. - cmake --build . --config ${{ matrix.build_type }} --target install + cmake --build . --config ${{ matrix.build_type }} --target install # YARP cd ${GITHUB_WORKSPACE} git clone https://github.com/robotology/yarp.git --depth 1 --branch master @@ -104,8 +104,8 @@ jobs: git clone https://github.com/robotology/icub-firmware-shared.git --depth 1 --branch devel cd icub-firmware-shared && mkdir -p build && cd build cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. - cmake --build . --config ${{ matrix.build_type }} --target install - + cmake --build . --config ${{ matrix.build_type }} --target install + # =================== # CMAKE-BASED PROJECT # =================== @@ -129,13 +129,13 @@ jobs: -DENABLE_icubmod_embObjVirtualAnalogSensor:BOOL=ON -DENABLE_icubmod_parametricCalibrator:BOOL=ON \ -DENABLE_icubmod_parametricCalibratorEth:BOOL=ON \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. - + - name: Configure [Ubuntu/macOS] if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest' shell: bash run: | mkdir -p build - cd build + cd build cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DICUB_USE_icub_firmware_shared:BOOL=ON -DENABLE_icubmod_serial:BOOL=ON \ -DENABLE_icubmod_serialport:BOOL=ON -DENABLE_icubmod_skinWrapper:BOOL=ON \ @@ -149,22 +149,22 @@ jobs: -DENABLE_icubmod_embObjVirtualAnalogSensor:BOOL=ON -DENABLE_icubmod_parametricCalibrator:BOOL=ON \ -DENABLE_icubmod_parametricCalibratorEth:BOOL=ON \ -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. - - name: Enable python bindings on Ubuntu + - name: Enable python bindings on Ubuntu if: matrix.os == 'ubuntu-latest' - run: | + run: | cd build - # Enable ICUB_COMPILE_BINDINGS in Ubuntu + # Enable ICUB_COMPILE_BINDINGS in Ubuntu cmake -DICUB_COMPILE_BINDINGS:BOOL=ON -DCREATE_PYTHON:BOOL=ON . - + - name: Build shell: bash run: | cd build - # Fix for using YARP idl generators (that link ACE) in Windows + # Fix for using YARP idl generators (that link ACE) in Windows # See https://github.com/robotology/idyntree/issues/569 for more details export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/bin cmake --build . --config ${{ matrix.build_type }} - + - name: Install shell: bash run: | diff --git a/.github/workflows/packages_creation.yml b/.github/workflows/packages_creation.yml index ea97188c8f..43e25c0e3d 100644 --- a/.github/workflows/packages_creation.yml +++ b/.github/workflows/packages_creation.yml @@ -1,11 +1,9 @@ name: Packages creation on: - push: - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - # branches: - # - master + release: + types: + - created jobs: # start job "preliminary-steps" @@ -34,27 +32,6 @@ jobs: name: ICUB_PACKAGE_VERSION.txt path: ./ICUB_PACKAGE_VERSION.txt - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: true - prerelease: false - - - name: create upload URL file - shell: bash - run: echo ${{ steps.create_release.outputs.upload_url }} > UPLOAD_URL.txt - - - name: upload url file - uses: actions/upload-artifact@v2 - with: - name: UPLOAD_URL.txt - path: ./UPLOAD_URL.txt - # end job "preliminary-steps" # start job "normal-build" normal-build: @@ -69,9 +46,11 @@ jobs: - name: install deps shell: bash run: | - sudo apt-get update - sudo apt-get install -y git - sudo apt-get install -y lsb-release + sudo apt update + sudo apt install -y git + sudo apt install -y lsb-release + sudo apt install -y build-essential + sudo apt install -y qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings libopenni2-dev libi2c-dev libv4l-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-tools libgraphviz-dev libqcustomplot-dev - uses: actions/checkout@master @@ -80,31 +59,44 @@ jobs: name: ICUB_PACKAGE_VERSION.txt - name: Generate icub-common metapackage - id: package_generation + id: package_generation_icub-common shell: bash run: | chmod +x ./.ci/create_icub-common_deb.sh export ICUB_PACKAGE_VERSION=$(cat ICUB_PACKAGE_VERSION.txt) ./.ci/create_icub-common_deb.sh - echo ::set-output name=ICUB_PACKAGE_NAME::$( cat ICUB_PACKAGE_NAME.txt ) + echo ::set-output name=ICUB_COMMON_PACKAGE_NAME::$( cat ICUB_COMMON_PACKAGE_NAME.txt ) - - uses: actions/download-artifact@v2 + - name: Upload Release Asset icub-common + uses: actions/upload-release-asset@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: UPLOAD_URL.txt + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ steps.package_generation_icub-common.outputs.ICUB_COMMON_PACKAGE_NAME }} + asset_name: ${{ steps.package_generation_icub-common.outputs.ICUB_COMMON_PACKAGE_NAME }} + asset_content_type: application/vnd.debian.binary-package - - name: read upload url - id: read_upload_url + - name: Generate icub package + id: package_generation_icub-main shell: bash - run: echo ::set-output name=UPLOAD_URL::$( cat UPLOAD_URL.txt ) + run: | + chmod +x ./.ci/create_icub-main_deb.sh + export ICUB_PACKAGE_VERSION=$(cat ICUB_PACKAGE_VERSION.txt) + ./.ci/create_icub-main_deb.sh + echo ::set-output name=ICUB_MAIN_PACKAGE_NAME::$( cat ICUB_MAIN_PACKAGE_NAME.txt ) + - - name: Upload Release Asset - id: upload-release-asset - uses: shogo82148/actions-upload-release-asset@v1 + + - name: Upload Release Asset icub-main + uses: actions/upload-release-asset@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.read_upload_url.outputs.UPLOAD_URL }} - asset_path: ${{ steps.package_generation.outputs.ICUB_PACKAGE_NAME }} + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ steps.package_generation_icub-main.outputs.ICUB_MAIN_PACKAGE_NAME }} + asset_name: ${{ steps.package_generation_icub-main.outputs.ICUB_MAIN_PACKAGE_NAME }} asset_content_type: application/vnd.debian.binary-package - # end job "normal-build" # start job "docker-build" docker-build: @@ -115,8 +107,9 @@ jobs: fail-fast: false matrix: docker_image: -# - "ubuntu:bionic" - "debian:buster" + - "ubuntu:bionic" + - "ubuntu:focal" container: image: ${{ matrix.docker_image }} steps: @@ -124,9 +117,11 @@ jobs: - name: install deps shell: bash run: | - apt-get update - apt-get install -y git - apt-get install -y lsb-release + apt update + apt install -y git + apt install -y lsb-release + apt install -y build-essential wget + apt install -y libsqlite3-dev qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings libopenni2-dev libi2c-dev libv4l-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-tools libgraphviz-dev libqcustomplot-dev - uses: actions/checkout@master @@ -135,13 +130,21 @@ jobs: name: ICUB_PACKAGE_VERSION.txt - name: Generate icub-common metapackage - id: package_generation + id: package_generation_icub-common shell: bash run: | chmod +x ./.ci/create_icub-common_deb.sh export ICUB_PACKAGE_VERSION=$(cat ICUB_PACKAGE_VERSION.txt) ./.ci/create_icub-common_deb.sh - echo ::set-output name=ICUB_PACKAGE_NAME::$( cat ICUB_PACKAGE_NAME.txt ) + echo ::set-output name=ICUB_COMMON_PACKAGE_NAME::$( cat ICUB_COMMON_PACKAGE_NAME.txt ) + - name: Generate icub package + id: package_generation_icub-main + shell: bash + run: | + chmod +x ./.ci/create_icub-main_deb.sh + export ICUB_PACKAGE_VERSION=$(cat ICUB_PACKAGE_VERSION.txt) + ./.ci/create_icub-main_deb.sh + echo ::set-output name=ICUB_MAIN_PACKAGE_NAME::$( cat ICUB_MAIN_PACKAGE_NAME.txt ) - uses: actions/download-artifact@v2 with: @@ -152,12 +155,23 @@ jobs: shell: bash run: echo ::set-output name=UPLOAD_URL::$( cat UPLOAD_URL.txt ) - - name: Upload Release Asset - id: upload-release-asset - uses: shogo82148/actions-upload-release-asset@v1 + - name: Upload Release asset icub-common + uses: actions/upload-release-asset@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.read_upload_url.outputs.UPLOAD_URL }} + asset_path: ./${{ steps.package_generation_icub-common.outputs.ICUB_COMMON_PACKAGE_NAME }} + asset_name: ${{ steps.package_generation_icub-common.outputs.ICUB_COMMON_PACKAGE_NAME }} + asset_content_type: application/vnd.debian.binary-package + - name: Upload Release asset icub-main + uses: actions/upload-release-asset@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.read_upload_url.outputs.UPLOAD_URL }} - asset_path: ${{ steps.package_generation.outputs.ICUB_PACKAGE_NAME }} + asset_path: ./${{ steps.package_generation_icub-main.outputs.ICUB_MAIN_PACKAGE_NAME }} + asset_name: ${{ steps.package_generation_icub-main.outputs.ICUB_MAIN_PACKAGE_NAME }} asset_content_type: application/vnd.debian.binary-package # end job "docker-build"