-
Notifications
You must be signed in to change notification settings - Fork 35
224 lines (194 loc) · 7.33 KB
/
build.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
name: WebOS build
on:
push:
pull_request:
workflow_dispatch:
env:
TOOLCHAIN_URL: https://github.com/openlgtv/buildroot-nc4/releases/download/webos-c592d84/arm-webos-linux-gnueabi_sdk-buildroot.tar.gz
TOOLCHAIN_DIR: /opt/arm-webos-linux-gnueabi_sdk-buildroot
TOOLCHAIN_ENV_FILE: /opt/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
TOOLCHAIN_FILE: /opt/arm-webos-linux-gnueabi_sdk-buildroot/share/buildroot/toolchainfile.cmake
BUILD_DIR: build
CCACHE_CACHE_DIR: .ccache-build
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 600M
jobs:
build_hyperhdr:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hyperhdr-repo
steps:
- uses: actions/checkout@v3
with:
repository: awawa-dev/HyperHDR
ref: v21.0.0.0beta2
path: hyperhdr-repo
submodules: recursive
fetch-depth: 0
- name: Restore/Cache build directories
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/${{ env.CCACHE_CACHE_DIR }}
key: ccache-${{ runner.os }}-${{github.run_id}}
restore-keys: |
ccache-${{ runner.os }}
- name: Create build directories
run: |
mkdir -p ./${{ env.BUILD_DIR }}
- name: Cache toolchain dir
id: cache-toolchain
uses: actions/cache@v3
with:
path: ${{ env.TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ env.TOOLCHAIN_URL }}
- name: Download and unpack toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
working-directory: /opt
run: |
wget -q -O toolchain.tar.gz ${TOOLCHAIN_URL}
tar xf toolchain.tar.gz
pushd ${TOOLCHAIN_DIR}
./relocate-sdk.sh
popd
find ${TOOLCHAIN_DIR}/bin -type f -iname "perl*" -delete
- name: Install native dependencies
env:
apt_deps: ccache git cmake build-essential flatbuffers-compiler
run: |
sudo apt update
sudo apt install -y ${{ env.apt_deps }}
- name: Build (webos arm)
env:
CCACHE_DIR: ${{ github.workspace }}/${{ env.CCACHE_CACHE_DIR }}
run: |
pushd ./${{ env.BUILD_DIR }}
cmake .. \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} \
-DCMAKE_BUILD_TYPE=Release \
-DPLATFORM=linux \
-DENABLE_SPIDEV=OFF \
-DENABLE_V4L2=OFF \
-DENABLE_X11=OFF \
-DENABLE_PIPEWIRE=OFF \
-DENABLE_SOUNDCAPLINUX=ON \
-DENABLE_CEC=OFF \
-DENABLE_PROTOBUF=OFF \
-DENABLE_FRAMEBUFFER=OFF
make
popd
- name: Copy built binaries to release/
run: |
mkdir ./release
cp -r ./${{ env.BUILD_DIR }}/bin/* ./release/
find ./release
- name: Copy dependencies to release/
env:
dependency_libs: libpng16.so.16 libjpeg.so.8 libcrypto.so.1.1 libz.so.1 libssl.so.1.1 libQt5Sql.so.5.15.2 libpcre2-16.so.0 libQt5Gui.so.5 libQt5Network.so.5 libQt5Widgets.so.5 libk5crypto.so.3 libatomic.so.1 libQt5Core.so.5 libkrb5support.so.0 libcom_err.so.3 libstdc++.so.6 libkrb5.so.3 libQt5Sql.so.5 libgssapi_krb5.so.2 libQt5SerialPort.so.5 libQt5Sql.so.5.15 libusb-1.0.so.0 libturbojpeg.so.0
run: |
for i in ${{ env.dependency_libs }}; do find ${TOOLCHAIN_DIR}/arm-webos-linux-gnueabi/sysroot/ -name $i -exec cp {} ./release/ \;; done
mkdir -p ./release/sqldrivers
mkdir -p ./release/imageformats
cp ${TOOLCHAIN_DIR}/arm-webos-linux-gnueabi/sysroot/usr/lib/qt/plugins/sqldrivers/libqsqlite.so ./release/sqldrivers/
cp ${TOOLCHAIN_DIR}/arm-webos-linux-gnueabi/sysroot/usr/lib/qt/plugins/imageformats/libqico.so ./release/imageformats/
cp ${TOOLCHAIN_DIR}/arm-webos-linux-gnueabi/sysroot/usr/lib/qt/plugins/imageformats/libqjpeg.so ./release/imageformats/
find ./release
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: hyperhdr-build
path: ${{ github.workspace }}/hyperhdr-repo/release/*
if-no-files-found: error
build_ipk:
runs-on: ubuntu-latest
needs: build_hyperhdr
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: actions/download-artifact@v3
with:
name: hyperhdr-build
path: hyperhdr-build
- name: Display structure of downloaded files
run: ls -R
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Restore toolchain cache
id: cache-toolchain
uses: actions/cache@v3
with:
path: ${{ env.TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ env.TOOLCHAIN_URL }}
- name: Install native dependencies
env:
apt_deps: cmake build-essential
run: |
sudo apt update
sudo apt install -y ${{ env.apt_deps }}
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- run: npm ci
- run: npm run lint
- run: npm run build -- --env production
- name: Build service
run: |
mkdir -p ./dist/service
rm -rf ./dist/service/*
mkdir -p ./service/build
pushd service/build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}
make
popd
cp -r ./service/build/dist/* ./dist/service/
- name: Copy hyperhdr into dist/service/hyperhdr
run: |
ls -R
mkdir -p ./dist/service/hyperhdr
cp -r ./hyperhdr-build/* ./dist/service/hyperhdr/
ls -R
- name: Ensure executables +x
run: |
chmod +x ./dist/service/autostart.sh
chmod +x ./dist/service/loader_service
chmod +x ./dist/service/start_hyperhdr
chmod +x ./dist/service/hyperhdr/hyperhdr
- name: Copy HDR LUT
run: unxz -dc ./resources/flat_lut_lin_tables.3d.xz > ./dist/service/hyperhdr/flat_lut_lin_tables.3d
- run: npm run package
- run: npm run gen-manifest
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hyperhdr-ipk
path: |
${{github.workspace}}/*.ipk
- uses: marvinpinto/action-automatic-releases@latest
if: "github.ref == 'refs/heads/master'"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: latest
prerelease: true
title: "Development Build"
files: |
${{github.workspace}}/*.ipk
${{github.workspace}}/org.webosbrew.hyperhdr.loader.manifest.json
- uses: marvinpinto/action-automatic-releases@latest
if: "startsWith(github.ref, 'refs/tags/v')"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: ${{ github.ref_name }}
files: |
${{github.workspace}}/*.ipk
${{github.workspace}}/org.webosbrew.hyperhdr.loader.manifest.json