diff --git a/.github/workflows/build-ton-linux-x86-64-appimage.yml b/.github/workflows/build-ton-linux-x86-64-appimage.yml new file mode 100644 index 000000000..46e74cc13 --- /dev/null +++ b/.github/workflows/build-ton-linux-x86-64-appimage.yml @@ -0,0 +1,51 @@ +name: Ubuntu TON build (AppImages, x86-64) + +on: [push,workflow_dispatch,workflow_call] + +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + runs-on: ${{ matrix.os }} + + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Install system libraries + run: | + sudo apt update + sudo apt install -y build-essential git cmake ninja-build libc++-dev libc++abi-dev + sudo apt remove libgsl-dev + + - if: matrix.os != 'ubuntu-24.04' + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 16 all + + - name: Build TON + run: | + git submodule sync --recursive + git submodule update + cp assembly/native/build-ubuntu-shared.sh . + chmod +x build-ubuntu-shared.sh + ./build-ubuntu-shared.sh -t -a + + - name: Make AppImages + run: | + cp assembly/appimage/create-appimages.sh . + cp assembly/appimage/AppRun . + cp assembly/appimage/ton.png . + chmod +x create-appimages.sh + ./create-appimages.sh + + - name: Upload artifacts + uses: actions/upload-artifact@master + with: + name: ton-appimages-${{ matrix.os }} + path: appimages/artifacts diff --git a/assembly/appimage/AppRun b/assembly/appimage/AppRun new file mode 100644 index 000000000..df760c761 --- /dev/null +++ b/assembly/appimage/AppRun @@ -0,0 +1,3 @@ +#!/bin/bash +export PATH=$PATH:$(dirname "$0")/usr/bin +cd "$(dirname $APPIMAGE)" & exec app "$@" diff --git a/assembly/appimage/create-appimages.sh b/assembly/appimage/create-appimages.sh new file mode 100644 index 000000000..7ada084a0 --- /dev/null +++ b/assembly/appimage/create-appimages.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +if [ ! -d "artifacts" ]; then + echo "No artifacts found." + exit 2 +fi + +rm -rf appimages + +mkdir -p appimages/artifacts + +wget -nc https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage +chmod +x ./appimagetool-x86_64.AppImage + +cd appimages +for file in ../artifacts/*; do + if [[ -f "$file" && "$file" != *.so ]]; then + appName=$(basename "$file") + echo $appName + # prepare AppDir + mkdir -p $appName.AppDir/usr/{bin,lib} + cp ../AppRun $appName.AppDir/AppRun + sed -i "s/app/$appName/g" $appName.AppDir/AppRun + chmod +x ./$appName.AppDir/AppRun + printf '[Desktop Entry]\nName='$appName'\nExec='$appName'\nIcon='$appName'\nType=Application\nCategories=Utility;\n' > $appName.AppDir/$appName.desktop + cp ../ton.png $appName.AppDir/$appName.png + cp $file $appName.AppDir/usr/bin/ + chmod +x ./$appName.AppDir/usr/bin/$appName + # create AppImage + ./../appimagetool-x86_64.AppImage $appName.AppDir + mv $appName-x86_64.AppImage artifacts/$appName + fi +done + +cp -r ../artifacts/{smartcont,lib} artifacts/ diff --git a/assembly/appimage/ton.png b/assembly/appimage/ton.png new file mode 100644 index 000000000..2a25c863d Binary files /dev/null and b/assembly/appimage/ton.png differ