Skip to content

Commit

Permalink
Update snap creation from Ubuntu 20.04 to Ubuntu 22.04 (#62)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MNikoliCC authored Dec 9, 2024
1 parent f0d44c1 commit e0def21
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 29 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/snap-creation.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand Down
44 changes: 22 additions & 22 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -121,7 +122,6 @@ parts:
- libcanberra-gtk-module
- libcanberra-gtk3-module
- libccd2
- libcrystalhd3
- libcurl3-gnutls
- libdbus-1-3
- libdouble-conversion3
Expand All @@ -131,7 +131,7 @@ parts:
- libgcc1
- libgcrypt20
- libgd3
- libgfortran4
- libgfortran5
- libglib2.0-0
- libgl1
- libglu1-mesa
Expand All @@ -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
Expand All @@ -176,7 +176,7 @@ parts:
- libspeex1
- libssh-dev
- libssh-gcrypt-4
- libssl1.1
- libssl3
- libstdc++6
- libswresample3
- libsystemd0
Expand All @@ -195,8 +195,9 @@ parts:
- libwind0-heimdal
- libx11-data
- libx11-xcb1
- libx265-179
- libx265-199
- libxaw7
- libxcb-cursor0
- libxcb-glx0
- libxcb-icccm4
- libxcb-image0
Expand Down Expand Up @@ -228,7 +229,6 @@ parts:

apps:
webots:
extensions: [gnome-3-38]
environment:
LANG: C.UTF-8
LC_ALL: C.UTF-8
Expand Down

0 comments on commit e0def21

Please sign in to comment.