mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 12:34:37 +03:00
release: AppImage build (#547)
This commit is contained in:
committed by
GitHub
parent
ab48df4256
commit
7212c6a64c
19
.github/workflows/build-qv2ray-cmake.yml
vendored
19
.github/workflows/build-qv2ray-cmake.yml
vendored
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
35
libs/package_appimage.sh
Normal 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
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user