Skip to content

Commit b7e5613

Browse files
authored
Merge pull request #1 from sqreen/enable-github-actions
Enable GitHub Actions
2 parents 8b7154a + d5ea0d2 commit b7e5613

File tree

3 files changed

+137
-7
lines changed

3 files changed

+137
-7
lines changed

.github/workflows/build.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Build
2+
on:
3+
- push
4+
5+
jobs:
6+
build-macos:
7+
name: Build (macOS)
8+
runs-on: macos-10.15
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Bundle
13+
run: bundle install
14+
- name: Set Node.js version
15+
run: |
16+
bundle exec ruby -e 'puts Libv8Node::NODE_VERSION' | tee node_version
17+
- name: Download Node.js
18+
run: |
19+
./download-node 12.18.4
20+
- name: Extract Node.js
21+
run: |
22+
./extract-node 12.18.4
23+
- name: Build V8
24+
run: |
25+
./build-libv8 12.18.4
26+
- name: Build Monolith
27+
run: |
28+
./build-monolith 12.18.4
29+
- name: Inject V8
30+
run: |
31+
./inject-libv8 12.18.4
32+
- name: Build gem
33+
run: |
34+
bundle exec rake binary
35+
- name: Upload V8
36+
uses: actions/upload-artifact@v1
37+
with:
38+
name: v8-x86_64-darwin19
39+
path: vendor
40+
- name: Upload gem
41+
uses: actions/upload-artifact@v1
42+
with:
43+
name: gem-x86_64-darwin19
44+
path: pkg
45+
build-linux-glibc:
46+
name: Build (Linux glibc)
47+
runs-on: ubuntu-20.04
48+
container: ruby:2.7
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
- name: Bundle
53+
run: bundle install
54+
- name: Download Node.js
55+
run: |
56+
./download-node 12.18.4
57+
- name: Extract Node.js
58+
run: |
59+
./extract-node 12.18.4
60+
- name: Build V8
61+
run: |
62+
./build-libv8 12.18.4
63+
- name: Build Monolith
64+
run: |
65+
./build-monolith 12.18.4
66+
- name: Inject V8
67+
run: |
68+
./inject-libv8 12.18.4
69+
- name: Build gem
70+
run: |
71+
bundle exec rake binary
72+
- name: Upload V8
73+
uses: actions/upload-artifact@v1
74+
with:
75+
name: v8-x86_64-linux-glibc
76+
path: vendor
77+
- name: Upload gem
78+
uses: actions/upload-artifact@v1
79+
with:
80+
name: gem-x86_64-linux-glibc
81+
path: pkg
82+
build-linux-musl:
83+
name: Build (Linux musl)
84+
runs-on: ubuntu-20.04
85+
container: ruby:2.7-alpine
86+
steps:
87+
- name: Install system dependencies
88+
run: apk add --no-cache build-base bash python2 python3 git curl tar clang binutils-gold
89+
- name: Checkout
90+
uses: actions/checkout@v2
91+
- name: Bundle
92+
run: bundle install
93+
- name: Download Node.js
94+
run: |
95+
./download-node 12.18.4
96+
- name: Extract Node.js
97+
run: |
98+
./extract-node 12.18.4
99+
- name: Build V8
100+
run: |
101+
./build-libv8 12.18.4
102+
- name: Build Monolith
103+
run: |
104+
./build-monolith 12.18.4
105+
- name: Inject V8
106+
run: |
107+
./inject-libv8 12.18.4
108+
- name: Build gem
109+
run: |
110+
bundle exec rake binary
111+
- name: Prepare artifacts
112+
run: |
113+
mkdir -p ${{ runner.temp }}/workspace
114+
cp -Rv pkg ${{ runner.temp }}/workspace/
115+
cp -Rv vendor ${{ runner.temp }}/workspace/
116+
- name: Upload V8
117+
uses: actions/upload-artifact@v1
118+
with:
119+
name: v8-x86_64-linux-musl
120+
path: vendor
121+
- name: Upload gem
122+
uses: actions/upload-artifact@v1
123+
with:
124+
name: gem-x86_64-linux-musl
125+
path: pkg

build-libv8

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ version="${1}"
77

88
cd "src/node-${version}"
99

10+
./configure --openssl-no-asm --without-npm
11+
make
12+
1013
# taken from
1114
# ./configure
1215
# make
1316
# make -C out BUILDTYPE=Release V=1
1417

15-
python configure.py --openssl-no-asm --without-npm
16-
make BUILDTYPE=Release out/Makefile
17-
make -C out BUILDTYPE=Release V=1 v8
18-
make -C out BUILDTYPE=Release V=1 v8_libbase
19-
make -C out BUILDTYPE=Release V=1 v8_libplatform
20-
make -C out BUILDTYPE=Release V=1 v8_libsampler
18+
#python configure.py --openssl-no-asm --without-npm
19+
#make BUILDTYPE=Release out/Makefile
20+
#make -C out BUILDTYPE=Release V=1 v8
21+
#make -C out BUILDTYPE=Release V=1 v8_libbase
22+
#make -C out BUILDTYPE=Release V=1 v8_libplatform
23+
#make -C out BUILDTYPE=Release V=1 v8_libsampler
2124

inject-libv8

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ BUILDTYPE="${BUILDTYPE:-Release}"
1313

1414
cd "${BASEDIR}/deps/v8/include"
1515

16+
rm -rf "${top}/vendor/v8/include"
1617
find . -name '*.h' | while read -r header; do
1718
dir="${top}/vendor/v8/include/$(dirname "${header}")"
1819
mkdir -p "${dir}"
@@ -21,7 +22,8 @@ done
2122

2223
cd "${BASEDIR}/out/${BUILDTYPE}"
2324

24-
for lib in libv8_libbase.a libv8_libplatform.a libv8_monolith.a; do
25+
rm -rf "${top}/vendor/v8/out.gn"
26+
for lib in libv8_monolith.a; do
2527
dir="${top}/vendor/v8/out.gn/libv8/obj/$(dirname "${lib}")"
2628
mkdir -p "${dir}"
2729
rm -fv "${dir}/${lib}"

0 commit comments

Comments
 (0)