Skip to content

Commit

Permalink
drone: mac/linux differences
Browse files Browse the repository at this point in the history
  • Loading branch information
iameli committed Dec 11, 2023
1 parent fb239fb commit 17f2c1f
Showing 1 changed file with 55 additions and 37 deletions.
92 changes: 55 additions & 37 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"]),
Expand All @@ -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,
}


Expand Down

0 comments on commit 17f2c1f

Please sign in to comment.