build.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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: "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: "3.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. ~/local/rubies
  38. key: |
  39. ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
  40. ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
  41. ruby-2.6.5
  42. restore-keys: |
  43. ${{ runner.os }}-pods-
  44. ${{ runner.os }}-gradle-
  45. - name: Install Dependencies
  46. if: steps.cache.outputs.cache-hit != 'true'
  47. run: flutter pub get
  48. - name: Build apk
  49. if: ${{ runner.os == 'Linux' }}
  50. run: flutter build apk --debug --split-per-abi
  51. # 发布到 fir.im
  52. - uses: clupprich/ruby-build-action@master
  53. id: ruby
  54. with:
  55. ruby-version: 2.6.5
  56. files: app/build/outputs/apk/release/app-release.apk
  57. # output some file:
  58. - name: artifact
  59. uses: actions/upload-artifact@v2
  60. with:
  61. name: ${{runner.OS}}-artifact
  62. path: |
  63. # build/app/outputs/flutter-apk/**/*.apk
  64. build/app/outputs/flutter-apk/app.apk
  65. build/ios/**/*.ipa
  66. build/web/web-app.zip
  67. build/windows/runner/Release/