Add github action

This commit is contained in:
LollipopKit
2021-10-30 12:21:39 +08:00
parent 434ef77c03
commit 702dd86a84
2 changed files with 37 additions and 0 deletions

36
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: Release Apk
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '2.5.3'
- run: flutter pub get
- run: wget "${{secrets.KEY_FILE_URL}}" > android/app/fjy.androidstudio.key
- run: wget "${{secrets.KEY_PROP_URL}}" > android/key.properties
- run: ./make.dart build android
- run: echo "APP_VER=$(git log --oneline | wc -l | xargs)" >> $GITHUB_ENV
- uses: actions/upload-artifact@v1
with:
name: Release Apk
path: release/Toolbox_${{ env.APP_VER }}_Arm64.apk

View File

@@ -96,6 +96,7 @@ Future<void> flutterBuild(String source, String target, bool isAndroid) async {
} else {
print(buildResult.stderr.toString());
print('\nBuild failed with exit code $exitCode');
exit(exitCode);
}
final endTime = DateTime.now();
print('Spent time: ${endTime.difference(startTime).toString()}');