Skip to content

Commit

Permalink
Merge pull request #3 from guchengxi1994/master
Browse files Browse the repository at this point in the history
release
  • Loading branch information
guchengxi1994 authored Apr 16, 2024
2 parents 0e89a19 + c9564e5 commit 039f372
Show file tree
Hide file tree
Showing 27 changed files with 11,699 additions and 1,151 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build Linux App

on:
push:
branches:
- release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.19.5

- name: Cache pubspec
id: cache-pubspec
uses: actions/cache@v3
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: pubspec-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
pubspec-
- name: Get dependencies
run: flutter pub get

- name: Bump build number
run: |
flutter pub global activate cider
- name: Build Linux app
run: flutter build linux --release

- name: Set tag name
run: echo "tag_name=v$(cider version)" >> $env:GITHUB_ENV

- name: List files in build directory
run: ls -la build/linux/release/bundle

# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: linux-app
# path: build/linux/release/bundle/

- name: Archive release
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'linux.zip'
directory: build/linux/release/bundle/

- name: Publish release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: build/linux/release/bundle/linux.zip
generateReleaseNotes: true
tag: ${{ env.tag_name }}
token: ${{ secrets.RELEASE_TOKEN }}
2 changes: 2 additions & 0 deletions lib/app/windows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:icons_plus/icons_plus.dart';
import 'package:window_manager/window_manager.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:all_in_one/src/rust/api/software_monitor_api.dart' as smapi;
import 'package:all_in_one/src/rust/api/sub_window_api.dart' as sw;
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';

void runWindowsAPP() async {
Expand Down Expand Up @@ -58,6 +59,7 @@ class __LauoutState extends ConsumerState<_Lauout> {
initStream() {
scheduleStream.listen((event) {
logger.info("events $event");
sw.showTodos(data: []);
});

stream.listen((event) {
Expand Down
3 changes: 3 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:all_in_one/app/windows.dart';
import 'package:all_in_one/isar/database.dart';
import 'package:all_in_one/isar/software.dart';
import 'package:all_in_one/src/rust/api/software_monitor_api.dart' as smapi;
import 'package:all_in_one/src/rust/api/sub_window_api.dart' as sw;
import 'package:all_in_one/src/rust/api/system_monitor_api.dart' as sm;
import 'package:all_in_one/src/rust/frb_generated.dart';
import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -46,6 +47,8 @@ Future<void> main() async {

sm.startSystemMonitor();

sw.createEventLoop();

if (Platform.isWindows) {
runWindowsAPP();
}
Expand Down
35 changes: 35 additions & 0 deletions lib/src/rust/api/sub_window_api.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.31.

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

// The type `_PinWindowItem` is not used by any `pub` functions, thus it is ignored.

Future<void> createEventLoop({dynamic hint}) =>
RustLib.instance.api.createEventLoop(hint: hint);

Future<void> showTodos(
{required List<RustSimpleNotifyLibPinWindowItem> data, dynamic hint}) =>
RustLib.instance.api.showTodos(data: data, hint: hint);

// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::rust_async::RwLock<rust_simple_notify_lib :: PinWindowItem>>
@sealed
class RustSimpleNotifyLibPinWindowItem extends RustOpaque {
RustSimpleNotifyLibPinWindowItem.dcoDecode(List<dynamic> wire)
: super.dcoDecode(wire, _kStaticData);

RustSimpleNotifyLibPinWindowItem.sseDecode(int ptr, int externalSizeOnNative)
: super.sseDecode(ptr, externalSizeOnNative, _kStaticData);

static final _kStaticData = RustArcStaticData(
rustArcIncrementStrongCount: RustLib.instance.api
.rust_arc_increment_strong_count_RustSimpleNotifyLibPinWindowItem,
rustArcDecrementStrongCount: RustLib.instance.api
.rust_arc_decrement_strong_count_RustSimpleNotifyLibPinWindowItem,
rustArcDecrementStrongCountPtr: RustLib.instance.api
.rust_arc_decrement_strong_count_RustSimpleNotifyLibPinWindowItemPtr,
);
}
Loading

0 comments on commit 039f372

Please sign in to comment.