main.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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, macos-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 apk
  47. if: ${{ runner.os == 'Linux' }}
  48. run: flutter build apk --debug --split-per-abi
  49. # - name: Build Web
  50. # if: ${{runner.os == 'Linux'}}
  51. # run: |
  52. # flutter build web
  53. # cd build/web
  54. # zip -r web-app.zip .
  55. - name: Build ios
  56. if: ${{ runner.os == 'macOS' }}
  57. run: |
  58. sudo xcode-select -s /Applications/Xcode_12.3.app
  59. flutter build ios --release --no-codesign
  60. cd build/ios/iphoneos
  61. mkdir Payload
  62. cd Payload
  63. ln -s ../Runner.app
  64. cd ..
  65. zip -r app.ipa Payload
  66. # - name: Build exe
  67. # if: ${{ runner.os == 'Windows'}}
  68. # run: |
  69. # flutter build windows
  70. # - name: Build mac
  71. # if: ${{ runner.os == 'macOS'}}
  72. # run: |
  73. # flutter build macos
  74. # output some file:
  75. - name: artifact
  76. uses: actions/upload-artifact@v2
  77. with:
  78. name: ${{runner.OS}}-artifact
  79. path: |
  80. build/app/outputs/flutter-apk/**/*.apk
  81. build/ios/**/*.ipa
  82. build/web/web-app.zip
  83. # - name: Deploy iOS Beta to TestFlight via Fastlane
  84. # uses: maierj/fastlane-action@v2.0.1
  85. # with:
  86. # lane: beta
  87. # subdirectory: ios
  88. # env:
  89. # APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
  90. # DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}'
  91. # DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}'
  92. # DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}'
  93. # FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}'
  94. # FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}'
  95. # MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
  96. # GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}'
  97. # PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}'
  98. # TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
  99. # TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
  100. # - name: Release Apps
  101. # uses: ncipollo/release-action@v1
  102. # with:
  103. # tag: ${{ env.APP_VERSION }}
  104. # name: ${{ env.APP_VERSION }}
  105. # token: ${{ secrets.GITHUB_TOKEN }}
  106. # artifacts: 'build/app/outputs/apk/release/*.apk,build/ios/iphoneos/app.ipa,build/web/web-app.zip'