android-build.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. name: CI
  2. on:
  3. push:
  4. branches: [ master , main]
  5. paths-ignore:
  6. - '**.md'
  7. pull_request:
  8. branches: [ master , main]
  9. jobs:
  10. build:
  11. strategy:
  12. matrix:
  13. os: [ubuntu-latest]
  14. runs-on: ${{matrix.os}}
  15. steps:
  16. - uses: actions/checkout@v4
  17. - name: Setup Java JDK
  18. uses: actions/setup-java@v2
  19. with:
  20. distribution: 'adopt'
  21. java-version: "8.x"
  22. # - name: Setup gradle
  23. # uses: eskatos/gradle-command-action@v1
  24. # with:
  25. # gradle-version: 6.5
  26. - name: Flutter action
  27. uses: subosito/flutter-action@v1.5.3
  28. with:
  29. channel: "stable"
  30. flutter-version: "3.0.5"
  31. - name: Cache Dependencies
  32. id: cache
  33. uses: actions/cache@v2
  34. with:
  35. path: |
  36. ~/.gradle/caches
  37. ~/.gradle/wrapper
  38. Pods
  39. ~/local/rubies
  40. key: |
  41. ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
  42. ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
  43. ruby-2.6.5
  44. restore-keys: |
  45. ${{ runner.os }}-pods-
  46. ${{ runner.os }}-gradle-
  47. - name: Install Dependencies
  48. if: steps.cache.outputs.cache-hit != 'true'
  49. run: flutter pub get
  50. - name: Build apk
  51. if: ${{ runner.os == 'Linux' }}
  52. run: flutter build apk --debug --split-per-abi
  53. # 发布到 fir.im
  54. - uses: clupprich/ruby-build-action@master
  55. id: ruby
  56. with:
  57. ruby-version: 2.6.5
  58. files: app/build/outputs/apk/release/app-release.apk
  59. - name: install fir.im
  60. run: gem install fir-cli
  61. - name: Upload to Fir.im
  62. run: fir login ${{ secrets.FIRTOKEN }}
  63. - run: fir publish app/build/outputs/apk/release/app-release.apk
  64. # output some file:
  65. - name: artifact
  66. uses: actions/upload-artifact@v2
  67. with:
  68. name: ${{runner.OS}}-artifact
  69. path: |
  70. # build/app/outputs/flutter-apk/**/*.apk
  71. build/app/outputs/flutter-apk/app.apk
  72. build/ios/**/*.ipa
  73. build/web/web-app.zip
  74. build/windows/runner/Release/