main.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. name: Build
  2. on:
  3. pull_request:
  4. branches:
  5. - '*'
  6. jobs:
  7. build-android:
  8. runs-on: ubuntu-18.04
  9. steps:
  10. - name: Check out repository od
  11. uses: actions/checkout@v2
  12. - name: Set variables
  13. run: |
  14. HASH=$(cat SNAPSHOT_HASH)
  15. echo "SNAPSHOT_HASH=$HASH" >> $GITHUB_ENV
  16. - name: Install tools
  17. run: |
  18. sudo apt-get update
  19. sudo apt-get remove git git-man
  20. sudo add-apt-repository --remove --yes ppa:git-core/ppa
  21. sudo apt-get update
  22. sudo apt-get install --yes git git-svn
  23. sudo apt-get install -y git wget curl software-properties-common unzip python-pip python lsb-release sudo apt-transport-https
  24. DEBIAN_FRONTEND="noninteractive" sudo apt-get -y install tzdata
  25. pip install wheel
  26. pip install .
  27. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  28. git clone https://github.com/flutter/engine.git
  29. - name: gclient sync
  30. run: |
  31. ROOT_DIR=`pwd`
  32. export PATH=$PATH:$ROOT_DIR/depot_tools
  33. cd engine
  34. git config --global user.email "reflutter@example.com" && git config --global user.name "reflutter"
  35. git fetch origin $(reflutter ${{env.SNAPSHOT_HASH}} -l)
  36. git reset --hard FETCH_HEAD
  37. reflutter ${{env.SNAPSHOT_HASH}} -l
  38. echo 'reflutter' > REFLUTTER
  39. git add . && git commit -am "reflutter"
  40. cd $ROOT_DIR
  41. mkdir --parents customEngine
  42. cd customEngine
  43. echo 'solutions = [{"managed": False,"name": "src/flutter","url": "'$ROOT_DIR/engine'","custom_deps": {},"deps_file": "DEPS","safesync_url": "",},]' > .gclient
  44. gclient sync
  45. reflutter ${{env.SNAPSHOT_HASH}} -l
  46. - name: Install BuildDeps
  47. run: sudo customEngine/src/build/install-build-deps-android.sh --no-prompt
  48. - name: ninja build libflutter
  49. run: export PATH=$PATH:`pwd`/depot_tools && customEngine/src/flutter/tools/gn --android --android-cpu=arm64 --runtime-mode=release && ninja -C customEngine/src/out/android_release_arm64
  50. - name: ninja build libflutter32
  51. run: export PATH=$PATH:`pwd`/depot_tools && customEngine/src/flutter/tools/gn --android --android-cpu=arm --runtime-mode=release && ninja -C customEngine/src/out/android_release
  52. - name: Move to release
  53. run: |
  54. cp customEngine/src/out/android_release_arm64/lib.stripped/libflutter.so libflutter_arm64.so 2>/dev/null || :
  55. cp customEngine/src/out/android_release/lib.stripped/libflutter.so libflutter_arm.so 2>/dev/null || :
  56. cp customEngine/src/out/android_release_x64/lib.stripped/libflutter.so libflutter_x64.so 2>/dev/null || :
  57. cp customEngine/src/out/android_jit_release_x86/lib.stripped/libflutter.so libflutter_x86.so 2>/dev/null || :
  58. - name: Release
  59. uses: softprops/action-gh-release@v1
  60. with:
  61. target_commitish: v2-${{env.SNAPSHOT_HASH}}
  62. tag_name: android-v2-${{env.SNAPSHOT_HASH}}
  63. files: |
  64. ./*.so
  65. build-ios:
  66. runs-on: macos-10.15
  67. steps:
  68. - name: Check out repository od
  69. uses: actions/checkout@v2
  70. - name: Setup Xcode version
  71. uses: maxim-lobanov/setup-xcode@v1.3.0
  72. with:
  73. xcode-version: 12.4
  74. - name: Set variables
  75. run: |
  76. HASH=$(cat SNAPSHOT_HASH)
  77. echo "SNAPSHOT_HASH=$HASH" >> $GITHUB_ENV
  78. - name: Install tools
  79. run: |
  80. brew update
  81. brew install libzip openssl libplist autoconf automake libtool autoconf-archive pkg-config
  82. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig
  83. git clone https://github.com/libimobiledevice/libplist
  84. cd libplist && ./autogen.sh --without-cython && sudo make install && cd ..
  85. cd libusbmuxd && ./autogen.sh && sudo make install && cd ..
  86. xcrun --sdk macosx --show-sdk-path
  87. brew install ideviceinstaller
  88. brew install ios-deploy
  89. pip3 install wheel
  90. pip3 install .
  91. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  92. git clone https://github.com/flutter/engine.git
  93. - name: gclient sync
  94. run: |
  95. ROOT_DIR=`pwd`
  96. export PATH=$PATH:$ROOT_DIR/depot_tools
  97. cd engine
  98. git config --global user.email "reflutter@example.com" && git config --global user.name "reflutter"
  99. git fetch origin $(reflutter ${{env.SNAPSHOT_HASH}} -l)
  100. git reset --hard FETCH_HEAD
  101. reflutter ${{env.SNAPSHOT_HASH}} -l
  102. echo 'reflutter' > REFLUTTER
  103. git add . && git commit -am "reflutter"
  104. cd $ROOT_DIR
  105. mkdir customEngine
  106. cd customEngine
  107. echo 'solutions = [{"managed": False,"name": "src/flutter","url": "'$ROOT_DIR/engine'","custom_deps": {},"deps_file": "DEPS","safesync_url": "",},]' > .gclient
  108. gclient sync
  109. reflutter ${{env.SNAPSHOT_HASH}} -l
  110. - name: ninja build Flutter.framework
  111. run: export PATH=$PATH:`pwd`/depot_tools && sudo xcode-select -s /Applications/Xcode_12.4.app && customEngine/src/flutter/tools/gn --ios --ios-cpu=arm64 --runtime-mode=release && ninja -C customEngine/src/out/ios_release
  112. - name: Move to release
  113. run: |
  114. cp customEngine/src/out/ios_release/Flutter.framework/Flutter Flutter
  115. - name: Release
  116. uses: softprops/action-gh-release@v1
  117. with:
  118. target_commitish: v2-${{env.SNAPSHOT_HASH}}
  119. tag_name: ios-v2-${{env.SNAPSHOT_HASH}}
  120. files: |
  121. ./Flutter