Skip to content
Draft
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
173 changes: 0 additions & 173 deletions .github/workflows/FlutterBuild.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/FlutterBuildTest.yml

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

何意味?

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/build-apk.yml

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你删了原本的测试代码是过不了pr合并检查的。而且代码规范检查应该放另一个测试单元里,不适合和构建放一起

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你原本那边的action不通过是因为你没有设置secret环境变量。我原本action构建apk中使用了自己的签名,而在你的仓库下没有相应的签名环境变量所以才会fail。

正确的解决方案是
你先rebase消除对构建文件的修改或者回滚那次修改
你自己生成自己的一份apk签名
参考我原本构建apk的命令中的环境变量名,设置你github仓库的secret环境变量

你这样直接build的发布,每次签名都不同,会导致软件不能正常更新。

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build & Release Dev APK


on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout 代码
uses: actions/checkout@v4

- name: 配置 Java 环境
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: 配置 Flutter 环境
uses: subosito/flutter-action@v2
with:
flutter-version: '3.41.2'
channel: 'stable'
cache: true

- name: 安装依赖
run: flutter pub get

- name: 代码分析
run: flutter analyze --no-fatal-infos

- name: 构建 APK
run: flutter build apk --release

- name: 发布 GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: dev-${{ github.run_number }}
name: "Dev Build #${{ github.run_number }}"
body: |
自动构建版本
- 分支:${{ github.ref_name }}
- Commit:${{ github.sha }}
files: build/app/outputs/flutter-apk/app-release.apk
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 13 additions & 6 deletions lib/funcs/fsrs_func.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ class FSRSConfig {
final bool selfEvaluate;
final int pushAmount;
final bool reinforceMemory;
final List<String> selectedSources;

const FSRSConfig({
bool? enabled,
Expand All @@ -176,7 +177,8 @@ class FSRSConfig {
bool? preferSimilar,
bool? selfEvaluate,
int? pushAmount,
bool? reinforceMemory
bool? reinforceMemory,
List<String>? selectedSources
}) :
enabled = enabled??false,
cards = cards??const [],
Expand All @@ -187,7 +189,8 @@ class FSRSConfig {
preferSimilar = preferSimilar??false,
selfEvaluate = selfEvaluate??false,
pushAmount = pushAmount??0,
reinforceMemory = reinforceMemory??false;
reinforceMemory = reinforceMemory??false,
selectedSources = selectedSources??const [];

Map<String, dynamic> toMap(){
return {
Expand All @@ -201,7 +204,8 @@ class FSRSConfig {
"preferSimilar": preferSimilar,
"selfEvaluate": selfEvaluate,
"pushAmount": pushAmount,
"reinforceMemory": reinforceMemory
"reinforceMemory": reinforceMemory,
"selectedSources": selectedSources
};
}

Expand All @@ -216,7 +220,8 @@ class FSRSConfig {
bool? preferSimilar,
bool? selfEvaluate,
int? pushAmount,
bool? reinforceMemory
bool? reinforceMemory,
List<String>? selectedSources
}) {
return FSRSConfig(
enabled: enabled??this.enabled,
Expand All @@ -229,7 +234,8 @@ class FSRSConfig {
preferSimilar: preferSimilar??this.preferSimilar,
selfEvaluate: selfEvaluate??this.selfEvaluate,
pushAmount: pushAmount??this.pushAmount,
reinforceMemory: reinforceMemory??this.reinforceMemory
reinforceMemory: reinforceMemory??this.reinforceMemory,
selectedSources: selectedSources??this.selectedSources
);
}

Expand All @@ -246,7 +252,8 @@ class FSRSConfig {
preferSimilar: configData["preferSimilar"],
selfEvaluate: configData["selfEvaluate"],
pushAmount: configData["pushAmount"],
reinforceMemory: configData["reinforceMemory"]
reinforceMemory: configData["reinforceMemory"],
selectedSources: configData["selectedSources"] == null ? const [] : List<String>.from(configData["selectedSources"])
);
}
return FSRSConfig(enabled: false);
Expand Down
Loading
Loading