From e0def21582ed45aba1ac3fd873a9f1011a79ea1b Mon Sep 17 00:00:00 2001 From: MNikoliCC <135981555+MNikoliCC@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:50:00 +0100 Subject: [PATCH] Update snap creation from Ubuntu 20.04 to Ubuntu 22.04 (#62) * Update to Ubuntu 22.04 * Update artifacts version to v3 * Fix * Fix * Fix * Fix * Fix "libgfortran4" dependencie * Fix "libssl1.1" dependencie * Fix java * Fix "libicu66" dependencie * Removing "libcrystalhd3" dependencie * Fix "libldap-2.4-2" dependencie * Fix * Fix * Fix * Fix * Fix * Fix * Fix * Fix * Add workflow_dispatch trigger for manual runs * Fix * Fix * Fix * Add tmate session * Fix * Fix * Fix * Fix * Fix migration core20 to core22 * Fix * Remove gnome extension * Fix * Fix * Fix * Fix * Update artifact version * Fix version * Fix dependency --- .github/workflows/snap-creation.yml | 27 +++++++++++++----- snapcraft.yaml | 44 ++++++++++++++--------------- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/.github/workflows/snap-creation.yml b/.github/workflows/snap-creation.yml index c24f45a..605baa6 100644 --- a/.github/workflows/snap-creation.yml +++ b/.github/workflows/snap-creation.yml @@ -1,5 +1,16 @@ name: Webots Snap Package Creation on: + workflow_dispatch: + inputs: + debug_enabled: + type: boolean + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' + required: false + default: false + branch: + description: "Branch to build" + required: false + default: "master" pull_request: types: [opened, synchronize, reopened, labeled, unlabeled] schedule: @@ -18,11 +29,11 @@ defaults: jobs: build: - if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'test creation') }} + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'test creation') }} strategy: matrix: branch: [master, develop] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Install Snapcraft @@ -31,7 +42,6 @@ jobs: run: | sudo apt install --yes git sudo snap install snapcraft --classic - export ROS_DISTRO=noetic git clone --recurse-submodules --depth 3 --single-branch --branch ${{ matrix.branch }} https://github.com/cyberbotics/webots.git export WEBOTS_VERSION=$(cat webots/scripts/packaging/webots_version.txt | sed 's/ revision /-rev/g') sed -i "s/version:\s*'R[0-9]\{4\}[a-z].*'/version: '$WEBOTS_VERSION'/g" snapcraft.yaml @@ -44,12 +54,16 @@ jobs: sudo apt install xvfb export DISPLAY=:99 Xvfb :99 -screen 0 1024x768x16 & + - name: Start tmate session (Debugging) + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} + uses: mxschmitt/action-tmate@v3 - name: Create Snap Package run: | + sudo lsb_release -a sudo snapcraft --destructive-mode cp *.snap webots/distribution - - uses: actions/upload-artifact@v2 - if: ${{ contains(github.event.pull_request.labels.*.name, 'test creation') }} + - uses: actions/upload-artifact@v4 + if: ${{ contains(github.event.pull_request.labels.*.name, 'test creation') || github.event_name == 'workflow_dispatch'}} with: name: build-${{ matrix.branch }} path: | @@ -64,7 +78,7 @@ jobs: webots/scripts/packaging/publish_release.py --key=${{ secrets.BOT_ACTION_KEY }} --repo=cyberbotics/webots --commit=$COMMIT_ID release-tag: if: ${{ github.event_name == 'push' }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Install Snapcraft @@ -73,7 +87,6 @@ jobs: run: | sudo apt install --yes git sudo snap install snapcraft --classic - export ROS_DISTRO=noetic git clone --recurse-submodules --depth 3 --single-branch --branch ${GITHUB_REF#refs/tags/} https://github.com/cyberbotics/webots.git export WEBOTS_VERSION=$(cat webots/scripts/packaging/webots_version.txt | sed 's/ revision /-rev/g') sed -i "s/version:\s*'R[0-9]\{4\}[a-z].*'/version: '$WEBOTS_VERSION'/g" snapcraft.yaml diff --git a/snapcraft.yaml b/snapcraft.yaml index 0f018e3..984c601 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -11,8 +11,9 @@ name: webots title: Webots -base: core20 -version: 'R2023b' +base: core22 +version: 'R2025a' +adopt-info: webots summary: Webots is a free and open-source 3D robot simulator description: | Webots is a free and open-source 3D robot simulator. @@ -21,17 +22,17 @@ description: | actuators and objects are provided, but you can create your own. Collision detections, rigid body dynamics and fluid dynamics rely on a modified version of the ODE physics engine. The robot controller programs can be written - outside of Webots in C, C++, Python, ROS, Java or MATLAB using a simple API. + outside of Webots in C, C++, Python, Java or MATLAB using a simple API. Webots features a 3D web interface allowing you to publish simulations online. icon: webots.png license: Apache-2.0 grade: stable # must be 'stable' to release into candidate/stable channels confinement: strict architectures: -- build-on: amd64 - run-on: amd64 +- build-on: [amd64] + build-for: [amd64] environment: - JAVA_HOME: "$SNAP/usr/lib/jvm/java-16-openjdk-amd64" + JAVA_HOME: "$SNAP/usr/lib/jvm/java-18-openjdk-amd64" PATH: "$JAVA_HOME/bin:$PATH" layout: @@ -41,8 +42,10 @@ layout: bind: $SNAP/usr/include /usr/share/libdrm: # to fix a warning displayed by Webots on AMD GPUs bind: $SNAP/usr/share/libdrm - /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libc_nonshared.a: - bind-file: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libc_nonshared.a + /usr/lib/$CRAFT_ARCH_TRIPLET/libc_nonshared.a: + bind-file: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/libc_nonshared.a + # bind-file: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libc_nonshared.a + parts: desktop-gtk3: @@ -58,7 +61,7 @@ parts: stage: - -usr/lib/x86_64-linux-gnu/libjpeg.so.8.2.2 stage-packages: - - ttf-ubuntu-font-family + - fonts-ubuntu - dmz-cursor-theme - light-themes - adwaita-icon-theme @@ -83,8 +86,7 @@ parts: plugin: make build-environment: - WEBOTS_HOME: "$SNAPCRAFT_PART_BUILD" - - ROS_DISTRO: "noetic" - - JAVA_HOME: "/usr/lib/jvm/java-16-openjdk-amd64" + - JAVA_HOME: "/usr/lib/jvm/java-18-openjdk-amd64" - PATH: "$JAVA_HOME/bin:$PATH" #source: https://cyberbotics.com/files/repository/beta/webots.tar.bz2 # When building locally, uncomment the following line: @@ -98,15 +100,14 @@ parts: # We should specify either the source-branch or the source-tag, but not both # source-tag: R2023b override-pull: | - snapcraftctl pull + craftctl default ./scripts/install/linux_optional_compilation_dependencies.sh sudo apt install --yes xvfb - snapcraftctl set-version R2023b override-prime: | - snapcraftctl prime + craftctl default rm -vf usr/lib/jvm/java-11-openjdk-*amd64/lib/security/blacklisted.certs stage-packages: - - openjdk-16-jdk + - openjdk-18-jdk - ca-certificates-java - build-essential - libc6-dev @@ -121,7 +122,6 @@ parts: - libcanberra-gtk-module - libcanberra-gtk3-module - libccd2 - - libcrystalhd3 - libcurl3-gnutls - libdbus-1-3 - libdouble-conversion3 @@ -131,7 +131,7 @@ parts: - libgcc1 - libgcrypt20 - libgd3 - - libgfortran4 + - libgfortran5 - libglib2.0-0 - libgl1 - libglu1-mesa @@ -146,10 +146,10 @@ parts: - libheimbase1-heimdal - libheimntlm0-heimdal - libhx509-5-heimdal - - libicu66 + - libicu70 - libjpeg8-dev - libkrb5-26-heimdal - - libldap-2.4-2 + - libldap-2.5-0 - libltdl7 - liblzma5 - libminizip1 @@ -176,7 +176,7 @@ parts: - libspeex1 - libssh-dev - libssh-gcrypt-4 - - libssl1.1 + - libssl3 - libstdc++6 - libswresample3 - libsystemd0 @@ -195,8 +195,9 @@ parts: - libwind0-heimdal - libx11-data - libx11-xcb1 - - libx265-179 + - libx265-199 - libxaw7 + - libxcb-cursor0 - libxcb-glx0 - libxcb-icccm4 - libxcb-image0 @@ -228,7 +229,6 @@ parts: apps: webots: - extensions: [gnome-3-38] environment: LANG: C.UTF-8 LC_ALL: C.UTF-8