new: windows release actions

This commit is contained in:
lollipopkit
2024-06-02 15:29:53 +08:00
parent d1f14bee59
commit b06fddec07
12 changed files with 70 additions and 104 deletions

View File

@@ -40,23 +40,25 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# releaseWin: releaseWin:
# name: Release windows name: Release windows
# runs-on: windows-latest runs-on: windows-latest
# steps: steps:
# - name: Checkout - name: Checkout
# uses: actions/checkout@v4 uses: actions/checkout@v4
# - name: Install Flutter with:
# uses: subosito/flutter-action@v2 fetch-depth: '0'
# - name: Build - name: Install Flutter
# run: dart run fl_build -p windows uses: subosito/flutter-action@v2
# - name: Create Release - name: Build
# uses: softprops/action-gh-release@v1 run: dart run fl_build -p windows
# with: - name: Create Release
# files: | uses: softprops/action-gh-release@v1
# ${{ env.APP_NAME }}_amd64_windows.zip with:
# env: files: |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_windows_amd64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# releaseApple: # releaseApple:
# name: Release ios and macos # name: Release ios and macos

View File

@@ -15,8 +15,9 @@ Especially thanks to <a href="https://github.com/TerminalStudio/dartssh2">dartss
</p> </p>
## ⬇️ Download ## ⬇️ Download
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://cdn.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703): Full support with my own certificate 🎉 **The `Android / Linux / Windows` version are now built via GitHub Actions**
[Linux](https://cdn.lolli.tech/serverbox/latest.AppImage) / [Windows](https://cdn.lolli.tech/serverbox/latest.win.zip): Basically tested, with debug certificate
[iOS & macOS](https://apps.apple.com/app/id6476033062) / [Android & Linux & Windows](https://github.com/lollipopkit/flutter_gpt_box/releases)
## 🔖 Feature ## 🔖 Feature

View File

@@ -16,8 +16,9 @@
## ⬇️ Download ## ⬇️ Download
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://cdn.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703): 经过测试,使用自签名证书 🎉 **现在 `Android / Linux / Windows` 版本使用 GitHub Actions 构建**
[Linux](https://cdn.lolli.tech/serverbox/latest.AppImage) / [Windows](https://cdn.lolli.tech/serverbox/latest.win.zip): 经过不完全测试,使用调试证书
[iOS & macOS](https://apps.apple.com/app/id1586449703) / [Android & Linux & Windows](https://github.com/lollipopkit/flutter_gpt_box/releases)
## 🔖 特点 ## 🔖 特点

View File

@@ -1175,7 +1175,7 @@ class _SettingPageState extends State<SettingPage> {
autoFocus: true, autoFocus: true,
hint: 'https://example.com/logo.png', hint: 'https://example.com/logo.png',
icon: Icons.link, icon: Icons.link,
maxLines: 3, maxLines: 2,
onSubmitted: onSave, onSubmitted: onSave,
), ),
ListTile( ListTile(

View File

@@ -494,7 +494,8 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
onPressed: () async { onPressed: () async {
context.pop(); context.pop();
try { try {
await context.showLoadingDialog(fn: () async { await context.showLoadingDialog(
fn: () async {
final remotePath = _getRemotePath(file); final remotePath = _getRemotePath(file);
if (useRmr) { if (useRmr) {
await _client!.run('rm -r "$remotePath"'); await _client!.run('rm -r "$remotePath"');
@@ -503,10 +504,12 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
} else { } else {
await _status.client!.remove(remotePath); await _status.client!.remove(remotePath);
} }
}); },
onErr: (e, s) {},
);
_listDir(); _listDir();
} catch (e, s) { } catch (e, s) {
_showErrDialog(context, e, 'Delete', s); context.showErrDialog(e: e, s: s, operation: l10n.delete);
} }
}, },
child: Text(l10n.delete, style: UIs.textRed), child: Text(l10n.delete, style: UIs.textRed),
@@ -547,13 +550,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
} }
context.pop(); context.pop();
try { try {
await context.showLoadingDialog(fn: () async { await context.showLoadingDialog(
fn: () async {
final dir = '${_status.path!.path}/${textController.text}'; final dir = '${_status.path!.path}/${textController.text}';
await _status.client!.mkdir(dir); await _status.client!.mkdir(dir);
}); },
onErr: (e, s) {},
);
_listDir(); _listDir();
} catch (e, s) { } catch (e, s) {
_showErrDialog(context, e, 'Create folder', s); context.showErrDialog(e: e, s: s, operation: l10n.createFolder);
} }
}, },
child: Text(l10n.ok, style: UIs.textRed), child: Text(l10n.ok, style: UIs.textRed),
@@ -591,13 +597,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
} }
context.pop(); context.pop();
try { try {
await context.showLoadingDialog(fn: () async { await context.showLoadingDialog(
fn: () async {
final path = '${_status.path!.path}/${textController.text}'; final path = '${_status.path!.path}/${textController.text}';
await _client!.run('touch "$path"'); await _client!.run('touch "$path"');
}); },
onErr: (e, s) {},
);
_listDir(); _listDir();
} catch (e, s) { } catch (e, s) {
_showErrDialog(context, e, 'Create file', s); context.showErrDialog(e: e, s: s, operation: l10n.createFile);
} }
}, },
child: Text(l10n.ok, style: UIs.textRed), child: Text(l10n.ok, style: UIs.textRed),
@@ -636,13 +645,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
} }
context.pop(); context.pop();
try { try {
await context.showLoadingDialog(fn: () async { await context.showLoadingDialog(
fn: () async {
final newName = textController.text; final newName = textController.text;
await _status.client?.rename(file.filename, newName); await _status.client?.rename(file.filename, newName);
}); },
onErr: (e, s) {},
);
_listDir(); _listDir();
} catch (e, s) { } catch (e, s) {
_showErrDialog(context, e, 'Rename', s); context.showErrDialog(e: e, s: s, operation: l10n.rename);
} }
}, },
child: Text(l10n.rename, style: UIs.textRed), child: Text(l10n.rename, style: UIs.textRed),
@@ -672,29 +684,6 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
_listDir(); _listDir();
} }
Future<void> _showErrDialog(
BuildContext ctx, Object e, String op, StackTrace s) async {
Loggers.app.warning('$op failed', e, s);
return ctx.showRoundDialog(
title: l10n.error,
child: SingleChildScrollView(
child: Column(
children: [
Text(e.toString()),
const SizedBox(height: 7),
SimpleMarkdown(data: s.toString()),
],
),
),
actions: [
TextButton(
onPressed: () => ctx.pop(),
child: Text(l10n.ok),
),
],
);
}
String _getRemotePath(SftpName name) { String _getRemotePath(SftpName name) {
final prePath = _status.path!.path; final prePath = _status.path!.path;
// Only support Linux as remote now, so the seperator is '/' // Only support Linux as remote now, so the seperator is '/'

View File

@@ -7,7 +7,6 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h> #include <dynamic_color/dynamic_color_plugin.h>
#include <gtk/gtk_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h> #include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h> #include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h> #include <window_manager/window_manager_plugin.h>
@@ -16,9 +15,6 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) dynamic_color_registrar = g_autoptr(FlPluginRegistrar) dynamic_color_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
dynamic_color_plugin_register_with_registrar(dynamic_color_registrar); dynamic_color_plugin_register_with_registrar(dynamic_color_registrar);
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar = g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);

