Skip to content

Commit 0742c9e

Browse files
near-linkclaration
authored andcommitted
chore: replace cargo bundle with linuxdeploy to fix missing shared libraries (#16)
* Replace cargo bundle with linuxdeploy to fix missing shared libraries * Update build.yml * clean up --------- Update build.yml
1 parent a3dc374 commit 0742c9e

3 files changed

Lines changed: 36 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,47 @@ jobs:
3939
sudo apt-get update
4040
sudo apt-get install libgtk-3-dev libpng-dev libjpeg-dev libgl1-mesa-dev libglu1-mesa-dev libxkbcommon-dev libexpat1-dev libtiff-dev
4141
42-
- name: Build Dependencies
42+
- name: Build Dependencies
4343
run: |
4444
cargo install patch-crate
4545
cargo fetch --locked || true
4646
cargo patch-crate --force
47-
cargo install cargo-bundle
4847
mkdir -p build/out
4948
50-
- name: Build & Bundle (Linux)
49+
- name: Build Binary
50+
run: cargo build --bin ${{ env.BINARY_NAME }} --release
51+
52+
- name: Generate Runtime Metadata
53+
run: |
54+
cat > build/${{ env.BUNDLE_NAME }}.desktop <<EOF
55+
[Desktop Entry]
56+
Type=Application
57+
Name=${{ env.BUNDLE_NAME }}
58+
Exec=${{ env.BINARY_NAME }}
59+
Icon=${{ env.BUNDLE_NAME }}
60+
Categories=Utility;
61+
Terminal=false
62+
EOF
63+
64+
cp "package/linux/icon.png" "build/${{ env.BUNDLE_NAME }}.png"
65+
66+
- name: Bundle with LinuxDeploy
5167
run: |
52-
cargo bundle --bin ${{ env.BINARY_NAME }} --package ${{ env.BINARY_NAME }} --release --format appimage
53-
cp -R target/release/bundle/appimage/*.AppImage build/out/
68+
cd build
69+
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
70+
chmod +x linuxdeploy-x86_64.AppImage
71+
72+
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run \
73+
--appdir AppDir \
74+
--executable target/release/${{ env.BINARY_NAME }} \
75+
--desktop-file ${{ env.BUNDLE_NAME }}.desktop \
76+
--icon-file ${{ env.BUNDLE_NAME }}.png \
77+
--output appimage
78+
79+
rm linuxdeploy-x86_64.AppImage
80+
81+
mv *.AppImage out/
82+
cd ..
5483
5584
- name: Upload Bundles
5685
uses: actions/upload-artifact@v4
@@ -69,7 +98,7 @@ jobs:
6998
- name: Setup Windows MSVC environment
7099
uses: ilammy/msvc-dev-cmd@v1
71100

72-
- name: Build Dependencies
101+
- name: Build Dependencies
73102
run: |
74103
cargo install patch-crate
75104
cargo fetch --locked || true
@@ -114,7 +143,7 @@ jobs:
114143
with:
115144
targets: ${{ matrix.target }}
116145

117-
- name: Build Dependencies
146+
- name: Build Dependencies
118147
run: |
119148
cargo install patch-crate
120149
cargo fetch --locked || true

package/linux/.keep

Whitespace-only changes.

package/linux/icon.png

609 KB
Loading

0 commit comments

Comments
 (0)