From 17f2c1f096ec120f5386a5189b248f9b188b688c Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Mon, 11 Dec 2023 10:29:38 -0800 Subject: [PATCH] drone: mac/linux differences --- .drone.star | 92 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/.drone.star b/.drone.star index 47e80c86d..3700aaa59 100644 --- a/.drone.star +++ b/.drone.star @@ -1,8 +1,8 @@ PLATFORMS = [ {"os": "linux", "arch": "amd64"}, {"os": "linux", "arch": "arm64"}, - # {"os": "darwin", "arch": "amd64"}, - # {"os": "darwin", "arch": "arm64"}, + {"os": "darwin", "arch": "amd64"}, + {"os": "darwin", "arch": "arm64"}, ] DOCKER_REPOSITORY = "livepeerci/mistserver" @@ -176,6 +176,58 @@ def binaries_pipeline(context, platform): context.build.event == "tag" and context.build.ref ) or context.build.commit + steps = [] + + if platform["os"] == "linux": + steps.append({ + "name": "libraries", + "commands": [ + 'apt -o DPkg::Lock::Timeout=60 install -y libnss3-dev libssl-dev pkg-config', + ], + }) + + if platform["os"] == "darwin": + steps.append({ + "name": "libraries", + "commands": [ + 'brew install nss', + ], + }) + + steps.extend([ + { + "name": "binaries", + "commands": [ + 'export CI_PATH="$(realpath ..)"', + "echo {} | tee BUILD_VERSION".format(version), + "meson setup -DLOAD_BALANCE=true -DNORIST=true -DNORIST=true -Dprefix=$CI_PATH --default-library static build", + "cd build/", + "ninja && ninja install", + ], + }, + { + "name": "compress", + "commands": [ + 'export CI_PATH="$(realpath ..)"', + "cd $CI_PATH/bin/", + "tar -czvf livepeer-mistserver-%s-%s.tar.gz ./*" + % (platform["os"], platform["arch"]), + ], + }, + { + "name": "upload", + "commands": [ + 'scripts/upload_build.sh -d "$(realpath ..)/bin" "livepeer-mistserver-%s-%s.tar.gz"' + % (platform["os"], platform["arch"]), + ], + "environment": get_environment( + "GCLOUD_KEY", + "GCLOUD_SECRET", + "GCLOUD_BUCKET", + ), + }, + ]) + return { "kind": "pipeline", "name": "build-%s-%s" % (platform["os"], platform["arch"]), @@ -191,41 +243,7 @@ def binaries_pipeline(context, platform): }, "workspace": {"path": "drone/mistserver"}, "clone": {"depth": 0}, - "steps": [ - { - "name": "binaries", - "commands": [ - 'apt update', - 'apt install -y libnss3-dev libssl-dev pkg-config', - 'export CI_PATH="$(realpath ..)"', - "echo {} | tee BUILD_VERSION".format(version), - "meson setup -DLOAD_BALANCE=true -DNORIST=true -DNORIST=true -Dprefix=$CI_PATH --default-library static build", - "cd build/", - "ninja && ninja install", - ], - }, - { - "name": "compress", - "commands": [ - 'export CI_PATH="$(realpath ..)"', - "cd $CI_PATH/bin/", - "tar -czvf livepeer-mistserver-%s-%s.tar.gz ./*" - % (platform["os"], platform["arch"]), - ], - }, - { - "name": "upload", - "commands": [ - 'scripts/upload_build.sh -d "$(realpath ..)/bin" "livepeer-mistserver-%s-%s.tar.gz"' - % (platform["os"], platform["arch"]), - ], - "environment": get_environment( - "GCLOUD_KEY", - "GCLOUD_SECRET", - "GCLOUD_BUCKET", - ), - }, - ], + "steps": steps, }