-
Notifications
You must be signed in to change notification settings - Fork 31
165 lines (159 loc) · 5.86 KB
/
linux.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
name: Linux
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
BOOST_DOT_VERSION: "1.81.0"
BOOST_VERSION: "1_81_0"
OPENSSL_VERSION: "1.1.1t"
OPENSSL_NO_OPTS: "no-deprecated no-shared no-makedepend no-static-engine no-stdio no-posix-io no-threads no-ui-console no-zlib no-zlib-dynamic -fno-strict-aliasing -fvisibility=hidden -O3"
CXX: g++-10
CC: gcc-10
jobs:
x86_64-cmake:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: install packages
run: |
sudo apt update
sudo apt install libboost-all-dev
sudo apt install libssl-dev
sudo apt install ninja-build
- name: cmake
run: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_STANDARD=17 -B build -G "Ninja" swig
- name: build
run: cmake --build build --config Release --parallel 2
- name: strip
run: |
objcopy --only-keep-debug build/libtorrent4j.so build/libtorrent4j.so.debug
strip --strip-unneeded -x build/libtorrent4j.so
- name: dependencies
run: readelf -d build/libtorrent4j.so
# too flaky
# - name: test
# run: |
# cp build/libtorrent4j.so .
# ./gradlew test
- uses: actions/upload-artifact@v2
with:
name: libtorrent4j-linux-cmake
path: |
build/libtorrent4j.so
build/libtorrent4j.so.debug
retention-days: 5
x86_64-b2:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: setup gcc
run: |
sudo apt update
sudo apt install gcc-10 g++-10
- name: setup boost
run: |
wget -nv -O boost.tar.gz https://boostorg.jfrog.io/artifactory/main/release/${BOOST_DOT_VERSION}/source/boost_${BOOST_VERSION}.tar.gz
tar xzf boost.tar.gz
mv boost_${BOOST_VERSION} boost
cd boost
./bootstrap.sh
cd ..
- name: setup openssl
run: |
wget -nv -O openssl.tar.gz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar xzf openssl.tar.gz
cd openssl-${OPENSSL_VERSION}
./Configure linux-x86_64 ${OPENSSL_NO_OPTS} -fPIC --prefix=${PWD}/../openssl
make &> /dev/null
make install_sw &> /dev/null
cd ..
- name: build
run: |
export BOOST_ROOT=${PWD}/boost
export OPENSSL_ROOT=${PWD}/openssl
export LIBTORRENT_ROOT=${PWD}/swig/deps/libtorrent
cd swig
${BOOST_ROOT}/b2 -j2 --user-config=config/linux-x86_64-config.jam variant=release toolset=gcc-x86_64 target-os=linux location=bin/release/linux/x86_64
cd ..
- name: strip
run: |
objcopy --only-keep-debug swig/bin/release/linux/x86_64/libtorrent4j.so swig/bin/release/linux/x86_64/libtorrent4j.so.debug
strip --strip-unneeded -x swig/bin/release/linux/x86_64/libtorrent4j.so
- name: dependencies
run: readelf -d swig/bin/release/linux/x86_64/libtorrent4j.so
- name: test
run: |
cp swig/bin/release/linux/x86_64/libtorrent4j.so .
./gradlew test
- uses: actions/upload-artifact@v2
with:
name: libtorrent4j-linux-b2
path: |
swig/bin/release/linux/x86_64/libtorrent4j.so
swig/bin/release/linux/x86_64/libtorrent4j.so.debug
retention-days: 5
arm-b2:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup gcc
run: |
sudo apt update
sudo apt install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi
- name: setup boost
run: |
wget -nv -O boost.tar.gz https://boostorg.jfrog.io/artifactory/main/release/${BOOST_DOT_VERSION}/source/boost_${BOOST_VERSION}.tar.gz
tar xzf boost.tar.gz
mv boost_${BOOST_VERSION} boost
cd boost
./bootstrap.sh
cd ..
- name: setup openssl
run: |
export CC=arm-linux-gnueabi-gcc
export AR=arm-linux-gnueabi-gcc-ar
export LD=arm-linux-gnueabi-ld
export RANLIB=arm-linux-gnueabi-gcc-ranlib
wget -nv -O openssl.tar.gz https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar xzf openssl.tar.gz
cd openssl-${OPENSSL_VERSION}
./Configure linux-armv4 ${OPENSSL_NO_OPTS} -fPIC --prefix=${PWD}/../openssl
make &> /dev/null
make install_sw &> /dev/null
cd ..
- name: build
run: |
export BOOST_ROOT=${PWD}/boost
export OPENSSL_ROOT=${PWD}/openssl
export LIBTORRENT_ROOT=${PWD}/swig/deps/libtorrent
export CXX=arm-linux-gnueabi-g++
export CC=arm-linux-gnueabi-gcc
export AR=arm-linux-gnueabi-gcc-ar
export LD=arm-linux-gnueabi-ld
export RANLIB=arm-linux-gnueabi-gcc-ranlib
cd swig
${BOOST_ROOT}/b2 -j2 --user-config=config/linux-arm-config.jam variant=release toolset=gcc-arm target-os=linux location=bin/release/linux/arm
cd ..
- name: strip
run: |
arm-linux-gnueabi-objcopy --only-keep-debug swig/bin/release/linux/arm/libtorrent4j.so swig/bin/release/linux/arm/libtorrent4j.so.debug
arm-linux-gnueabi-strip --strip-unneeded -x swig/bin/release/linux/arm/libtorrent4j.so
- name: dependencies
run: arm-linux-gnueabi-readelf -d swig/bin/release/linux/arm/libtorrent4j.so
- uses: actions/upload-artifact@v3
with:
name: libtorrent4j-linux-arm-b2
path: |
swig/bin/release/linux/arm/libtorrent4j.so
swig/bin/release/linux/arm/libtorrent4j.so.debug
retention-days: 5