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

View File

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

View File

@@ -16,8 +16,9 @@
## ⬇️ Download
[iOS](https://apps.apple.com/app/id1586449703) / [Android](https://cdn.lolli.tech/serverbox/latest.apk) / [macOS](https://apps.apple.com/app/id1586449703): 经过测试,使用自签名证书
[Linux](https://cdn.lolli.tech/serverbox/latest.AppImage) / [Windows](https://cdn.lolli.tech/serverbox/latest.win.zip): 经过不完全测试,使用调试证书
🎉 **现在 `Android / Linux / Windows` 版本使用 GitHub Actions 构建**
[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,
hint: 'https://example.com/logo.png',
icon: Icons.link,
maxLines: 3,
maxLines: 2,
onSubmitted: onSave,
),
ListTile(

View File

@@ -494,19 +494,22 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
onPressed: () async {
context.pop();
try {
await context.showLoadingDialog(fn: () async {
final remotePath = _getRemotePath(file);
if (useRmr) {
await _client!.run('rm -r "$remotePath"');
} else if (file.attr.isDirectory) {
await _status.client!.rmdir(remotePath);
} else {
await _status.client!.remove(remotePath);
}
});
await context.showLoadingDialog(
fn: () async {
final remotePath = _getRemotePath(file);
if (useRmr) {
await _client!.run('rm -r "$remotePath"');
} else if (file.attr.isDirectory) {
await _status.client!.rmdir(remotePath);
} else {
await _status.client!.remove(remotePath);
}
},
onErr: (e, s) {},
);
_listDir();
} catch (e, s) {
_showErrDialog(context, e, 'Delete', s);
context.showErrDialog(e: e, s: s, operation: l10n.delete);
}
},
child: Text(l10n.delete, style: UIs.textRed),
@@ -547,13 +550,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
}
context.pop();
try {
await context.showLoadingDialog(fn: () async {
final dir = '${_status.path!.path}/${textController.text}';
await _status.client!.mkdir(dir);
});
await context.showLoadingDialog(
fn: () async {
final dir = '${_status.path!.path}/${textController.text}';
await _status.client!.mkdir(dir);
},
onErr: (e, s) {},
);
_listDir();
} 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),
@@ -591,13 +597,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
}
context.pop();
try {
await context.showLoadingDialog(fn: () async {
final path = '${_status.path!.path}/${textController.text}';
await _client!.run('touch "$path"');
});
await context.showLoadingDialog(
fn: () async {
final path = '${_status.path!.path}/${textController.text}';
await _client!.run('touch "$path"');
},
onErr: (e, s) {},
);
_listDir();
} 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),
@@ -636,13 +645,16 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
}
context.pop();
try {
await context.showLoadingDialog(fn: () async {
final newName = textController.text;
await _status.client?.rename(file.filename, newName);
});
await context.showLoadingDialog(
fn: () async {
final newName = textController.text;
await _status.client?.rename(file.filename, newName);
},
onErr: (e, s) {},
);
_listDir();
} catch (e, s) {
_showErrDialog(context, e, 'Rename', s);
context.showErrDialog(e: e, s: s, operation: l10n.rename);
}
},
child: Text(l10n.rename, style: UIs.textRed),
@@ -672,29 +684,6 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
_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) {
final prePath = _status.path!.path;
// Only support Linux as remote now, so the seperator is '/'

View File

@@ -7,7 +7,6 @@
#include "generated_plugin_registrant.h"
#include <dynamic_color/dynamic_color_plugin.h>
#include <gtk/gtk_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <url_launcher_linux/url_launcher_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 =
fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin");
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 =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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