@@ -23,11 +23,13 @@ jobs:
2323 target-platform : linux-x64
2424 flutter-output-folder : build/linux/x64/release/bundle
2525 archive-suffix : x86_64
26+ linuxdeploy-exe : linuxdeploy-x86_64.AppImage
2627 - runs-on : ubuntu-24.04-arm
2728 cache-name : saberarm64
2829 target-platform : linux-arm64
2930 flutter-output-folder : build/linux/arm64/release/bundle
3031 archive-suffix : arm64
32+ linuxdeploy-exe : linuxdeploy-aarch64.AppImage
3133 runs-on : ${{ matrix.arch.runs-on }}
3234 permissions :
3335 contents : write
8587 chmod +x AppDir/saber
8688
8789 install -Dm644 flatpak/com.adilhanney.saber.metainfo.xml -t AppDir/share/metainfo/
88- install -Dm644 flatpak/com.adilhanney.saber.metainfo.xml -t AppDir/usr/share/metainfo/
89-
9090 install -Dm644 assets/icon/icon_linux.svg AppDir/share/icons/hicolor/scalable/apps/com.adilhanney.saber.svg
91- install -Dm644 assets/icon/icon_linux.svg AppDir/usr/share/icons/hicolor/scalable/apps/com.adilhanney.saber.svg
92-
9391 install -Dm644 flatpak/com.adilhanney.saber.desktop -t AppDir/share/applications/
9492
9593 tar -C AppDir -czvf $archiveName .
@@ -107,63 +105,55 @@ jobs:
107105 repo_token : ${{ secrets.GITHUB_TOKEN }}
108106 file : ${{ steps.compress.outputs.archiveName }}
109107
110- build-appimage :
111- name : Build AppImage
112- needs : build-linux
113- runs-on : ubuntu-latest
114- permissions :
115- contents : write
116- timeout-minutes : 10
117- steps :
118- - name : Checkout code
119- uses : actions/checkout@v6
108+ # Now build AppImage
120109
121- - name : Install AppImage dependencies
110+ - name : Install FUSE
122111 run : |
123112 sudo add-apt-repository universe
124- sudo apt install libfuse2
113+ sudo apt-get install libfuse2t64
114+
115+ - name : Prepare AppDir for AppImage
116+ run : |
117+ rm -rf linux/AppImage/AppDir/
125118
126- - name : Download app archive
127- uses : actions/download-artifact@v7
128- with :
129- name : Saber-Archive-x86_64
119+ # Copy flutter bundle into AppDir/usr/bin/
120+ mkdir -p linux/AppImage/AppDir/usr/bin/
121+ cp -R AppDir/* linux/AppImage/AppDir/usr/bin/
130122
131- - name : Rename app archive
132- run : |
133- mv Saber_*.tar.gz Saber-Linux-Portable.tar.gz
123+ # Move share folder to usr/share
124+ mv linux/AppImage/AppDir/usr/bin/share linux/AppImage/AppDir/usr/
134125
135- - name : Install appimage-builder
136- run : |
137- sudo pip3 install --ignore-installed git+https://github.com/AppImageCrafters/appimage-builder.git
126+ # Set environment variables for linuxdeploy
127+ echo "LD_LIBRARY_PATH=$(pwd)/linux/AppImage/AppDir/usr/bin/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
128+ echo 'UPDATE_INFORMATION=gh-releases-zsync|saber-notes|saber|latest|Saber-*-${{ matrix.arch.archive-suffix }}.AppImage.zsync' >> $GITHUB_ENV
138129
139- - name : Prepare build files
140- working-directory : appimage
130+ - name : Install linuxdeploy
131+ working-directory : linux/AppImage
141132 run : |
142- mkdir AppDir
143- tar -xzvf ../Saber-Linux-Portable.tar.gz -C AppDir
133+ wget https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/${{ matrix.arch.linuxdeploy-exe }}
134+ chmod +x ${{ matrix.arch.linuxdeploy-exe }}
135+ - name : Build AppImage
136+ working-directory : linux/AppImage
137+ run : ./${{ matrix.arch.linuxdeploy-exe }} --appdir AppDir --output appimage
144138
145- - name : Set AppImage version
146- working-directory : appimage
147- run : |
148- # replace line with "version: latest" with "version: $buildName"
149- buildName=$(grep -oP "(?<=buildName = ').*(?=')" ../lib/data/version.dart)
150- sed -i "s/version: latest/version: ${buildName}/" AppImageBuilder.yml
139+ - run : tree linux/AppImage -L 3
151140
152- - name : Build AppImage
153- working-directory : appimage
141+ - name : Rename AppImage
154142 run : |
155- appimage-builder --skip-test
143+ buildName=$(grep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
144+ mv linux/AppImage/Saber-*.AppImage linux/AppImage/Saber-${buildName}-${{ matrix.arch.archive-suffix }}.AppImage
145+ mv linux/AppImage/Saber-*.AppImage.zsync linux/AppImage/Saber-${buildName}-${{ matrix.arch.archive-suffix }}.AppImage.zsync
156146
157147 - name : Upload artifact
158148 uses : actions/upload-artifact@v6
159149 with :
160- name : AppImage artifact
161- path : appimage/ Saber-*-x86_64 .AppImage*
150+ name : AppImage artifact (${{ matrix.arch.target-platform }})
151+ path : linux/AppImage/ Saber-*.AppImage*
162152
163153 - name : Upload to GitHub release
164154 uses : svenstaro/upload-release-action@v2
165155 if : ${{ startsWith(github.ref, 'refs/tags/') }}
166156 with :
167157 repo_token : ${{ secrets.GITHUB_TOKEN }}
168- file : appimage/ Saber-*-x86_64 .AppImage*
158+ file : linux/AppImage/ Saber-*.AppImage*
169159 file_glob : true
0 commit comments