ios-build.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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: [ macos-latest]
  12. runs-on: ${{matrix.os}}
  13. env:
  14. XC_VERSION: ${{ '11.4' }}
  15. XC_WORKSPACE: ${{ 'MyApp.xcworkspace' }}
  16. XC_SCHEME: ${{ 'MyApp' }}
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Setup Java JDK
  20. uses: actions/setup-java@v2
  21. with:
  22. distribution: 'adopt'
  23. java-version: "8.x"
  24. # - name: Setup gradle
  25. # uses: eskatos/gradle-command-action@v1
  26. # with:
  27. # gradle-version: 6.5
  28. - name: Flutter action
  29. uses: subosito/flutter-action@v1.5.3
  30. with:
  31. channel: "stable"
  32. flutter-version: "3.0.5"
  33. - name: Cache Dependencies
  34. id: cache
  35. uses: actions/cache@v2
  36. with:
  37. path: |
  38. ~/.gradle/caches
  39. ~/.gradle/wrapper
  40. Pods
  41. key: |
  42. ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
  43. ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
  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: Select latest Xcode
  51. run: "sudo xcode-select -s /Applications/Xcode_$XC_VERSION.app"
  52. # base64 build_certificate.p12 | pbcopy
  53. - name: Install Apple Certificate
  54. uses: apple-actions/import-codesign-certs@v1
  55. with:
  56. p12-file-base64: ${{ secrets.P12_BASE64 }}
  57. p12-password: ${{ secrets.P12_PASSWORD }}
  58. - name: Build ios
  59. if: ${{ runner.os == 'macOS' }}
  60. run: |
  61. # sudo xcode-select -s /Applications/Xcode_12.3.app
  62. flutter build ios --release --no-codesign
  63. # output some file:
  64. - name: artifact
  65. uses: actions/upload-artifact@v2
  66. with:
  67. name: ${{runner.OS}}-artifact
  68. path: |
  69. # build/app/outputs/flutter-apk/**/*.apk
  70. build/app/outputs/flutter-apk/app.apk
  71. build/ios/**/*.ipa
  72. build/web/web-app.zip
  73. build/windows/runner/Release/
  74. # build/