-
Notifications
You must be signed in to change notification settings - Fork 86
255 lines (227 loc) · 9.2 KB
/
.build_livekeys.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: Livekeys build matrix
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-18.04]
include:
- os: macos-latest
NAME: macos
TARGET: x86_64-apple-darwin
COMPILER: clang
LINKER: clang
- os: ubuntu-18.04
NAME: ubuntu
TARGET: x86_64-linux
COMPILER: g++
LINKER: g++
steps:
- uses: actions/checkout@v1
- name: Branch name
id: branch_name
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Download dependencies MacOS
if: runner.os == 'macOS'
run: |
brew tap live-keys/opencv
brew update
HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
HOMEBREW_NO_AUTO_UPDATE=1 brew install wget
wget --help
HOMEBREW_NO_AUTO_UPDATE=1 brew install doxygen
- name: Download dependencies Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-7 g++-7 build-essential cmake cmake-data libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y python-dev python-numpy python3 python3-pip libtbb2 libtbb-dev libjpeg-dev libpng-dev libdc1394-22-dev libgl1-mesa-dev unzip
sudo apt-get install -y libtiff5 libtiff5-dev python3-setuptools doxygen libssl1.0-dev nodejs-dev npm
- name: Setup python and numpy MacOS
if: runner.os == 'macOS'
run: |
sudo mkdir /opt/qt
sudo chmod 777 /opt/qt
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun
rm -r '/usr/local/lib/python2.7/site-packages/numpy' || true
rm '/usr/local/bin/f2py' || true
HOMEBREW_NO_AUTO_UPDATE=1 brew install numpy
- name: Build OpenCV MacOS
if: runner.os == 'macOS'
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install --verbose live-keys/opencv/opencv
echo "Open CV environment"
ls /usr/local/Cellar
echo "/usr/local/opt"
ls /usr/local/opt
ls /usr/local/opt/opencv/lib
OPENCV_VERSION="$(ls -1 /usr/local/Cellar/opencv)"
echo $OPENCV_VERSION
export OPENCV_DIR=/usr/local/Cellar/opencv/$OPENCV_VERSION
export PKG_CONFIG_PATH=$OPENCV_DIR/lib/pkgconfig
echo $OPENCV_DIR
echo $PKG_CONFIG_PATH
echo $PWD
echo "OPENCV_DIR=$OPENCV_DIR" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: Build OpenCV Linux
if: runner.os == 'Linux'
run: |
git clone --single-branch -b 4.1.1 https://github.com/opencv/opencv.git
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_GENERATE_PKGCONFIG=YES -D BUILD_EXAMPLES=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF ..
make -j8
sudo make -j8 install
export OPENCV_DIR=/usr/local/lib
cd ../..
echo "OPENCV_DIR=$OPENCV_DIR" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Setup Qt MacOS
if: runner.os == 'macOS'
run: |
pip3 install aqtinstall==1.1.4
aqt install 5.14.2 --outputdir /opt/qt mac desktop clang_64 -m qtwebengine qtquick3d
aqt doc 5.14.2 --outputdir /opt/qt mac desktop -m qtwebengine
export QTDIR=/opt/qt/5.14.2/clang_64
echo "QTDIR=$QTDIR" >> $GITHUB_ENV
- name: Setup Qt Linux
if: runner.os == 'Linux'
run: |
pip3 install aqtinstall==1.1.4
echo "Installed aqtinstall"
aqt install 5.14.2 --outputdir /opt/qt linux desktop gcc_64 -m qtwebengine qtquick3d
aqt doc 5.14.2 --outputdir /opt/qt linux desktop -m qtwebengine
export QTDIR=/opt/qt/5.14.2/gcc_64
echo "QTDIR=$QTDIR" >> $GITHUB_ENV
- name: Setup Livepm MacOS
if: runner.os == 'macOS'
run: |
pip --version
python --version
python -m pip install --upgrade pip
cd build
wget https://github.com/livecv/live-pm/archive/master.zip
unzip master.zip
mv live-pm-master/* .
git clone https://github.com/live-keys/live-doc.git
cd live-doc
npm install
cd ..
npm install --global create-dmg
export LIVEDOC=$PWD/live-doc/live-doc.js
echo "LIVEDOC=$LIVEDOC" >> $GITHUB_ENV
pip install -r requirements.txt
python livepm/main.py build .. macos_clang_64
python livepm/main.py deploy .. macos_clang_64
- name: Setup Livepm Linux
if: runner.os == 'Linux'
run: |
cd build
echo $PWD
ls
wget https://github.com/livecv/live-pm/archive/master.zip
unzip master.zip
mv live-pm-master/* .
git clone https://github.com/live-keys/live-doc.git
cd live-doc
npm install
cd ..
export LIVEDOC=$PWD/live-doc/live-doc.js
pip3 install -r requirements.txt
echo "CWD:"
echo $PWD
ls
ls ..
python3 livepm/main.py build .. gcc_64
python3 livepm/main.py deploy .. gcc_64
python3 livepm/main.py deploy .. gcc_64_standalone
- name: Upload Artifact MacOS
uses: actions/upload-artifact@v2
if: github.ref == 'refs/heads/master' && runner.os == 'macOS'
with:
name: Release
path: build/*.dmg
- name: Upload Artifact Linux
uses: actions/upload-artifact@v2
if: github.ref == 'refs/heads/master' && runner.os == 'Linux'
with:
name: Release
path: build/*.tar.gz
- name: Get Release MacOS
id: get_release_macos
if: github.ref == 'refs/heads/master' && runner.os == 'macOS'
run : |
cd build
RELEASE_NAME="$(ls -1 *.dmg)"
echo $RELEASE_NAME
echo ::set-output name=RELEASE_NAME::$RELEASE_NAME
- name: Get Release Linux
id: get_release_linux
if: github.ref == 'refs/heads/master' && runner.os == 'Linux'
run : |
cd build
ls
RELEASE_NAME_1="$(ls live*.tar.gz | tail -n +1 | head -1)"
RELEASE_NAME_2="$(ls live*.tar.gz | tail -n +2 | head -1)"
echo $RELEASE_NAME_1
echo $RELEASE_NAME_2
echo ::set-output name=RELEASE_NAME_1::$RELEASE_NAME_1
echo ::set-output name=RELEASE_NAME_2::$RELEASE_NAME_2
# - name: Create Release
# id: create_release
# if: startsWith(github.ref, 'refs/tags/v')
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# draft: false
# prerelease: false
# - name: Get Release Info
# id: get_release_info
# uses: bruceadams/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Do Release MacOS
id: do_release_macos
if: startsWith(github.ref, 'refs/tags/v') && runner.os == 'macOS'
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/${{ steps.get_release_macos.outputs.RELEASE_NAME }}
- name: Do Release Linux
id: do_release_linux
if: startsWith(github.ref, 'refs/tags/v') && runner.os == 'Linux'
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
build/${{ steps.get_release_linux.outputs.RELEASE_NAME_1 }}
build/${{ steps.get_release_linux.outputs.RELEASE_NAME_2 }}
# - name: Upload Release Asset
# id: upload-release-asset
# if: startsWith(github.ref, 'refs/tags/v')
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.get_release_info.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
# asset_path: build/${{ steps.get_release.outputs.RELEASE_NAME }}
# asset_name: ${{ steps.get_release.outputs.RELEASE_NAME }}
# asset_content_type: application/x-apple- diskimage