-
Notifications
You must be signed in to change notification settings - Fork 226
134 lines (130 loc) · 6.31 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
125
126
127
128
129
130
131
132
133
name: Build
on:
pull_request:
branches:
- "*"
jobs:
build-v2:
runs-on: macos-12
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1.3.0
with:
xcode-version: latest-stable
- name: Set variables
run: |
HASH=$(cat SNAPSHOT_HASH)
echo "SNAPSHOT_HASH=$HASH" >> $GITHUB_ENV
- name: Install tools
run: |
brew install ninja libusbmuxd ideviceinstaller ios-deploy python@3.11
sudo rm -rf /usr/local/bin/python3
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 /usr/local/bin/python3
python3 -m pip install wheel
python3 -m pip install .
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
git clone https://github.com/flutter/engine.git
- name: gclient sync
run: |
ROOT_DIR=`pwd`
export PATH=$PATH:$ROOT_DIR/depot_tools:/Library/Frameworks/Python.framework/Versions/3.11/bin
cd engine
git config --global user.email "reflutter@example.com" && 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.app && customEngine/src/flutter/tools/gn --no-goma --ios --runtime-mode=release && ninja -C customEngine/src/out/ios_release
- name: ninja build libflutter_arm64
run: export PATH=$PATH:`pwd`/depot_tools && customEngine/src/flutter/tools/gn --no-goma --android --android-cpu=arm64 --runtime-mode=release && ninja -C customEngine/src/out/android_release_arm64
- name: ninja build libflutter_arm
run: export PATH=$PATH:`pwd`/depot_tools && customEngine/src/flutter/tools/gn --no-goma --android --android-cpu=arm --runtime-mode=release && ninja -C customEngine/src/out/android_release
- name: Move to release
run: |
cp customEngine/src/out/ios_release/Flutter.framework/Flutter Flutter
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 || :
- name: iOS-Release
uses: softprops/action-gh-release@v1
with:
tag_name: ios-v2-${{env.SNAPSHOT_HASH}}
files: |
./Flutter
- name: Android-Release
uses: softprops/action-gh-release@v1
with:
tag_name: android-v2-${{env.SNAPSHOT_HASH}}
files: |
./*.so
build-v3:
runs-on: macos-12
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Setup Xcode version
uses: maxim-lobanov/setup-xcode@v1.3.0
with:
xcode-version: latest-stable
- name: Set variables
run: |
HASH=$(cat SNAPSHOT_HASH)
echo "SNAPSHOT_HASH=$HASH" >> $GITHUB_ENV
- name: Install tools
run: |
brew install ninja libusbmuxd ideviceinstaller ios-deploy python@3.11
sudo rm -rf /usr/local/bin/python3
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 /usr/local/bin/python3
python3 -m pip install wheel
python3 -m pip install .
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
git clone https://github.com/flutter/engine.git
- name: gclient sync
run: |
ROOT_DIR=`pwd`
export PATH=$PATH:$ROOT_DIR/depot_tools:/Library/Frameworks/Python.framework/Versions/3.11/bin
cd engine
git config --global user.email "reflutter@example.com" && git config --global user.name "reflutter"
git fetch origin $(reflutter ${{env.SNAPSHOT_HASH}} -l)
git reset --hard FETCH_HEAD
reflutter ${{env.SNAPSHOT_HASH}} -l patchDump
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 patchDump
- name: ninja build Flutter.framework
run: export PATH=$PATH:`pwd`/depot_tools && sudo xcode-select -s /Applications/Xcode.app && customEngine/src/flutter/tools/gn --no-goma --ios --runtime-mode=release && ninja -C customEngine/src/out/ios_release
- name: ninja build libflutter_arm64
run: export PATH=$PATH:`pwd`/depot_tools && customEngine/src/flutter/tools/gn --no-goma --android --android-cpu=arm64 --runtime-mode=release && ninja -C customEngine/src/out/android_release_arm64
- name: ninja build libflutter_arm
run: export PATH=$PATH:`pwd`/depot_tools && customEngine/src/flutter/tools/gn --no-goma --android --android-cpu=arm --runtime-mode=release && ninja -C customEngine/src/out/android_release
- name: Move to release
run: |
cp customEngine/src/out/ios_release/Flutter.framework/Flutter Flutter
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 || :
- name: iOS-Release
uses: softprops/action-gh-release@v1
with:
tag_name: ios-v3-${{env.SNAPSHOT_HASH}}
files: |
./Flutter
- name: Android-Release
uses: softprops/action-gh-release@v1
with:
tag_name: android-v3-${{env.SNAPSHOT_HASH}}
files: |
./*.so