Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Selene 全平台构建与发布

on:
workflow_dispatch:

permissions:
contents: write

jobs:
build-linux:
name: Linux 构建
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 安装构建依赖
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config \
libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev

- name: 配置 Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: 获取依赖
run: flutter pub get

- name: 构建并打包
run: bash scripts/ci-build.sh linux

- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: selene-linux
path: build/**/selene-linux.tar.gz

build-windows:
name: Windows 构建
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: 配置 Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: 获取依赖
run: flutter pub get

- name: 构建
run: flutter build windows --release

- name: 打包
run: |
$dir = (Get-ChildItem -Path build -Recurse -Filter "runner" -Directory | Select-Object -First 1).FullName
Compress-Archive -Path "$dir\Release\*" -DestinationPath selene-windows.zip

- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: selene-windows
path: selene-windows.zip

build-apple:
name: Apple 构建 (iOS & macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: 配置 Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: 获取依赖
run: flutter pub get

- name: 构建并打包 iOS
run: bash scripts/ci-build.sh ios

- name: 构建并打包 macOS
run: bash scripts/ci-build.sh macos

- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: selene-apple
path: |
selene-ios.ipa
selene-macos.dmg

build-android:
name: Android 构建
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 配置 Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

- name: 配置 Android SDK
uses: android-actions/setup-android@v3

- name: 配置 Flutter
uses: subosito/flutter-action@v2
with:
channel: stable

- name: 获取依赖
run: flutter pub get

- name: 构建并打包
run: bash scripts/ci-build.sh android

- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: selene-android
path: build/app/outputs/flutter-apk/*.apk

release:
name: 发布到 GitHub Release
needs: [build-linux, build-windows, build-apple, build-android]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: 下载全部构建产物
uses: actions/download-artifact@v4
with:
path: artifacts

- name: 读取版本号
id: version
run: |
VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: *//' | cut -d'+' -f1)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: 创建 Release 并上传产物
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: Selene v${{ steps.version.outputs.version }}
generate_release_notes: true
files: |
artifacts/selene-android/*.apk
artifacts/selene-linux/**/*.tar.gz
artifacts/selene-windows/*.zip
artifacts/selene-apple/*.ipa
artifacts/selene-apple/*.dmg
12 changes: 4 additions & 8 deletions lib/models/search_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@ class SearchStartEvent extends SearchEvent {
SearchStartEvent({
required this.query,
required this.totalSources,
required int timestamp,
required super.timestamp,
}) : super(
type: SearchEventType.start,
timestamp: timestamp,
);

factory SearchStartEvent.fromJson(Map<String, dynamic> json) {
Expand All @@ -175,10 +174,9 @@ class SearchSourceResultEvent extends SearchEvent {
required this.source,
required this.sourceName,
required this.results,
required int timestamp,
required super.timestamp,
}) : super(
type: SearchEventType.sourceResult,
timestamp: timestamp,
);

factory SearchSourceResultEvent.fromJson(Map<String, dynamic> json) {
Expand Down Expand Up @@ -206,10 +204,9 @@ class SearchSourceErrorEvent extends SearchEvent {
required this.source,
required this.sourceName,
required this.error,
required int timestamp,
required super.timestamp,
}) : super(
type: SearchEventType.sourceError,
timestamp: timestamp,
);

factory SearchSourceErrorEvent.fromJson(Map<String, dynamic> json) {
Expand All @@ -230,10 +227,9 @@ class SearchCompleteEvent extends SearchEvent {
SearchCompleteEvent({
required this.totalResults,
required this.completedSources,
required int timestamp,
required super.timestamp,
}) : super(
type: SearchEventType.complete,
timestamp: timestamp,
);

factory SearchCompleteEvent.fromJson(Map<String, dynamic> json) {
Expand Down
1 change: 0 additions & 1 deletion lib/screens/anime_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import '../services/theme_service.dart';
import '../widgets/capsule_tab_switcher.dart';
Expand Down
12 changes: 7 additions & 5 deletions lib/screens/live_player_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,12 @@ class _LivePlayerScreenState extends State<LivePlayerScreen>
children: [
Column(
children: [
// Windows 自定义标题栏
// Windows 自定义标题栏(跟随主题)
if (Platform.isWindows)
const WindowsTitleBar(
customBackgroundColor: Color(0xFF000000),
WindowsTitleBar(
customBackgroundColor: isDarkMode
? const Color(0xFF121212)
: const Color(0xFFf5f5f5),
),
// 主要内容
Expanded(
Expand Down Expand Up @@ -1809,8 +1811,8 @@ class _LivePlayerScreenState extends State<LivePlayerScreen>
Container(
width: 4,
height: 4,
decoration: BoxDecoration(
color: const Color(0xFF27ae60),
decoration: const BoxDecoration(
color: Color(0xFF27ae60),
shape: BoxShape.circle,
),
),
Expand Down
Loading