-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
@@ -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/[email protected] | ||
with: | ||
name: ${{ env.ver_name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |