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