consolidate windows ci drone jizz

pull/1307/head
Jeff Becker 4 years ago
parent 2e806cc145
commit 48c7d6fbe5
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -2,6 +2,9 @@ local default_deps_base='libsystemd-dev python3-dev libcurl4-openssl-dev libuv1-
local default_deps_nocxx='libsodium-dev ' + default_deps_base; // libsodium-dev needs to be >= 1.0.18 local default_deps_nocxx='libsodium-dev ' + default_deps_base; // libsodium-dev needs to be >= 1.0.18
local default_deps='g++ ' + default_deps_nocxx; // g++ sometimes needs replacement local default_deps='g++ ' + default_deps_nocxx; // g++ sometimes needs replacement
local default_windows_deps='mingw-w64-binutils mingw-w64-gcc mingw-w64-crt mingw-w64-headers mingw-w64-winpthreads perl'; // deps for windows cross compile
local submodules = { local submodules = {
name: 'submodules', name: 'submodules',
image: 'drone/git', image: 'drone/git',
@ -50,51 +53,15 @@ local debian_pipeline(name, image,
], ],
}; };
// 32-bit windows build on alpine: // windows cross compile on alpine linux
local alpine_wow64_pipeline(name, image, local windows_cross_pipeline(name, image,
arch='amd64',
deps='mingw-w64-binutils mingw-w64-gcc mingw-w64-crt mingw-w64-headers mingw-w64-winpthreads',
build_type='Release',
lto=false,
werror=false,
cmake_extra='',
extra_cmds=[],
allow_fail=false) = {
kind: 'pipeline',
type: 'docker',
name: name,
platform: { arch: arch },
trigger: { branch: { exclude: ['debian/*', 'ubuntu/*'] } },
steps: [
submodules,
{
name: 'build',
image: image,
[if allow_fail then "failure"]: "ignore",
environment: { SSH_KEY: { from_secret: "SSH_KEY" } },
commands: [
'apk add cmake git ninja pkgconf ccache patch make ' + deps,
'git clone https://github.com/despair86/libuv.git win32-setup/libuv',
'mkdir build',
'cd build',
'cmake .. -G Ninja -DCMAKE_EXE_LINKER_FLAGS=-fstack-protector -DLIBUV_ROOT=$PWD/../win32-setup/libuv -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_TOOLCHAIN_FILE=../contrib/cross/mingw32.cmake -DCMAKE_BUILD_TYPE='+build_type+' ' +
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
(if lto then '' else '-DWITH_LTO=OFF ') +
cmake_extra,
'ninja -v',
] + extra_cmds,
}
],
};
// 64-bit windows build on alpine:
local alpine_win32_pipeline(name, image,
arch='amd64', arch='amd64',
deps='mingw-w64-binutils mingw-w64-gcc mingw-w64-crt mingw-w64-headers mingw-w64-winpthreads', deps=default_windows_deps,
build_type='Release', build_type='Release',
lto=false, lto=true,
werror=false, werror=false,
cmake_extra='', cmake_extra='',
toolchain='mingw32',
extra_cmds=[], extra_cmds=[],
allow_fail=false) = { allow_fail=false) = {
kind: 'pipeline', kind: 'pipeline',
@ -114,9 +81,10 @@ local alpine_win32_pipeline(name, image,
'git clone https://github.com/despair86/libuv.git win32-setup/libuv', 'git clone https://github.com/despair86/libuv.git win32-setup/libuv',
'mkdir build', 'mkdir build',
'cd build', 'cd build',
'cmake .. -G Ninja -DCMAKE_EXE_LINKER_FLAGS=-fstack-protector -DLIBUV_ROOT=$PWD/../win32-setup/libuv -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_TOOLCHAIN_FILE=../contrib/cross/mingw64.cmake -DCMAKE_BUILD_TYPE='+build_type+' ' + 'cmake .. -G Ninja -DCMAKE_CROSSCOMPILE=ON -DCMAKE_EXE_LINKER_FLAGS=-fstack-protector -DLIBUV_ROOT=$PWD/../win32-setup/libuv -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_TOOLCHAIN_FILE=../contrib/cross/'+toolchain+'.cmake -DCMAKE_BUILD_TYPE='+build_type+' ' +
(if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') + (if werror then '-DWARNINGS_AS_ERRORS=ON ' else '') +
(if lto then '' else '-DWITH_LTO=OFF ') + (if lto then '' else '-DWITH_LTO=OFF ') +
"-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON" +
cmake_extra, cmake_extra,
'ninja -v', 'ninja -v',
] + extra_cmds, ] + extra_cmds,
@ -230,8 +198,14 @@ local mac_builder(name, build_type='Release', werror=true, cmake_extra='', extra
debian_pipeline("Debian buster (armhf)", "arm32v7/debian:buster", arch="arm64", cmake_extra='-DDOWNLOAD_SODIUM=ON'), debian_pipeline("Debian buster (armhf)", "arm32v7/debian:buster", arch="arm64", cmake_extra='-DDOWNLOAD_SODIUM=ON'),
// Windows builds (WOW64 and native) // Windows builds (WOW64 and native)
alpine_win32_pipeline("win32 on alpine (amd64)", "alpine:edge", cmake_extra="-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON", lto=false), windows_cross_pipeline("win32 on alpine (amd64)", "alpine:edge",
alpine_wow64_pipeline("win32 on alpine (i386)", "i386/alpine:edge", cmake_extra="-DBUILD_STATIC_DEPS=ON -DDOWNLOAD_SODIUM=ON -DBUILD_PACKAGE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=ON -DNATIVE_BUILD=OFF -DSTATIC_LINK=ON", lto=false), toolchain='mingw64', extra_cmds=[
'../contrib/ci/drone-static-upload.sh'
]),
windows_cross_pipeline("win32 on alpine (i386)", "i386/alpine:edge",
toolchain='mingw32', extra_cmds=[
'../contrib/ci/drone-static-upload.sh'
]),
// Static build (on bionic) which gets uploaded to builds.lokinet.dev: // Static build (on bionic) which gets uploaded to builds.lokinet.dev:
debian_pipeline("Static (bionic amd64)", "ubuntu:bionic", deps='g++-8 python3-dev', lto=true, debian_pipeline("Static (bionic amd64)", "ubuntu:bionic", deps='g++-8 python3-dev', lto=true,

@ -29,8 +29,11 @@ else
fi fi
mkdir -v "$base" mkdir -v "$base"
mv -v daemon/lokinet "$base" # copy lokinet-bootstrap.ps1 and lokinet.exe if we are a windows build
cp -av ../lokinet-bootstrap "$base" test -e daemon/lokinet.exe && cp -av daemon/lokinet.exe ../lokinet-bootstrap.ps1 "$base"
# copy lokinet-bootstrap shell script and built binary if we aren't a windows build
test -e daemon/lokinet && cp -av daemon/lokinet ../lokinet-bootstrap "$base"
# tar dat shiz up yo
tar cJvf "${base}.tar.xz" "$base" tar cJvf "${base}.tar.xz" "$base"
upload_to="builds.lokinet.dev/${DRONE_REPO// /_}/${DRONE_BRANCH// /_}" upload_to="builds.lokinet.dev/${DRONE_REPO// /_}/${DRONE_BRANCH// /_}"

Loading…
Cancel
Save