release: AppImage build (#547)

This commit is contained in:
TDJ is not adj(Tina)
2023-05-01 14:29:14 +08:00
committed by GitHub
parent ab48df4256
commit 7212c6a64c
6 changed files with 67 additions and 5 deletions

View File

@@ -176,7 +176,7 @@ jobs:
mv windows64 nekoray
zip -r $version_standalone-windows64.zip nekoray
rm -rf nekoray
- name: Pack debian
- name: Pack Debian
if: github.event.inputs.publish != 'y'
run: |
source libs/deploy_common.sh
@@ -186,9 +186,24 @@ jobs:
cp -r public_res/* windows64
rm -rf public_res *.pdb
####
sudo bash ../libs/package_debian.sh ${{ github.event.inputs.tag }}
bash ../libs/package_debian.sh ${{ github.event.inputs.tag }}
mv nekoray.deb $version_standalone-debian-x64.deb
sudo rm -rf nekoray
- name: Pack AppImage
run: |
source libs/deploy_common.sh
find . -name artifacts.tgz | xargs -n1 tar xvzf
cd deployment
cp -r public_res/* linux64
rm -rf public_res *.pdb
####
bash ../libs/package_appimage.sh
mv nekoray-x86_64.AppImage $version_standalone-linux-x64.AppImage
- name: Clean Up
run: |
cd deployment
rm -rf linux64
rm -rf windows64
- name: Uploading Artifact
uses: actions/upload-artifact@master
with:

View File

@@ -26,6 +26,8 @@ Support Windows / Linux / ~~macOS amd64~~ out of the box now.
1. AUR [nekoray-git](https://aur.archlinux.org/packages/nekoray-git)
2. Scoop extras: `scoop install nekoray`
3. Homebrew (非官方发布 / unoffical): [homebrew-nekoray](https://github.com/tdjnodj/homebrew-nekoray)
4. APT (非官方发布 / unoffical): [tdjnodj/apt](https://github.com/tdjnodj/apt)
## 更改记录 & 发布频道 / Changelog & Telegram channel
@@ -108,3 +110,4 @@ XMR
- [yaml-cpp](https://github.com/jbeder/yaml-cpp)
- [zxing-cpp](https://github.com/nu-book/zxing-cpp)
- [QHotkey](https://github.com/Skycoder42/QHotkey)
- [AppImageKit](https://github.com/AppImage/AppImageKit)

View File

@@ -18,6 +18,8 @@
1. AUR [nekoray-git](https://aur.archlinux.org/packages/nekoray-git)
2. Scoop extras: `scoop install nekoray`
3. Homebrew (unoffical): [homebrew-nekoray](https://github.com/tdjnodj/homebrew-nekoray)
4. APT (unoffical): [tdjnodj/apt](https://github.com/tdjnodj/apt)
## تغییرات برنامه و کانال تلگرام / Changelog & Telegram channel
@@ -88,3 +90,4 @@ XMR
- [yaml-cpp](https://github.com/jbeder/yaml-cpp)
- [zxing-cpp](https://github.com/nu-book/zxing-cpp)
- [QHotkey](https://github.com/Skycoder42/QHotkey)
- [AppImageKit](https://github.com/AppImage/AppImageKit)

View File

@@ -12,9 +12,13 @@ sudo apt install ./nekoray-*-debian-x64.deb
### 其他发行版
下载 .zip 文件,解压到合的路径,开箱即用。具体使用方法见下文。
下载 .zip 文件,解压到合的路径,开箱即用。
者使用 AUR `nekoray-git`
下载 .AppImage并使用 `chmod +x nekoray-*-AppImage-x64.AppImage` 给予可执行权限。
具体使用方法见下文。
或者使用 AUR `nekoray-git`
## Linux 运行

35
libs/package_appimage.sh Normal file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
sudo apt install fuse -y
cp -r linux64 nekoray.AppDir
# The file for Appimage
cat >nekoray.AppDir/nekoray.desktop<<-EOF
[Desktop Entry]
Name=nekoray
Exec=/launcher -- -appdata
Icon=nekoray
Type=Application
Categories=Network
EOF
cat >nekoray.AppDir/AppRun<<-EOF
#!/bin/bash
HERE="\$(dirname "\$(readlink -f "\${0}")")"
\${HERE}/launcher -- -appdata
EOF
chmod +x nekoray.AppDir/AppRun
# build
curl -L -O https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage nekoray.AppDir
# remove
rm appimagetool-x86_64.AppImage
rm -rf nekoray.AppDir

View File

@@ -642,7 +642,9 @@ void MainWindow::on_menu_exit_triggered() {
QDir::setCurrent(QApplication::applicationDirPath());
auto arguments = NekoRay::dataStore->argv;
if (arguments.length() > 0) arguments.removeFirst();
QProcess::startDetached(qEnvironmentVariable("NKR_FROM_LAUNCHER") == "1" ? "./launcher" : QApplication::applicationFilePath(), arguments);
auto isLauncher = qEnvironmentVariable("NKR_FROM_LAUNCHER") == "1";
if (isLauncher) arguments.prepend("--");
QProcess::startDetached(isLauncher ? "./launcher" : QApplication::applicationFilePath(), arguments);
}
tray->hide();
QCoreApplication::quit();