Extract Build #

This commit is contained in:
Hanh 2022-12-19 04:05:07 +08:00
parent e796f74d3d
commit 885fcfa27b
9 changed files with 16 additions and 63 deletions

View File

@ -1,4 +1,4 @@
name: Build and Release name: Build and Release Android
on: on:
workflow_dispatch: workflow_dispatch:

1
.gitignore vendored
View File

@ -58,3 +58,4 @@ Icon-App-*.png
Cargo.lock Cargo.lock
.flatpak-builder/ .flatpak-builder/
build-dir/ build-dir/
lib/src/version.dart

View File

@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show rootBundle; import 'package:flutter/services.dart' show rootBundle;
import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:mustache_template/mustache.dart'; import 'package:mustache_template/mustache.dart';
import 'package:warp_api/warp_api.dart'; import 'package:warp_api/warp_api.dart';
import 'main.dart'; import 'main.dart';
import 'generated/l10n.dart'; import 'generated/l10n.dart';
import 'src/version.dart';
Future<void> showAbout(BuildContext context) async { Future<void> showAbout(BuildContext context) async {
final s = S.of(context); final s = S.of(context);
@ -15,10 +15,7 @@ Future<void> showAbout(BuildContext context) async {
final template = Template(contentTemplate); final template = Template(contentTemplate);
var content = template.renderString({'APP': APP_NAME}); var content = template.renderString({'APP': APP_NAME});
String? versionString; String? versionString;
PackageInfo packageInfo = await PackageInfo.fromPlatform(); versionString = "${s.version}: $packageVersion";
String version = packageInfo.version;
String code = packageInfo.buildNumber;
versionString = "${s.version}: $version+$code";
if (WarpApi.hasCuda()) if (WarpApi.hasCuda())
versionString += "-CUDA"; versionString += "-CUDA";
if (WarpApi.hasMetal()) if (WarpApi.hasMetal())

View File

@ -1,13 +1,13 @@
import 'dart:io'; import 'dart:io';
import 'dart:isolate'; import 'dart:isolate';
import 'dart:math'; import 'dart:math';
import 'package:YWallet/src/version.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter_foreground_task/flutter_foreground_task.dart'; import 'package:flutter_foreground_task/flutter_foreground_task.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'coin/coins.dart'; import 'coin/coins.dart';
import 'package:warp_api/warp_api.dart'; import 'package:warp_api/warp_api.dart';
import 'package:warp_api/types.dart'; import 'package:warp_api/types.dart';
@ -272,9 +272,7 @@ abstract class _Settings with Store {
c.contactsSaved = prefs.getBool("$ticker.contacts_saved") ?? true; c.contactsSaved = prefs.getBool("$ticker.contacts_saved") ?? true;
} }
final packageInfo = await PackageInfo.fromPlatform(); prefs.setString('version', packageVersion);
version = packageInfo.version;
prefs.setString('version', version);
_updateThemeData(); _updateThemeData();
Future.microtask(_loadCurrencies); // lazily Future.microtask(_loadCurrencies); // lazily

View File

@ -9,7 +9,6 @@ import audioplayers_darwin
import awesome_notifications import awesome_notifications
import connectivity_plus_macos import connectivity_plus_macos
import network_info_plus_macos import network_info_plus_macos
import package_info_plus_macos
import path_provider_macos import path_provider_macos
import share_plus_macos import share_plus_macos
import shared_preferences_macos import shared_preferences_macos
@ -21,7 +20,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AwesomeNotificationsPlugin.register(with: registry.registrar(forPlugin: "AwesomeNotificationsPlugin")) AwesomeNotificationsPlugin.register(with: registry.registrar(forPlugin: "AwesomeNotificationsPlugin"))
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin")) NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))

View File

@ -12,8 +12,6 @@ PODS:
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- network_info_plus_macos (0.0.1): - network_info_plus_macos (0.0.1):
- FlutterMacOS - FlutterMacOS
- package_info_plus_macos (0.0.1):
- FlutterMacOS
- path_provider_macos (0.0.1): - path_provider_macos (0.0.1):
- FlutterMacOS - FlutterMacOS
- ReachabilitySwift (5.0.0) - ReachabilitySwift (5.0.0)
@ -33,7 +31,6 @@ DEPENDENCIES:
- connectivity_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos`) - connectivity_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos`)
- FlutterMacOS (from `Flutter/ephemeral`) - FlutterMacOS (from `Flutter/ephemeral`)
- network_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/network_info_plus_macos/macos`) - network_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/network_info_plus_macos/macos`)
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`) - share_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/share_plus_macos/macos`)
- shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`) - shared_preferences_macos (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_macos/macos`)
@ -56,8 +53,6 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral :path: Flutter/ephemeral
network_info_plus_macos: network_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/network_info_plus_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/network_info_plus_macos/macos
package_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos
path_provider_macos: path_provider_macos:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
share_plus_macos: share_plus_macos:
@ -76,7 +71,6 @@ SPEC CHECKSUMS:
FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811 FlutterMacOS: ae6af50a8ea7d6103d888583d46bd8328a7e9811
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
network_info_plus_macos: d2b9e6c01c291449b91a584217aa53b113847dbd network_info_plus_macos: d2b9e6c01c291449b91a584217aa53b113847dbd
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19 path_provider_macos: 3c0c3b4b0d4a76d2bf989a913c2de869c5641a19
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4 share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4

View File

@ -155,6 +155,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "7.2.3" version: "7.2.3"
build_version:
dependency: "direct dev"
description:
name: build_version
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@ -853,48 +860,6 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.0.2"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.2"
package_info_plus_linux:
dependency: transitive
description:
name: package_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_macos:
dependency: transitive
description:
name: package_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
package_info_plus_web:
dependency: transitive
description:
name: package_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_windows:
dependency: transitive
description:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
palette: palette:
dependency: transitive dependency: transitive
description: description:

View File

@ -39,7 +39,6 @@ dependencies:
key_guardmanager: ^1.0.0 key_guardmanager: ^1.0.0
shared_preferences: ^2.0.7 shared_preferences: ^2.0.7
flutter_markdown: ^0.6.6 flutter_markdown: ^0.6.6
package_info_plus: ^1.4.0
velocity_x: ^3.3.0 velocity_x: ^3.3.0
decimal: ^2.1.0 decimal: ^2.1.0
flutter_form_builder: ^7.1.1 flutter_form_builder: ^7.1.1
@ -88,6 +87,7 @@ dependencies:
dev_dependencies: dev_dependencies:
build_runner: ^2.1.2 build_runner: ^2.1.2
build_version: ^2.0.0
mobx_codegen: ^2.0.3 mobx_codegen: ^2.0.3
json_serializable: ^6.1.5 json_serializable: ^6.1.5
flutter_launcher_icons: any flutter_launcher_icons: any

View File

@ -63,13 +63,13 @@ IDI_APP_ICON ICON "resources\\app.ico"
#ifdef FLUTTER_BUILD_NUMBER #ifdef FLUTTER_BUILD_NUMBER
#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
#else #else
#define VERSION_AS_NUMBER 1,2,16 #define VERSION_AS_NUMBER 1,2,17
#endif #endif
#ifdef FLUTTER_BUILD_NAME #ifdef FLUTTER_BUILD_NAME
#define VERSION_AS_STRING #FLUTTER_BUILD_NAME #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
#else #else
#define VERSION_AS_STRING "1.2.16.300" #define VERSION_AS_STRING "1.2.17.327"
#endif #endif
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO