-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (103 loc) · 3.93 KB
/
build-v8.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
name: build-v8
on:
schedule:
# запуск ежегодно (в 00:00, 15-го января, независимо от дня недели)
- cron: "0 0 15 1 *"
push:
# запуск только при пуше в мастер
branches:
- "master"
# запуск, если изменился код пакета или пайплайна
paths:
- ".github/workflows/**/*"
jobs:
build-v8:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
#- name: install gclient
# run: |
# git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
# PATH=$GITHUB_WORKSPACE/depot_tools:$PATH
# gclient
#- name: download v8
# run: |
# mkdir v8-src && cd v8-src
# PATH=$GITHUB_WORKSPACE/depot_tools:$PATH
# fetch v8
#- name: sync v8
# run: |
# cd v8-src/v8
# PATH=$GITHUB_WORKSPACE/depot_tools:$PATH
# gclient sync
#- name: build v8
# run: |
# pwd
# ls -la
# PATH=$GITHUB_WORKSPACE/depot_tools:$PATH
# cd v8-src/v8
# ./build/install-build-deps.sh
# ./tools/dev/gm.py x64.release.check
- name: get needed files for debian package
run: |
### test
unzip v8-src.zip
rm -f v8-src.zip
### test
cd ./v8-src/v8/out/x64.release
mkdir -p "$GITHUB_WORKSPACE/v8js/topvisor/v8js"
cp \
d8 \
libchrome_zlib.so \
libchrome_zlib.so.TOC \
libc++.so \
libicuuc.so \
libicuuc.so.TOC \
libthird_party_abseil-cpp_absl.so \
libthird_party_abseil-cpp_absl.so.TOC \
libthird_party_icu_icui18n.so \
libthird_party_icu_icui18n.so.TOC \
libv8_libbase.so \
libv8_libbase.so.TOC \
libv8_libplatform.so \
libv8_libplatform.so.TOC \
libv8.so \
libv8.so.TOC \
v8_build_config.json \
--target-directory "$GITHUB_WORKSPACE/v8js/topvisor/v8js"
- name: define v8 version
id: definingV8Version
run: |
v8Version="$($GITHUB_WORKSPACE/v8js/topvisor/v8js/d8 <<< "console.log('hi');" | head -n 1 | awk '{ print $3 }' | awk -F'.' '{ print $1,$2 }' | tr ' ' '.')"
arch="$(awk '{ if ($1 ~ "Architecture:") { print $2 } }' "$GITHUB_WORKSPACE/v8js/DEBIAN/control")"
echo "v8Version=$v8Version" >> $GITHUB_OUTPUT
echo "arch=$arch" >> $GITHUB_OUTPUT
- name: build debian package
run: |
v8Version=${{ steps.definingV8Version.outputs.v8Version }}
arch=${{ steps.definingV8Version.outputs.arch }}
sed -i "s/^Version:.*/Version: $v8Version/g" "$GITHUB_WORKSPACE/v8js/DEBIAN/control"
dpkg-deb --build v8js
mv v8js.deb v8js.$v8Version.$arch.deb
- name: upload artifacts to release
env:
GH_TOKEN: ${{ github.token }}
run: |
v8Version=${{ steps.definingV8Version.outputs.v8Version }}
arch=${{ steps.definingV8Version.outputs.arch }}
# скачать список тегов
git fetch --tags origin
revlist="$(git rev-list --tags --max-count=1)"
# взять последний тег
if [ -z "$revlist" ]; then
latestVersion="v1.0.0"
else
latestVersion="$(git describe --tags "$revlist")"
fi
# вычислить новый тег
latestVersionPrefix="$(awk -F'.' '{ $NF=""; print }' <<< "$latestVersion" | tr " " ".")"
latestMinorVersion="$(sed "s/$latestVersionPrefix//g" <<< "$latestVersion")"
newMinorVersion=$(( $latestMinorVersion + 1 ))
newVersion="$latestVersionPrefix$newMinorVersion"
gh release create "$newVersion" ./v8js.$v8Version.$arch.deb