Skip to content

Commit

Permalink
add github workflow for appimages creation
Browse files Browse the repository at this point in the history
  • Loading branch information
neodix42 committed Dec 24, 2024
1 parent c411f19 commit c8a48e4
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-ton-linux-x86-64-appimage.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions assembly/appimage/AppRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
export PATH=$PATH:$(dirname "$0")/usr/bin
cd "$(dirname $APPIMAGE)" & exec app "$@"
35 changes: 35 additions & 0 deletions assembly/appimage/create-appimages.sh
Original file line number Diff line number Diff line change
@@ -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/
Binary file added assembly/appimage/ton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c8a48e4

Please sign in to comment.