Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Jan 16, 2024
1 parent 968fdce commit e1f5435
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 29 deletions.
30 changes: 4 additions & 26 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ jobs:
# 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks
echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/android/app/key.jks
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
id: gradle
run: ./gradlew assembleRelease -build-cache --parallel --daemon --warning-mode all
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.7'
- run: flutter build apk --split-per-abi --release

- name: Upload missing_rules.txt
if: failure() && steps.gradle.outcome != 'success'
Expand All @@ -101,27 +100,6 @@ jobs:
run: |
echo "ver_name=$(grep -m 1 'versionName' ${{ env.output }}/output-metadata.json | cut -d\" -f4)" >> $GITHUB_ENV
- name: Upload App To Artifact arm64-v8a
if: success () || failure ()
uses: actions/upload-artifact@v3
with:
name: "AListAndroid-v${{ env.ver_name }}_arm64-v8a"
path: "${{ env.output }}/*-v8a.apk"

- name: Upload App To Artifact arm-v7a
if: success () || failure ()
uses: actions/upload-artifact@v3
with:
name: "AListAndroid-v${{ env.ver_name }}_arm-v7a"
path: "${{ env.output }}/*-v7a.apk"

- name: Upload App To Artifact x86
if: success () || failure ()
uses: actions/upload-artifact@v3
with:
name: "AListAndroid-v${{ env.ver_name }}_x86"
path: "${{ env.output }}/*_x86.apk"

- uses: softprops/action-gh-release@v0.1.15
with:
name: ${{ env.ver_name }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
release
6 changes: 3 additions & 3 deletions lib/pages/alist/alist.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:developer';

import 'package:alist_flutter/generated_api.dart';
import 'package:alist_flutter/pages/alist/pwd_edit_dialog.dart';
import 'package:alist_flutter/widgets/switch_floating_action_button.dart';
Expand Down Expand Up @@ -31,7 +29,9 @@ class AListScreen extends StatelessWidget {
showDialog(
context: context,
builder: (context) => PwdEditDialog(onConfirm: (pwd) {
log("pwd: $pwd");
Get.showSnackbar(GetSnackBar(
message: "admin 密码修改为:$pwd",
duration: const Duration(seconds: 1)));
Android().setAdminPwd(pwd);
}));
},
Expand Down
29 changes: 29 additions & 0 deletions lib/utils/UpdateChecker.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'dart:js_interop_unsafe';

import 'package:get/get_connect/http/src/response/response.dart';

class UpdateChecker {
static Future<bool> checkForUpdate() async {
final version = Android().getVersion
final PackageInfo info = await PackageInfo.fromPlatform();
final String currentVersion = info.version;
final String url =
'https://raw.githubusercontent.com/iamSahdeep/liquid_swipe_flutter/master/pubspec.yaml';
try {
final http.Response response = await http.get(url);
if (response.statusCode == 200) {
final String body = response.body;
final List<String> list = body.split('\n');
final String latestVersion = list
.firstWhere((String element) => element.contains('version'))
.split(': ')[1];
if (currentVersion.compareTo(latestVersion) < 0) {
return true;
}
}
} catch (e) {
print(e);
}
return false;
}
}

0 comments on commit e1f5435

Please sign in to comment.