Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Add Linux artifact to Brim releases (#3)
Browse files Browse the repository at this point in the history
The GitHub workflow for Brim releases now creates a GitHub release with
two artifacts: zeek-TAG.darwin-amd64.zip and zeek-TAG.linux-amd64.zip.
  • Loading branch information
nwt authored Mar 4, 2020
1 parent 434a7c2 commit c63ecd2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/brim-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ on:
- v*brim*

jobs:
macos:
runs-on: macos-10.15
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, ubuntu-18.04]
steps:
- uses: actions/checkout@v2
- run: ./brim/release
Expand Down
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
project(Zeek C CXX)

# Brim: Prefer static libraries.
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
if ( CMAKE_SYSTEM_NAME STREQUAL Darwin )
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
elseif ( CMAKE_SYSTEM_NAME STREQUAL Linux )
set(CMAKE_DL_LIBS pthread ${CMAKE_DL_LIBS})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()

# When changing the minimum version here, also adapt
# aux/zeek-aux/plugin-support/skeleton/CMakeLists.txt
Expand Down
28 changes: 24 additions & 4 deletions brim/release
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
#!/bin/sh -ex

brew install bison openssl
case $(uname -s) in
Darwin)
goos=darwin
logical_cpus=$(sysctl -n hw.logicalcpu)
brew install bison openssl
;;
Linux)
goos=linux
logical_cpus=$(nproc)
sudo apt-get -y install bison flex libpcap-dev libssl-dev
;;
*)
echo "unknown OS" >&2
exit 1
;;
esac

git submodule update --init --recursive
./configure --binary-package --disable-auxtools --disable-broker-tests --disable-python --disable-zeekctl --enable-static-binpac --enable-static-broker
sudo make -C build -j $(sysctl -n hw.logicalcpu) install/strip
sudo make -C build/scripts -j $logical_cpus install/strip
sudo make -C build/src -j $logical_cpus install/strip
mkdir -p zeek/bin && cp /usr/local/zeek/bin/zeek zeek/bin
mkdir -p zeek/share/zeek && cp -R /usr/local/zeek/share/zeek/{base,policy,site} zeek/share/zeek
mkdir -p zeek/share/zeek
for d in base policy site; do
cp -R /usr/local/zeek/share/zeek/$d zeek/share/zeek
done
cp brim/zeek zeek
zip -r zeek-$(git describe --dirty --tags).darwin-amd64.zip zeek
zip -r zeek-$(git describe --dirty --tags).$goos-amd64.zip zeek

0 comments on commit c63ecd2

Please sign in to comment.