UPDATE: Handle if the Build is Failed #4
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
name: Flutter CI | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build and Release apk | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '12.x' | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v1 | |
with: | |
channel: 'beta' | |
- name: Get Flutter Dependencies | |
run: flutter pub get | |
- name: Flutter testing | |
run: flutter test | |
- name: Build APK | |
run: flutter build apk --release --split-per-abi | |
- name: Push to Releases | |
if: success() # This ensures the previous steps must succeed | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/app/outputs/apk/release/*" | |
tag: v1.0.${{ github.run_number }} | |
token: ${{ secrets.GITHUB_TOKEN }} |