Skip to content

Commit

Permalink
github: fix build-appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Wheeler committed Aug 15, 2024
1 parent c4ed34d commit 2f85be6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 29 deletions.
44 changes: 15 additions & 29 deletions .github/workflows/build-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "DIST=$DIST" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip
pip3 install appimage-builder
- name: Build AppImage
run: |
docker run --rm -v $(pwd):/workspace -w /workspace centos:7 /bin/bash -c "
Expand All @@ -57,49 +63,29 @@ jobs:
yum install -y gcc make automake autoconf gtk3-devel \
gettext-devel libtool fuse fuse-libs patchelf wget
# Download appimagetool
echo 'Downloading appimagetool...'
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool
chmod +x appimagetool
ls -l appimagetool # Ensure it was downloaded correctly
# Build the application
echo 'Building the application...'
./autogen.sh && ./configure && make
# Prepare directories
echo 'Preparing directories...'
mkdir -p AppDir/usr/bin AppDir/usr/share/icons/hicolor/scalable/apps AppDir/usr/share/applications
# Build the application
echo 'Building the application...'
./autogen.sh && ./configure && make
# Install the application into AppDir
echo 'Installing the application...'
make install DESTDIR=$(pwd)/AppDir
# Copy necessary resources
echo 'Copying resources...'
cp src/xnec2c AppDir/usr/bin/
cp resources/xnec2c.svg AppDir/usr/share/icons/hicolor/scalable/apps/
cp files/xnec2c.desktop AppDir/usr/share/applications/
# Create AppRun script
echo 'Creating AppRun script...'
echo '#!/bin/bash' > AppDir/AppRun
echo 'exec /usr/bin/xnec2c \"$@\"' >> AppDir/AppRun
chmod +x AppDir/AppRun
# Create AppImage
echo 'Creating AppImage...'
./appimagetool AppDir xnec2c-v${VERSION}${DIST}.AppImage
if [ ! -f "xnec2c-v${VERSION}${DIST}.AppImage" ]; then
echo 'AppImage creation failed.'
echo 'Directory listing:'
ls -l
exit 1
fi
# Finalize and rename the AppImage
echo 'Finalizing AppImage...'
chmod +x xnec2c-v${VERSION}${DIST}.AppImage
mv xnec2c-v${VERSION}${DIST}.AppImage xnec2c-${VERSION}${DIST}.AppImage
"
- name: Generate AppImage with appimage-builder
run: |
appimage-builder --recipe appimage-builder.yml
- name: Test AppImage
run: |
chmod +x xnec2c-${VERSION}${DIST}.AppImage
Expand Down
33 changes: 33 additions & 0 deletions appimage-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 1

AppDir:
path: ./AppDir
app_info:
id: xnec2c
name: xnec2c
icon: resources/xnec2c
exec: usr/bin/xnec2c
exec_args: "$@"
version: "${VERSION}${DIST}"

apt:
arch: amd64
sources:
- sourceline: 'deb [arch=amd64] http://vault.centos.org/7.9.2009/os/ x86_64 main'
include:
- glibc
- libgtk-3-0
- libglib2.0-0
- fuse
- other-dependencies

files:
include:
- ./src/xnec2c: usr/bin/xnec2c
- ./resources/xnec2c.svg: usr/share/icons/hicolor/scalable/apps/xnec2c.svg
- ./files/xnec2c.desktop: usr/share/applications/xnec2c.desktop

AppImage:
arch: x86_64
update-information: None
sign-key: None

0 comments on commit 2f85be6

Please sign in to comment.