Skip to content

Commit

Permalink
git: fix AppImage build
Browse files Browse the repository at this point in the history
  • Loading branch information
Shebyyy authored Jan 16, 2025
1 parent 8adac3c commit 030c8dd
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}

build-linux:
runs-on: ubuntu-latest
steps:
Expand All @@ -91,7 +91,10 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build cmake clang mpv libgtk-3-dev libblkid-dev liblzma-dev pkg-config libmpv-dev webkit2gtk-4.1 dpkg-dev
sudo apt-get install -y ninja-build cmake clang mpv libgtk-3-dev libblkid-dev liblzma-dev pkg-config libmpv-dev webkit2gtk-4.1 dpkg-dev fuse
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
Expand All @@ -103,14 +106,48 @@ jobs:
- name: Build Linux
run: flutter build linux --release

- name: Zip Linux Artifacts
- name: Create AppImage
run: |
# Create fresh AppDir structure
rm -rf AppDir
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
# Copy built files
cp -r build/linux/x64/release/bundle/* AppDir/usr/bin/
cp assets/images/logo.png AppDir/usr/share/icons/hicolor/256x256/apps/anymex.png
cp assets/images/logo.png AppDir/anymex.png
# Create desktop file in AppDir root
cat <<EOF > AppDir/anymex.desktop
[Desktop Entry]
Name=AnymeX
Exec=usr/bin/anymex
Icon=anymex
Type=Application
Categories=Utility;
EOF
# Create AppRun file
cat <<EOF > AppDir/AppRun
#!/bin/sh
SELF=\$(readlink -f "\$0")
HERE=\${SELF%/*}
export PATH="\${HERE}/usr/bin/:\${PATH}"
export LD_LIBRARY_PATH="\${HERE}/usr/lib/:\${LD_LIBRARY_PATH}"
exec "\${HERE}/usr/bin/anymex" "\$@"
EOF
chmod +x AppDir/AppRun
# Make AppImage
/usr/local/bin/appimagetool AppDir
mv AnymeX-x86_64.AppImage build/linux/x64/release/AnymeX-Linux.AppImage
- name: Create ZIP archive
run: |
cd build/linux/x64/release
zip -r ../../../../AnymeX-Linux.zip .
- name: Release Linux Build
cd build/linux/x64/release/bundle
zip -r ../AnymeX-Linux.zip ./*
- name: Release Linux Build and AppImage
uses: ncipollo/release-action@v1
with:
artifacts: "AnymeX-Linux.zip"
artifacts: |
build/linux/x64/release/AnymeX-Linux.zip
build/linux/x64/release/AnymeX-Linux.AppImage
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
Expand Down

0 comments on commit 030c8dd

Please sign in to comment.