mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
Add github action
This commit is contained in:
36
.github/workflows/release.yml
vendored
Normal file
36
.github/workflows/release.yml
vendored
Normal 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
|
||||||
@@ -96,6 +96,7 @@ Future<void> flutterBuild(String source, String target, bool isAndroid) async {
|
|||||||
} else {
|
} else {
|
||||||
print(buildResult.stderr.toString());
|
print(buildResult.stderr.toString());
|
||||||
print('\nBuild failed with exit code $exitCode');
|
print('\nBuild failed with exit code $exitCode');
|
||||||
|
exit(exitCode);
|
||||||
}
|
}
|
||||||
final endTime = DateTime.now();
|
final endTime = DateTime.now();
|
||||||
print('Spent time: ${endTime.difference(startTime).toString()}');
|
print('Spent time: ${endTime.difference(startTime).toString()}');
|
||||||
|
|||||||
Reference in New Issue
Block a user