2021-10-15 15:29:18 +00:00
|
|
|
local default_deps_base = [
|
|
|
|
'libsystemd-dev',
|
|
|
|
'python3-dev',
|
|
|
|
'libuv1-dev',
|
|
|
|
'libunbound-dev',
|
|
|
|
'nettle-dev',
|
|
|
|
'libssl-dev',
|
|
|
|
'libevent-dev',
|
|
|
|
'libsqlite3-dev',
|
|
|
|
'libcurl4-openssl-dev',
|
|
|
|
'libzmq3-dev',
|
|
|
|
'make',
|
|
|
|
];
|
|
|
|
local default_deps_nocxx = ['libsodium-dev'] + default_deps_base; // libsodium-dev needs to be >= 1.0.18
|
|
|
|
local default_deps = ['g++'] + default_deps_nocxx;
|
2021-02-26 17:26:48 +00:00
|
|
|
local docker_base = 'registry.oxen.rocks/lokinet-ci-';
|
2020-06-17 13:42:11 +00:00
|
|
|
|
2022-07-16 00:41:14 +00:00
|
|
|
local submodule_commands = [
|
|
|
|
'git fetch --tags',
|
|
|
|
'git submodule update --init --recursive --depth=1 --jobs=4',
|
|
|
|
];
|
2020-06-12 16:57:59 +00:00
|
|
|
local submodules = {
|
2021-10-15 00:02:11 +00:00
|
|
|
name: 'submodules',
|
|
|
|
image: 'drone/git',
|
2021-10-18 16:50:43 +00:00
|
|
|
commands: submodule_commands,
|
2020-06-12 16:57:59 +00:00
|
|
|
};
|
|
|
|
|
2022-05-02 20:32:45 +00:00
|
|
|
// cmake options for static deps mirror
|
2022-10-05 22:25:58 +00:00
|
|
|
local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https://oxen.rocks/deps ' else '');
|
2022-05-02 20:32:45 +00:00
|
|
|
|
2020-11-10 10:25:37 +00:00
|
|
|
local apt_get_quiet = 'apt-get -o=Dpkg::Use-Pty=0 -q';
|
|
|
|
|
2020-05-23 03:32:00 +00:00
|
|
|
// Regular build on a debian-like system:
|
2021-10-15 00:02:11 +00:00
|
|
|
local debian_pipeline(name,
|
|
|
|
image,
|
|
|
|
arch='amd64',
|
|
|
|
deps=default_deps,
|
|
|
|
build_type='Release',
|
|
|
|
lto=false,
|
|
|
|
werror=true,
|
|
|
|
cmake_extra='',
|
2022-10-05 22:25:58 +00:00
|
|
|
local_mirror=true,
|
2021-10-15 00:02:11 +00:00
|
|
|
extra_cmds=[],
|
|
|
|
jobs=6,
|
|
|
|
tests=true,
|
2022-05-30 20:06:27 +00:00
|
|
|
oxen_repo=false,
|
2021-10-15 00:02:11 +00:00
|
|
|
allow_fail=false) = {
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: name,
|
|
|
|
platform: { arch: arch },
|
|
|
|
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
|
|
|
|
steps: [
|
|
|
|
submodules,
|
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: image,
|
2021-10-17 20:36:33 +00:00
|
|
|
pull: 'always',
|
2021-10-15 00:02:11 +00:00
|
|
|
[if allow_fail then 'failure']: 'ignore',
|
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
|
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
|
|
|
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
|
|
|
|
apt_get_quiet + ' update',
|
|
|
|
apt_get_quiet + ' install -y eatmydata',
|
|
|
|
] + (
|
2022-05-30 20:06:27 +00:00
|
|
|
if oxen_repo then [
|
2021-10-17 20:33:30 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y lsb-release',
|
2021-10-16 19:00:27 +00:00
|
|
|
'cp contrib/deb.oxen.io.gpg /etc/apt/trusted.gpg.d',
|
|
|
|
'echo deb http://deb.oxen.io $$(lsb_release -sc) main >/etc/apt/sources.list.d/oxen.list',
|
2021-10-15 00:02:11 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' update',
|
|
|
|
] else []
|
2020-06-26 21:52:04 +00:00
|
|
|
) + [
|
2021-10-15 00:02:11 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' dist-upgrade -y',
|
2021-10-17 20:33:30 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y gdb cmake git pkg-config ccache ' + std.join(' ', deps),
|
2021-10-15 00:02:11 +00:00
|
|
|
'mkdir build',
|
|
|
|
'cd build',
|
|
|
|
'cmake .. -DWITH_SETCAP=OFF -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE=' + build_type + ' ' +
|
2022-09-03 15:43:40 +00:00
|
|
|
(if build_type == 'Debug' then ' -DWARN_DEPRECATED=OFF ' else '') +
|
2021-10-15 00:02:11 +00:00
|
|
|
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
|
|
|
|
'-DWITH_LTO=' + (if lto then 'ON ' else 'OFF ') +
|
2022-01-25 18:13:20 +00:00
|
|
|
'-DWITH_TESTS=' + (if tests then 'ON ' else 'OFF ') +
|
2022-10-05 22:25:58 +00:00
|
|
|
cmake_extra +
|
|
|
|
ci_dep_mirror(local_mirror),
|
2021-10-15 00:02:11 +00:00
|
|
|
'VERBOSE=1 make -j' + jobs,
|
2022-10-20 15:12:02 +00:00
|
|
|
'cd ..',
|
2021-10-15 00:02:11 +00:00
|
|
|
]
|
2022-10-20 15:12:02 +00:00
|
|
|
+ (if tests then ['./contrib/ci/drone-gdb.sh ./build/test/testAll --use-colour yes'] else [])
|
2021-10-15 00:02:11 +00:00
|
|
|
+ extra_cmds,
|
|
|
|
},
|
|
|
|
],
|
2020-05-23 03:39:04 +00:00
|
|
|
};
|
2021-06-18 15:28:33 +00:00
|
|
|
local apk_builder(name, image, extra_cmds=[], allow_fail=false, jobs=6) = {
|
2021-10-15 00:02:11 +00:00
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: name,
|
|
|
|
platform: { arch: 'amd64' },
|
|
|
|
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
|
|
|
|
steps: [
|
|
|
|
submodules,
|
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: image,
|
2021-10-17 20:36:33 +00:00
|
|
|
pull: 'always',
|
2021-10-15 00:02:11 +00:00
|
|
|
[if allow_fail then 'failure']: 'ignore',
|
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, ANDROID: 'android' },
|
|
|
|
commands: [
|
|
|
|
'VERBOSE=1 JOBS=' + jobs + ' NDK=/usr/lib/android-ndk ./contrib/android.sh',
|
|
|
|
'git clone https://github.com/oxen-io/lokinet-flutter-app lokinet-mobile',
|
2021-11-23 17:37:22 +00:00
|
|
|
'cp -av build-android/out/* lokinet-mobile/lokinet_lib/android/src/main/jniLibs/',
|
2021-10-15 00:02:11 +00:00
|
|
|
'cd lokinet-mobile',
|
|
|
|
'flutter build apk --debug',
|
|
|
|
'cd ..',
|
|
|
|
'cp lokinet-mobile/build/app/outputs/apk/debug/app-debug.apk lokinet.apk',
|
|
|
|
] + extra_cmds,
|
|
|
|
},
|
|
|
|
],
|
2021-03-02 18:18:22 +00:00
|
|
|
};
|
|
|
|
// windows cross compile on debian
|
2021-10-15 00:02:11 +00:00
|
|
|
local windows_cross_pipeline(name,
|
|
|
|
image,
|
2022-10-26 17:13:40 +00:00
|
|
|
gui_image=docker_base + 'nodejs-lts',
|
2021-10-15 00:02:11 +00:00
|
|
|
arch='amd64',
|
|
|
|
build_type='Release',
|
|
|
|
lto=false,
|
|
|
|
werror=false,
|
|
|
|
cmake_extra='',
|
2022-10-05 22:25:58 +00:00
|
|
|
local_mirror=true,
|
2021-10-15 00:02:11 +00:00
|
|
|
extra_cmds=[],
|
|
|
|
jobs=6,
|
|
|
|
allow_fail=false) = {
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: name,
|
|
|
|
platform: { arch: arch },
|
|
|
|
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
|
|
|
|
steps: [
|
|
|
|
submodules,
|
2022-10-26 17:13:40 +00:00
|
|
|
{
|
|
|
|
name: 'GUI',
|
|
|
|
image: gui_image,
|
|
|
|
pull: 'always',
|
|
|
|
[if allow_fail then 'failure']: 'ignore',
|
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
|
|
|
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
|
|
|
|
apt_get_quiet + ' update',
|
|
|
|
apt_get_quiet + ' install -y eatmydata',
|
|
|
|
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y p7zip-full wine',
|
|
|
|
'cd gui',
|
|
|
|
'yarn install --frozen-lockfile',
|
|
|
|
'USE_SYSTEM_7ZA=true DISPLAY= WINEDEBUG=-all yarn win32',
|
|
|
|
],
|
|
|
|
},
|
2021-10-15 00:02:11 +00:00
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: image,
|
2021-10-17 20:36:33 +00:00
|
|
|
pull: 'always',
|
2021-10-15 00:02:11 +00:00
|
|
|
[if allow_fail then 'failure']: 'ignore',
|
2022-10-26 14:42:56 +00:00
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, WINDOWS_BUILD_NAME: 'x64' },
|
2021-10-15 00:02:11 +00:00
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
|
|
|
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
|
|
|
|
apt_get_quiet + ' update',
|
|
|
|
apt_get_quiet + ' install -y eatmydata',
|
2022-10-27 04:55:03 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y build-essential cmake git pkg-config ccache g++-mingw-w64-x86-64-posix nsis zip icoutils automake libtool librsvg2-bin bison',
|
2021-10-15 00:02:11 +00:00
|
|
|
'update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix',
|
|
|
|
'update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix',
|
2022-10-26 17:13:40 +00:00
|
|
|
'JOBS=' + jobs + ' VERBOSE=1 ./contrib/windows.sh -DSTRIP_SYMBOLS=ON -DGUI_EXE=$${DRONE_WORKSPACE}/gui/release/Lokinet-GUI_portable.exe' +
|
2022-10-05 22:25:58 +00:00
|
|
|
ci_dep_mirror(local_mirror),
|
2021-10-15 00:02:11 +00:00
|
|
|
] + extra_cmds,
|
|
|
|
},
|
|
|
|
],
|
2020-06-12 22:48:49 +00:00
|
|
|
};
|
2020-05-23 03:39:04 +00:00
|
|
|
|
2022-02-02 15:22:42 +00:00
|
|
|
// linux cross compile on debian
|
|
|
|
local linux_cross_pipeline(name,
|
|
|
|
cross_targets,
|
|
|
|
arch='amd64',
|
|
|
|
build_type='Release',
|
|
|
|
cmake_extra='',
|
2022-10-05 22:25:58 +00:00
|
|
|
local_mirror=true,
|
2022-02-02 15:22:42 +00:00
|
|
|
extra_cmds=[],
|
|
|
|
jobs=6,
|
|
|
|
allow_fail=false) = {
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: name,
|
|
|
|
platform: { arch: arch },
|
|
|
|
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
|
|
|
|
steps: [
|
|
|
|
submodules,
|
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: docker_base + 'debian-stable-cross',
|
|
|
|
pull: 'always',
|
|
|
|
[if allow_fail then 'failure']: 'ignore',
|
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' }, CROSS_TARGETS: std.join(':', cross_targets) },
|
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
2022-10-05 22:25:58 +00:00
|
|
|
'VERBOSE=1 JOBS=' + jobs + ' ./contrib/cross.sh ' + std.join(' ', cross_targets) +
|
|
|
|
' -- ' + cmake_extra + ci_dep_mirror(local_mirror),
|
2022-05-02 20:52:56 +00:00
|
|
|
],
|
2022-02-02 15:22:42 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
2020-05-23 03:39:04 +00:00
|
|
|
// Builds a snapshot .deb on a debian-like system by merging into the debian/* or ubuntu/* branch
|
2022-05-30 20:06:27 +00:00
|
|
|
local deb_builder(image, distro, distro_branch, arch='amd64', oxen_repo=true) = {
|
2021-10-15 00:02:11 +00:00
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: 'DEB (' + distro + (if arch == 'amd64' then '' else '/' + arch) + ')',
|
|
|
|
platform: { arch: arch },
|
|
|
|
environment: { distro_branch: distro_branch, distro: distro },
|
|
|
|
steps: [
|
|
|
|
submodules,
|
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: image,
|
2021-10-17 20:36:33 +00:00
|
|
|
pull: 'always',
|
2021-10-15 00:02:11 +00:00
|
|
|
failure: 'ignore',
|
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
|
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
|
|
|
'echo "man-db man-db/auto-update boolean false" | debconf-set-selections',
|
2022-05-30 20:06:27 +00:00
|
|
|
] + (if oxen_repo then [
|
2021-10-16 19:00:27 +00:00
|
|
|
'cp contrib/deb.oxen.io.gpg /etc/apt/trusted.gpg.d',
|
|
|
|
'echo deb http://deb.oxen.io $${distro} main >/etc/apt/sources.list.d/oxen.list',
|
2021-10-15 00:02:11 +00:00
|
|
|
] else []) + [
|
|
|
|
apt_get_quiet + ' update',
|
|
|
|
apt_get_quiet + ' install -y eatmydata',
|
2021-10-17 20:33:30 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git devscripts equivs ccache git-buildpackage python3-dev',
|
2021-10-15 00:02:11 +00:00
|
|
|
|||
|
|
|
|
# Look for the debian branch in this repo first, try upstream if that fails.
|
|
|
|
if ! git checkout $${distro_branch}; then
|
2021-10-17 19:53:06 +00:00
|
|
|
git remote add --fetch upstream https://github.com/oxen-io/lokinet.git &&
|
2021-10-15 00:02:11 +00:00
|
|
|
git checkout $${distro_branch}
|
|
|
|
fi
|
|
|
|
|||,
|
|
|
|
// Tell the merge how to resolve conflicts in the source .drone.jsonnet (we don't
|
|
|
|
// care about it at all since *this* .drone.jsonnet is already loaded).
|
|
|
|
'git config merge.ours.driver true',
|
|
|
|
'echo .drone.jsonnet merge=ours >>.gitattributes',
|
2020-11-10 10:25:37 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
'git merge ${DRONE_COMMIT}',
|
|
|
|
'export DEBEMAIL="${DRONE_COMMIT_AUTHOR_EMAIL}" DEBFULLNAME="${DRONE_COMMIT_AUTHOR_NAME}"',
|
|
|
|
'gbp dch -S -s "HEAD^" --spawn-editor=never -U low',
|
|
|
|
'eatmydata mk-build-deps --install --remove --tool "' + apt_get_quiet + ' -o Debug::pkgProblemResolver=yes --no-install-recommends -y"',
|
|
|
|
'export DEB_BUILD_OPTIONS="parallel=$$(nproc)"',
|
|
|
|
//'grep -q lib debian/lokinet-bin.install || echo "/usr/lib/lib*.so*" >>debian/lokinet-bin.install',
|
|
|
|
'debuild -e CCACHE_DIR -b',
|
|
|
|
'./contrib/ci/drone-debs-upload.sh ' + distro,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2020-05-15 23:29:05 +00:00
|
|
|
};
|
|
|
|
|
2021-10-14 22:49:45 +00:00
|
|
|
local clang(version) = debian_pipeline(
|
2021-10-15 00:02:11 +00:00
|
|
|
'Debian sid/clang-' + version + ' (amd64)',
|
2021-10-16 15:11:39 +00:00
|
|
|
docker_base + 'debian-sid-clang',
|
2021-10-15 15:29:18 +00:00
|
|
|
deps=['clang-' + version] + default_deps_nocxx,
|
2021-10-15 00:02:11 +00:00
|
|
|
cmake_extra='-DCMAKE_C_COMPILER=clang-' + version + ' -DCMAKE_CXX_COMPILER=clang++-' + version + ' '
|
2021-10-14 22:49:45 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
local full_llvm(version) = debian_pipeline(
|
2021-10-15 00:02:11 +00:00
|
|
|
'Debian sid/llvm-' + version + ' (amd64)',
|
2021-10-16 15:11:39 +00:00
|
|
|
docker_base + 'debian-sid-clang',
|
2021-10-15 15:29:18 +00:00
|
|
|
deps=['clang-' + version, ' lld-' + version, ' libc++-' + version + '-dev', 'libc++abi-' + version + '-dev']
|
2021-10-15 00:02:11 +00:00
|
|
|
+ default_deps_nocxx,
|
|
|
|
cmake_extra='-DCMAKE_C_COMPILER=clang-' + version +
|
|
|
|
' -DCMAKE_CXX_COMPILER=clang++-' + version +
|
|
|
|
' -DCMAKE_CXX_FLAGS=-stdlib=libc++ ' +
|
|
|
|
std.join(' ', [
|
|
|
|
'-DCMAKE_' + type + '_LINKER_FLAGS=-fuse-ld=lld-' + version
|
|
|
|
for type in ['EXE', 'MODULE', 'SHARED']
|
|
|
|
])
|
2021-10-14 22:49:45 +00:00
|
|
|
);
|
2021-03-02 18:18:22 +00:00
|
|
|
|
2020-05-23 14:46:45 +00:00
|
|
|
// Macos build
|
2021-04-27 20:34:17 +00:00
|
|
|
local mac_builder(name,
|
2021-10-15 00:02:11 +00:00
|
|
|
build_type='Release',
|
|
|
|
werror=true,
|
|
|
|
cmake_extra='',
|
2022-10-05 22:25:58 +00:00
|
|
|
local_mirror=true,
|
2021-10-15 00:02:11 +00:00
|
|
|
extra_cmds=[],
|
|
|
|
jobs=6,
|
2022-06-15 19:42:48 +00:00
|
|
|
codesign='-DCODESIGN=OFF',
|
2021-10-15 00:02:11 +00:00
|
|
|
allow_fail=false) = {
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'exec',
|
|
|
|
name: name,
|
|
|
|
platform: { os: 'darwin', arch: 'amd64' },
|
|
|
|
steps: [
|
2021-10-18 16:50:43 +00:00
|
|
|
{ name: 'submodules', commands: submodule_commands },
|
2021-10-15 00:02:11 +00:00
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
|
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
|
|
|
// If you don't do this then the C compiler doesn't have an include path containing
|
|
|
|
// basic system headers. WTF apple:
|
|
|
|
'export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"',
|
|
|
|
'ulimit -n 1024', // because macos sets ulimit to 256 for some reason yeah idk
|
2022-10-05 22:25:58 +00:00
|
|
|
'./contrib/mac-configure.sh ' +
|
|
|
|
ci_dep_mirror(local_mirror) +
|
|
|
|
(if build_type == 'Debug' then ' -DWARN_DEPRECATED=OFF ' else '') +
|
|
|
|
codesign,
|
2022-09-19 18:52:29 +00:00
|
|
|
'cd build-mac',
|
|
|
|
// We can't use the 'package' target here because making a .dmg requires an active logged in
|
|
|
|
// macos gui to invoke Finder to invoke the partitioning tool to create a partitioned (!)
|
|
|
|
// disk image. Most likely the GUI is required because if you lose sight of how pretty the
|
|
|
|
// surface of macOS is you might see how ugly the insides are.
|
|
|
|
'ninja -j' + jobs + ' assemble_gui',
|
2022-10-20 15:12:02 +00:00
|
|
|
'cd ..',
|
2021-10-15 00:02:11 +00:00
|
|
|
] + extra_cmds,
|
|
|
|
},
|
|
|
|
],
|
2020-05-23 14:46:45 +00:00
|
|
|
};
|
|
|
|
|
2022-02-04 15:33:54 +00:00
|
|
|
local docs_pipeline(name, image, extra_cmds=[], allow_fail=false) = {
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
name: name,
|
|
|
|
platform: { arch: 'amd64' },
|
|
|
|
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
|
|
|
|
steps: [
|
|
|
|
submodules,
|
|
|
|
{
|
|
|
|
name: 'build',
|
|
|
|
image: image,
|
|
|
|
pull: 'always',
|
|
|
|
[if allow_fail then 'failure']: 'ignore',
|
|
|
|
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
|
|
|
|
commands: [
|
|
|
|
'cmake -S . -B build-docs',
|
|
|
|
'make -C build-docs doc',
|
|
|
|
] + extra_cmds,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
2020-05-23 03:39:04 +00:00
|
|
|
|
2020-05-15 23:29:05 +00:00
|
|
|
[
|
2021-10-15 00:02:11 +00:00
|
|
|
{
|
|
|
|
name: 'lint check',
|
|
|
|
kind: 'pipeline',
|
|
|
|
type: 'docker',
|
|
|
|
steps: [{
|
|
|
|
name: 'build',
|
2021-10-16 15:11:39 +00:00
|
|
|
image: docker_base + 'lint',
|
2021-10-17 20:36:33 +00:00
|
|
|
pull: 'always',
|
2021-10-15 00:02:11 +00:00
|
|
|
commands: [
|
|
|
|
'echo "Building on ${DRONE_STAGE_MACHINE}"',
|
|
|
|
apt_get_quiet + ' update',
|
|
|
|
apt_get_quiet + ' install -y eatmydata',
|
2022-10-20 22:23:14 +00:00
|
|
|
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-14 jsonnet',
|
2021-10-15 00:02:11 +00:00
|
|
|
'./contrib/ci/drone-format-verify.sh',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
},
|
2022-02-04 19:38:50 +00:00
|
|
|
// documentation builder
|
|
|
|
docs_pipeline('Documentation',
|
|
|
|
docker_base + 'docbuilder',
|
|
|
|
extra_cmds=['UPLOAD_OS=docs ./contrib/ci/drone-static-upload.sh']),
|
2020-05-23 03:32:00 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// Various debian builds
|
2021-10-16 15:11:39 +00:00
|
|
|
debian_pipeline('Debian sid (amd64)', docker_base + 'debian-sid'),
|
|
|
|
debian_pipeline('Debian sid/Debug (amd64)', docker_base + 'debian-sid', build_type='Debug'),
|
2021-10-15 00:02:11 +00:00
|
|
|
clang(13),
|
|
|
|
full_llvm(13),
|
2021-10-17 21:11:55 +00:00
|
|
|
debian_pipeline('Debian stable (i386)', docker_base + 'debian-stable/i386'),
|
2021-10-17 17:46:30 +00:00
|
|
|
debian_pipeline('Debian buster (amd64)', docker_base + 'debian-buster', cmake_extra='-DDOWNLOAD_SODIUM=ON'),
|
|
|
|
debian_pipeline('Ubuntu latest (amd64)', docker_base + 'ubuntu-rolling'),
|
|
|
|
debian_pipeline('Ubuntu LTS (amd64)', docker_base + 'ubuntu-lts'),
|
2021-10-15 00:02:11 +00:00
|
|
|
debian_pipeline('Ubuntu bionic (amd64)',
|
2021-10-16 15:11:39 +00:00
|
|
|
docker_base + 'ubuntu-bionic',
|
2021-10-15 15:29:18 +00:00
|
|
|
deps=['g++-8'] + default_deps_nocxx,
|
2021-10-15 00:02:11 +00:00
|
|
|
cmake_extra='-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8',
|
2022-05-30 20:06:27 +00:00
|
|
|
oxen_repo=true),
|
2020-05-23 03:32:00 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// ARM builds (ARM64 and armhf)
|
2021-10-17 17:46:30 +00:00
|
|
|
debian_pipeline('Debian sid (ARM64)', docker_base + 'debian-sid', arch='arm64', jobs=4),
|
2021-10-17 21:11:55 +00:00
|
|
|
debian_pipeline('Debian stable (armhf)', docker_base + 'debian-stable/arm32v7', arch='arm64', jobs=4),
|
2022-02-02 15:22:42 +00:00
|
|
|
|
|
|
|
// cross compile targets
|
|
|
|
linux_cross_pipeline('Cross Compile (arm/arm64)', cross_targets=['arm-linux-gnueabihf', 'aarch64-linux-gnu']),
|
|
|
|
linux_cross_pipeline('Cross Compile (ppc64le)', cross_targets=['powerpc64le-linux-gnu']),
|
2022-09-20 00:54:36 +00:00
|
|
|
// Not currently building successfully:
|
|
|
|
//linux_cross_pipeline('Cross Compile (mips)', cross_targets=['mips-linux-gnu', 'mipsel-linux-gnu']),
|
2022-02-02 15:22:42 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// android apk builder
|
2021-10-16 15:11:39 +00:00
|
|
|
apk_builder('android apk', docker_base + 'flutter', extra_cmds=['UPLOAD_OS=android ./contrib/ci/drone-static-upload.sh']),
|
2021-06-18 15:28:33 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// Windows builds (x64)
|
|
|
|
windows_cross_pipeline('Windows (amd64)',
|
2022-10-26 17:13:40 +00:00
|
|
|
docker_base + 'debian-bookworm',
|
2021-10-15 00:02:11 +00:00
|
|
|
extra_cmds=[
|
|
|
|
'./contrib/ci/drone-static-upload.sh',
|
|
|
|
]),
|
2020-05-23 03:32:00 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// Static build (on bionic) which gets uploaded to builds.lokinet.dev:
|
|
|
|
debian_pipeline('Static (bionic amd64)',
|
|
|
|
docker_base + 'ubuntu-bionic',
|
2021-10-15 15:29:18 +00:00
|
|
|
deps=['g++-8', 'python3-dev', 'automake', 'libtool'],
|
2021-10-15 00:02:11 +00:00
|
|
|
lto=true,
|
|
|
|
tests=false,
|
2022-05-30 20:06:27 +00:00
|
|
|
oxen_repo=true,
|
2022-10-05 22:25:58 +00:00
|
|
|
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
|
2021-10-17 20:33:30 +00:00
|
|
|
'-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 ' +
|
|
|
|
'-DCMAKE_CXX_FLAGS="-march=x86-64 -mtune=haswell" ' +
|
|
|
|
'-DCMAKE_C_FLAGS="-march=x86-64 -mtune=haswell" ' +
|
2022-03-30 21:35:45 +00:00
|
|
|
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF -DBUILD_LIBLOKINET=OFF',
|
2021-10-15 00:02:11 +00:00
|
|
|
extra_cmds=[
|
2022-10-20 15:12:02 +00:00
|
|
|
'./contrib/ci/drone-check-static-libs.sh',
|
|
|
|
'./contrib/ci/drone-static-upload.sh',
|
2021-10-15 00:02:11 +00:00
|
|
|
]),
|
2021-10-18 02:44:03 +00:00
|
|
|
// Static armhf build (gets uploaded)
|
|
|
|
debian_pipeline('Static (buster armhf)',
|
|
|
|
docker_base + 'debian-buster/arm32v7',
|
|
|
|
arch='arm64',
|
|
|
|
deps=['g++', 'python3-dev', 'automake', 'libtool'],
|
2022-10-05 22:25:58 +00:00
|
|
|
cmake_extra='-DBUILD_STATIC_DEPS=ON -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON ' +
|
2021-10-18 02:44:03 +00:00
|
|
|
'-DCMAKE_CXX_FLAGS="-march=armv7-a+fp -Wno-psabi" -DCMAKE_C_FLAGS="-march=armv7-a+fp" ' +
|
2021-11-16 14:35:09 +00:00
|
|
|
'-DNATIVE_BUILD=OFF -DWITH_SYSTEMD=OFF -DWITH_BOOTSTRAP=OFF',
|
2021-10-18 02:44:03 +00:00
|
|
|
extra_cmds=[
|
2022-10-20 15:12:02 +00:00
|
|
|
'./contrib/ci/drone-check-static-libs.sh',
|
|
|
|
'UPLOAD_OS=linux-armhf ./contrib/ci/drone-static-upload.sh',
|
2021-10-18 02:44:03 +00:00
|
|
|
],
|
|
|
|
jobs=4),
|
2020-05-23 03:36:30 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// integration tests
|
|
|
|
debian_pipeline('Router Hive',
|
2021-10-17 17:46:30 +00:00
|
|
|
docker_base + 'ubuntu-lts',
|
2021-10-15 15:29:18 +00:00
|
|
|
deps=['python3-dev', 'python3-pytest', 'python3-pybind11'] + default_deps,
|
2021-10-15 00:02:11 +00:00
|
|
|
cmake_extra='-DWITH_HIVE=ON'),
|
2020-06-08 19:15:54 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// Deb builds:
|
2022-03-30 23:38:41 +00:00
|
|
|
deb_builder(docker_base + 'debian-sid-builder', 'sid', 'debian/sid'),
|
|
|
|
deb_builder(docker_base + 'debian-bullseye-builder', 'bullseye', 'debian/bullseye'),
|
2022-05-02 13:42:27 +00:00
|
|
|
deb_builder(docker_base + 'ubuntu-jammy-builder', 'jammy', 'ubuntu/jammy'),
|
2022-03-30 23:38:41 +00:00
|
|
|
deb_builder(docker_base + 'debian-sid-builder', 'sid', 'debian/sid', arch='arm64'),
|
2020-05-23 03:39:04 +00:00
|
|
|
|
2021-10-15 00:02:11 +00:00
|
|
|
// Macos builds:
|
2022-08-30 19:20:28 +00:00
|
|
|
mac_builder('macOS (Release)', extra_cmds=[
|
2022-10-20 15:12:02 +00:00
|
|
|
'./contrib/ci/drone-check-static-libs.sh',
|
|
|
|
'./contrib/ci/drone-static-upload.sh',
|
2022-08-30 19:20:28 +00:00
|
|
|
]),
|
2021-10-15 00:02:11 +00:00
|
|
|
mac_builder('macOS (Debug)', build_type='Debug'),
|
2020-05-15 23:29:05 +00:00
|
|
|
]
|