Skip to content

Commit

Permalink
fix: .deb build (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
pugaizai authored Nov 15, 2023
1 parent 0a05bf4 commit 848797b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 71 deletions.
39 changes: 19 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,38 +242,36 @@ jobs:
mkdir -p debian/gopeed/usr/share/applications
mkdir -p debian/gopeed/usr/share/icons/hicolor/scalable/apps
mkdir -p debian/gopeed/DEBIAN
cp -r build/linux/x64/release/bundle/* debian/gopeed/opt/gopeed/
cp assets/icon/icon_512.png debian/gopeed/usr/share/icons/hicolor/scalable/apps/gopeed.png
cp assets/icon/icon.svg debian/gopeed/usr/share/icons/hicolor/scalable/apps/com.gopeed.Gopeed.svg
cat>debian/gopeed/DEBIAN/postinst<<EOF
#!/bin/bash
ln -sf /opt/gopeed/gopeed /usr/local/bin/gopeed
ln -sf /opt/gopeed/gopeed /usr/bin/gopeed
EOF
cat>debian/gopeed/DEBIAN/postrm<<EOF
#!/bin/bash
rm -f /usr/local/bin/gopeed
current_user=\$(logname)
rm -rf /home/\$current_user/.local/share/com.gopeed
rm -rf /usr/bin/gopeed
EOF
chmod 0755 debian/gopeed/DEBIAN/postinst
chmod 0755 debian/gopeed/DEBIAN/postrm
cat>debian/gopeed/DEBIAN/control<<EOF
Package: gopeed
Version: ${VERSION:1}
Architecture: amd64
Essential: no
Priority: optional
Depends:
Depends:
Maintainer: monkeyWie
Description: High speed downloader that supports all platforms.
EOF
cp linux/gopeed.desktop debian/gopeed/usr/share/applications/gopeed.desktop
cp linux/assets/com.gopeed.Gopeed.desktop debian/gopeed/usr/share/applications/gopeed.desktop
dpkg-deb --build debian/gopeed
mv debian/gopeed.deb build/dist/Gopeed-$VERSION-linux-amd64.deb
Expand All @@ -283,16 +281,16 @@ jobs:
chmod +x appimage-builder
mkdir AppDir
cp -r build/linux/x64/release/bundle/* AppDir
mkdir -p AppDir/usr/share/icons
cp assets/icon/icon_1024.png AppDir/usr/share/icons/gopeed.png
mkdir -p AppDir/usr/share/icons/hicolor/scalable/apps/
cp assets/icon/icon.svg AppDir/usr/share/icons/hicolor/scalable/apps/gopeed.svg
cat>AppImageBuilder.yml<<EOF
version: 1
AppDir:
path: ${PWD}/AppDir
app_info:
id: com.gopeed.gopeed
name: Gopeed
icon: gopeed.png
icon: gopeed
version: ${VERSION:1}
exec: gopeed
exec_args: \$@
Expand Down Expand Up @@ -339,6 +337,7 @@ jobs:
EOF
./appimage-builder --skip-tests --recipe AppImageBuilder.yml
mv Gopeed-*-x86_64.AppImage build/dist/Gopeed-$VERSION-linux-amd64.AppImage
- name: Upload
uses: shogo82148/actions-upload-release-asset@v1
with:
Expand Down Expand Up @@ -370,7 +369,7 @@ jobs:
sudo snap install snapcraft --classic
mkdir -p snap/gui
cp assets/icon/icon_512.png snap/gui/gopeed.png
cp assets/icon/icon.svg snap/gui/gopeed.svg
cat>snap/snapcraft.yaml<<EOF
name: gopeed
Expand Down Expand Up @@ -410,9 +409,9 @@ jobs:
flutter-target: lib/main.dart
EOF
cp linux/gopeed.desktop snap/gui/gopeed.desktop
sed -i 's/Icon=gopeed/Icon=\${SNAP}\/meta\/gui\/gopeed.png/g' snap/gui/gopeed.desktop
cp linux/assets/com.gopeed.Gopeed.desktop snap/gui/gopeed.desktop
sed -i 's/Icon=com.gopeed.Gopeed/Icon=\${SNAP}\/meta\/gui\/gopeed.svg/g' snap/gui/gopeed.desktop
snapcraft --use-lxd
# Snapcraft login
Expand Down
9 changes: 9 additions & 0 deletions ui/flutter/assets/icon/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions ui/flutter/linux/assets/com.gopeed.Gopeed.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Desktop Entry]
Name=Gopeed
GenericName=Download Manager
GenericName[zh_CN]=下载器
GenericName[zh_TW]=下載器
Comment=High speed downloader that supports all platforms.
Comment[zh_CN]=支持全平台的高速下载器
Comment[zh_TW]=支持全平臺的高速下載器
Terminal=false
Exec=gopeed
Icon=com.gopeed.Gopeed
Type=Application
Categories=Utility;Internet
Keywords=Bittorrent;Downloader;
41 changes: 0 additions & 41 deletions ui/flutter/linux/com.gopeed.Gopeed.metainfo.xml

This file was deleted.

10 changes: 0 additions & 10 deletions ui/flutter/linux/gopeed.desktop

This file was deleted.

0 comments on commit 848797b

Please sign in to comment.