build.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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: [windows-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: "8.x"
  20. # - name: Setup gradle
  21. # uses: eskatos/gradle-command-action@v1
  22. # with:
  23. # gradle-version: 6.5
  24. - name: Flutter action
  25. uses: subosito/flutter-action@v1.5.3
  26. with:
  27. channel: "stable"
  28. flutter-version: "2.0.5"
  29. - name: Cache Dependencies
  30. id: cache
  31. uses: actions/cache@v2
  32. with:
  33. path: |
  34. ~/.gradle/caches
  35. ~/.gradle/wrapper
  36. Pods
  37. key: |
  38. ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
  39. ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
  40. restore-keys: |
  41. ${{ runner.os }}-pods-
  42. ${{ runner.os }}-gradle-
  43. - name: Install Dependencies
  44. if: steps.cache.outputs.cache-hit != 'true'
  45. run: flutter pub get
  46. - name: Build exe
  47. if: ${{ runner.os == 'Windows'}}
  48. run: |
  49. flutter build windows
  50. # output some file:
  51. - name: artifact
  52. uses: actions/upload-artifact@v2
  53. with:
  54. name: ${{runner.OS}}-artifact
  55. path: |
  56. # build/app/outputs/flutter-apk/**/*.apk
  57. build/app/outputs/flutter-apk/app.apk
  58. build/ios/**/*.ipa
  59. build/web/web-app.zip