diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ad2d57fb --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/make.dart b/make.dart index a37dd41f..e0c3b9c8 100755 --- a/make.dart +++ b/make.dart @@ -96,6 +96,7 @@ Future 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()}');