build.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: CI
  2. on:
  3. push:
  4. branches: [ master , main]
  5. pull_request:
  6. branches: [ master , main]
  7. jobs:
  8. build:
  9. strategy:
  10. matrix:
  11. os: [ubuntu-latest]
  12. runs-on: ${{matrix.os}}
  13. steps:
  14. - uses: actions/checkout@v2
  15. - name: Setup Java JDK
  16. uses: actions/setup-java@v2
  17. with:
  18. distribution: 'adopt'
  19. java-version: "11"
  20. - name: Flutter action
  21. uses: subosito/flutter-action@v1.5.3
  22. with:
  23. channel: "stable"
  24. flutter-version: "2.5.2"
  25. - name: Cache Dependencies
  26. id: cache
  27. uses: actions/cache@v2
  28. with:
  29. path: |
  30. ~/.gradle/caches
  31. ~/.gradle/wrapper
  32. Pods
  33. key: |
  34. ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
  35. ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
  36. restore-keys: |
  37. ${{ runner.os }}-pods-
  38. ${{ runner.os }}-gradle-
  39. - name: Install Dependencies
  40. if: steps.cache.outputs.cache-hit != 'true'
  41. run: flutter pub get
  42. - name: Build apk
  43. if: ${{ runner.os == 'Linux' }}
  44. run: flutter build apk --debug --no-sound-null-safety
  45. # output some file:
  46. - name: artifact
  47. uses: actions/upload-artifact@v2
  48. with:
  49. name: ${{runner.OS}}-artifact
  50. path: |
  51. # build/app/outputs/flutter-apk/**/*.apk
  52. build/app/outputs/flutter-apk/app.apk
  53. build/ios/**/*.ipa
  54. build/web/web-app.zip
  55. build/windows/runner/Release/