View File

@@ -4,7 +4,6 @@
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color dynamic_color
gtk
screen_retriever screen_retriever
url_launcher_linux url_launcher_linux
window_manager window_manager

View File

@@ -5,7 +5,6 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import app_links
import device_info_plus import device_info_plus
import dynamic_color import dynamic_color
import icloud_storage import icloud_storage
@@ -19,7 +18,6 @@ import wakelock_plus
import window_manager import window_manager
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin")) DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
IcloudStoragePlugin.register(with: registry.registrar(forPlugin: "IcloudStoragePlugin")) IcloudStoragePlugin.register(with: registry.registrar(forPlugin: "IcloudStoragePlugin"))

View File

@@ -33,14 +33,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.2" version: "2.0.2"
app_links:
dependency: transitive
description:
name: app_links
sha256: "96e677810b83707ff5e10fac11e4839daa0ea4e0123c35864c092699165eb3db"
url: "https://pub.dev"
source: hosted
version: "6.1.1"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@@ -392,8 +384,8 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
path: "." path: "."
ref: "v1.0.11" ref: "v1.0.13"
resolved-ref: ead58f6e985600c03cd27fb6563c10b6afa2d640 resolved-ref: baded8103bd046806929b8d6547d5bce38060b06
url: "https://github.com/lppcg/fl_build.git" url: "https://github.com/lppcg/fl_build.git"
source: git source: git
version: "1.0.0" version: "1.0.0"
@@ -409,8 +401,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "v1.0.27" ref: "v1.0.29"
resolved-ref: "7f329a63eff761bbb2013d4865515a4aeaecf3e8" resolved-ref: "674d5b3fccd1ae29c2739f119e34719874186587"
url: "https://github.com/lppcg/fl_lib" url: "https://github.com/lppcg/fl_lib"
source: git source: git
version: "0.0.1" version: "0.0.1"
@@ -570,14 +562,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.1" version: "2.3.1"
gtk:
dependency: transitive
description:
name: gtk
sha256: e8ce9ca4b1df106e4d72dad201d345ea1a036cc12c360f1a7d5a758f78ffa42c
url: "https://pub.dev"
source: hosted
version: "2.1.0"
highlight: highlight:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@@ -53,7 +53,7 @@ dependencies:
fl_lib: fl_lib:
git: git:
url: https://github.com/lppcg/fl_lib url: https://github.com/lppcg/fl_lib
ref: v1.0.27 ref: v1.0.29
dependency_overrides: dependency_overrides:
# dartssh2: # dartssh2:
@@ -74,7 +74,7 @@ dev_dependencies:
# path: ../fl_build # path: ../fl_build
git: git:
url: https://github.com/lppcg/fl_build.git url: https://github.com/lppcg/fl_build.git
ref: v1.0.11 ref: v1.0.13
flutter: flutter:
generate: true generate: true

View File

@@ -6,7 +6,6 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <app_links/app_links_plugin_c_api.h>
#include <dynamic_color/dynamic_color_plugin_c_api.h> #include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <local_auth_windows/local_auth_plugin.h> #include <local_auth_windows/local_auth_plugin.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
@@ -16,8 +15,6 @@
#include <window_manager/window_manager_plugin.h> #include <window_manager/window_manager_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
AppLinksPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AppLinksPluginCApi"));
DynamicColorPluginCApiRegisterWithRegistrar( DynamicColorPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
LocalAuthPluginRegisterWithRegistrar( LocalAuthPluginRegisterWithRegistrar(

View File

@@ -3,7 +3,6 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
app_links
dynamic_color dynamic_color
local_auth_windows local_auth_windows
permission_handler_windows permission_handler_windows