new: linux build

This commit is contained in:
lollipopkit
2023-10-14 19:13:45 +08:00
parent 9a4a7cef4c
commit 43506e19f1
6 changed files with 102 additions and 40 deletions

4
.gitignore vendored
View File

@@ -52,3 +52,7 @@ test.dart
# Keep generated l10n files
/.dart_tool/*
!/.dart_tool/flutter_gen
# Linux release
ServerBox.AppDir
ServerBox-x86_64.AppImage

View File

@@ -1,4 +1,5 @@
English | [简体中文](README_zh.md)
<!-- Title-->
<p align="center">
<img src="imgs/flutter_server_box.png">
@@ -6,18 +7,26 @@ English | [简体中文](README_zh.md)
<!-- Badges-->
<p align="center">
<a href="https://apps.apple.com/app/id1586449703">
<img style="height: 37px" src="imgs/appstore.svg">
</a>
<a href="https://count.ly/f/badge" rel="nofollow">
<img style="height: 37px" src="https://count.ly/badges/dark.svg">
</a>
<a href="https://github.com/lollipopkit/flutter_server_box/releases/latest">
<img style="height: 37px" src="imgs/dl-android.svg">
</a>
</p>
<p align="center" style="font-weight: bold">Due to Chinese government policy and the <a href="https://github.com/lollipopkit/flutter_server_box/discussions/180">BEIAN</a> issue. ServerBox is now free. Please download it from other regions.</p>
<!-- Download -->
<p align="center">
Download
<a href="https://apps.apple.com/app/id1586449703">iOS</a>
/
<a href="https://res.lolli.tech/serverbox/latest.apk">Android</a>
/
<a href="https://apps.apple.com/app/id1586449703">macOS</a>
/
<a href="https://res.lolli.tech/serverbox/latest.AppImage">Linux</a>
/
Windows (In progress)
</p>
<p align="center" style="font-weight: bold; color: cyan">Due to Chinese government policy and the <a href="https://github.com/lollipopkit/flutter_server_box/discussions/180">BEIAN</a> issue. iOS app is now free. Please download it from other regions of AppStore.</p>
<p align="center">
A Flutter project which provide charts to display <a href="../../issues/43">Linux</a> server status and tools to manage server.

View File

@@ -1,4 +1,5 @@
简体中文 | [English](README.md)
<!-- Title-->
<p align="center">
<img src="imgs/flutter_server_box.png">
@@ -6,23 +7,31 @@
<!-- Badges-->
<p align="center">
<a href="https://apps.apple.com/app/id1586449703">
<img style="height: 37px" src="imgs/appstore.svg">
</a>
<a href="https://count.ly/f/badge" rel="nofollow">
<img style="height: 37px" src="https://count.ly/badges/dark.svg">
</a>
<a href="https://github.com/lollipopkit/flutter_server_box/releases/latest">
<img style="height: 37px" src="imgs/dl-android.svg">
</a>
</p>
<p align="center" style="font-weight: bold">由于中国政策原因,且无法完成<a href="https://github.com/lollipopkit/flutter_server_box/discussions/180">备案</a>。现已转为免费,请移步其他区下载。</p>
<!-- Download -->
<p align="center">
下载:
<a href="https://apps.apple.com/app/id1586449703">iOS</a>
/
<a href="https://res.lolli.tech/serverbox/latest.apk">Android</a>
/
<a href="https://apps.apple.com/app/id1586449703">macOS</a>
/
<a href="https://res.lolli.tech/serverbox/latest.AppImage">Linux</a>
/
Windows (暂未发布)
</p>
<p align="center" style="font-weight: bold; color: cyan">由于中国政策原因,且无法完成<a href="https://github.com/lollipopkit/flutter_server_box/discussions/180">备案</a>。iOS 端现已转为免费,请移步 AppStore 其他区下载。</p>
<p align="center">
使用 Flutter 开发的 <a href="../../issues/43">Linux</a> 服务器工具箱,提供服务器状态图表和管理工具。
<br>
特别感谢 <a href="https://github.com/TerminalStudio/dartssh2">dartssh2</a> & <a href="https://github.com/TerminalStudio/xterm.dart">xterm.dart</a>.
特别感谢 <a href="https://github.com/TerminalStudio/dartssh2">dartssh2</a> & <a href="https://github.com/TerminalStudio/xterm.dart">xterm.dart</a>
</p>

View File

@@ -586,7 +586,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -596,7 +596,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -720,7 +720,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -730,7 +730,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -748,7 +748,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
@@ -758,7 +758,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -779,7 +779,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
@@ -792,7 +792,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
@@ -818,7 +818,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
@@ -831,7 +831,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -854,7 +854,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_TEAM = BA88US33G6;
GCC_C_LANGUAGE_STANDARD = gnu11;
GENERATE_INFOPLIST_FILE = YES;
@@ -867,7 +867,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.StatusWidget;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -890,7 +890,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
@@ -902,7 +902,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
@@ -931,7 +931,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
@@ -943,7 +943,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;
@@ -969,7 +969,7 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 589;
CURRENT_PROJECT_VERSION = 590;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_PREVIEWS = YES;
@@ -981,7 +981,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.589;
MARKETING_VERSION = 1.0.590;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox.WatchEnd;
PRODUCT_NAME = ServerBox;

View File

@@ -2,9 +2,9 @@
class BuildData {
static const String name = "ServerBox";
static const int build = 589;
static const int build = 590;
static const String engine = "3.13.6";
static const String buildAt = "2023-10-14 12:09:35";
static const int modifications = 6;
static const String buildAt = "2023-10-14 13:29:43";
static const int modifications = 1;
static const int script = 21;
}

View File

@@ -155,7 +155,47 @@ Future<void> flutterBuildAndroid() async {
Future<void> flutterBuildLinux() async {
await flutterBuild('linux');
// mkdir ServerBox.AppDir
await Process.run('mkdir', ['ServerBox.AppDir']);
// cp -r build/linux/x64/release/bundle/* ServerBox.AppDir
await Process.run('cp', [
'-r',
'./build/linux/x64/release/bundle/*',
'ServerBox.AppDir',
]);
// cp -r assets/app_icon.png ServerBox.AppDir
await Process.run('cp', [
'-r',
'./assets/app_icon.png',
'ServerBox.AppDir',
]);
// Create AppRun
const appRun = '''
#!/bin/sh
cd "\$(dirname "\$0")"
exec ./ServerBox
''';
await File('ServerBox.AppDir/AppRun').writeAsString(appRun);
// chmod +x AppRun
await Process.run('chmod', ['+x', 'ServerBox.AppDir/AppRun']);
// Create .desktop
const desktop = '''
[Desktop Entry]
Name=ServerBox
Exec=ServerBox
Icon=app_icon
Type=Application
Categories=Network;
''';
await File('ServerBox.AppDir/ServerBox.desktop').writeAsString(desktop);
// Run appimagetool
await Process.run('appimagetool', ['ServerBox.AppDir']);
await scpLinux2CDN();
// Clean build files
await Process.run('rm', ['-r', 'ServerBox.AppDir']);
await Process.run('rm', ['ServerBox-x86_64.AppImage']);
}
Future<void> flutterBuildWin() async {
@@ -181,8 +221,8 @@ Future<void> scpLinux2CDN() async {
final result = await Process.run(
'scp',
[
'./build/linux/x64/release/bundle/server_box.tar.gz',
'hk:/var/www/res/serverbox/$build.tar.gz',
'ServerBox-x86_64.AppImage',
'hk:/var/www/res/serverbox/$build.AppImage',
],
runInShell: true,
);
@@ -190,7 +230,7 @@ Future<void> scpLinux2CDN() async {
print(result.stderr);
exit(1);
}
print('Upload Linux $build.tar.gz finished.');
print('Upload $build.AppImage finished.');
}
Future<void> scpWindows2CDN() async {