-
-
Notifications
You must be signed in to change notification settings - Fork 20
199 lines (162 loc) · 6.72 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
name: Build
on: [ push, pull_request, workflow_dispatch]
jobs:
build:
strategy:
matrix:
# TODO: make mode matrix of ['release', 'debug']?
# arch: ['arm', 'arm64', 'ia32', 'x64']
arch: ['arm64']
runs-on: ubuntu-20.04
name: ${{ matrix.arch }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r16b
add-to-path: true
local-cache: true
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- run: wget https://github.com/chromium/chromium/raw/master/build/install-build-deps.sh
- run: sudo bash ./install-build-deps.sh --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt
name: Install V8 Build Dependencies
continue-on-error: true
- run: sudo apt-get -y install python2 lib32z1 lighttpd xvfb x11-utils libatomic1:i386 libncurses5:i386 libstdc++6:i386 zlib1g:i386 ccache ninja-build
name: Install additional build tools
- run: sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
name: set python2 as primary
- run: git apply ../DEPS.patch
name: Apply DEPS patch
working-directory: ./v8
- run: git apply ../DEPS_2.patch
name: Apply DEPS patch
working-directory: ./v8
# Apply compatibility patches
# NOTE: These also need to be applied in the package step
- run: git apply ../compat.patch
name: Apply compat patch
working-directory: ./v8
- run: git apply ../compat_jsargs.patch
name: Apply patch for breaking reverse jsargs change
working-directory: ./v8
- run: git apply ../compat_adaptor.patch
name: Apply patch for breaking adaptor change
working-directory: ./v8
- run: git apply ../compat_sparkplug.patch
name: Apply patch for breaking sparkplug change
working-directory: ./v8
- run: git apply ../version.patch
name: Adjust V8 version
working-directory: ./v8
- name: Checkout depot_tools repo
run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && cd depot_tools && git -c advice.detachedHead=false checkout b0a190348a740cb063eb98ba6eb9d18ccd573ae7
- name: Add depot_tools to PATH!
run: echo "${{ github.workspace }}/depot_tools" >> $GITHUB_PATH
# - name: Link Android NDK
# run: ln -s ${{ steps.setup-ndk.outputs.ndk-path }}/../ v8/third_party/android_ndk && chmod 777 v8/third_party/android_ndk
- run: ../depot_tools/gclient sync --shallow --no-history --reset --force
name: Install GClient Dependencies
working-directory: ./v8
- name: Retrieve ccache
uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-ccache-${{ matrix.arch }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.arch }}-
${{ runner.os }}-ccache-
- run: ./build_v8.sh -l ${{ matrix.arch }} -m release -x v8_monolith
name: Build
- name: Show summary of ccache configuration and statistics counters
run: ccache --show-stats
- name: Archive Build
uses: actions/upload-artifact@v2
with:
name: libv8-release-${{ matrix.arch }}
path: |
build/release/**
# Combine the various architecture builds with the headers and a custom libv8.json file
package:
runs-on: ubuntu-latest
name: Package
needs: build
steps:
- uses: actions/checkout@v3
with:
submodules: true
# Apply compatibility patches, so 'include' headers are correct
- run: git apply ../compat.patch
name: Apply compat patch
working-directory: ./v8
- run: git apply ../compat_jsargs.patch
name: Apply patch for breaking reverse jsargs change
working-directory: ./v8
- run: git apply ../compat_adaptor.patch
name: Apply patch for breaking adaptor change
working-directory: ./v8
- run: git apply ../compat_sparkplug.patch
name: Apply patch for breaking sparkplug change
working-directory: ./v8
- run: git apply ../version.patch
name: Adjust V8 version
working-directory: ./v8
- run: mkdir -p 'build/release/libs' 'build/release/include' 2>/dev/null
- run: cp -R 'v8/include' 'build/release'
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- name: Create libv8.json
run: |
gitRevision=$(git ls-tree HEAD -- v8 | cut -c15-54)
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
MAJOR=$(grep "#define V8_MAJOR_VERSION" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
MINOR=$(grep "#define V8_MINOR_VERSION" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
BUILD=$(grep "#define V8_BUILD_NUMBER" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
PATCH=$(grep "#define V8_PATCH_LEVEL" "v8/include/v8-version.h" | awk '{print $NF}' | tr -d '[[:space:]]')
v8Version="$MAJOR.$MINOR.$BUILD.$PATCH"
echo "v8Version=$v8Version" >> $GITHUB_ENV
echo "{
\"version\": \"$v8Version\",
\"git_revision\": \"$gitRevision\",
\"git_branch\": \"${{ env.BRANCH_NAME }}\",
\"svn_revision\": \"\",
\"timestamp\": \"$timestamp\"
}" >> build/release/libv8.json
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: List files
run: ls -la
- name: Move built libraries to final folder
run: |
mv libv8-release-arm/libs/arm build/release/libs/arm
mv libv8-release-arm64/libs/arm64 build/release/libs/arm64
mv libv8-release-ia32/libs/x86 build/release/libs/x86
mv libv8-release-x64/libs/x86_64 build/release/libs/x86_64
- name: Building libv8-${{ env.v8Version }}-release.tar.bz2...
run: tar -cvj -f libv8-${{ env.v8Version }}-release.tar.bz2 libv8.json libs include
working-directory: ./build/release
- name: Archive Build
uses: actions/upload-artifact@v2
with:
name: libv8-${{ env.v8Version }}-release
path: |
build/release/libv8-*-release.tar.bz2
- uses: geekyeggo/delete-artifact@v1
with:
name: |
libv8-release-arm
libv8-release-arm64
libv8-release-ia32
libv8-release-x64