Skip to content

Commit e6437d9

Browse files
committed
More PR feedback
1 parent 09eb3d0 commit e6437d9

File tree

6 files changed

+13
-38
lines changed

6 files changed

+13
-38
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Zeek release
1+
name: Build/release Zeek
22

33
on:
44
pull_request:
@@ -22,8 +22,6 @@ jobs:
2222
steps:
2323
- name: Checkout build-zeek
2424
uses: actions/checkout@v3
25-
with:
26-
ref: ${{ inputs.build_zeek_ref }}
2725

2826
- name: Setup Go
2927
uses: actions/setup-go@v3
@@ -34,7 +32,7 @@ jobs:
3432
uses: actions/checkout@v3
3533
with:
3634
repository: zeek/zeek
37-
ref: ${{ inputs.zeek_ref }}
35+
ref: v6.0.2
3836
fetch-depth: 1
3937
submodules: recursive
4038
path: zeek-src
@@ -49,15 +47,13 @@ jobs:
4947
run: |
5048
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
5149
curl -L https://github.com/maxmind/libmaxminddb/releases/download/1.8.0/libmaxminddb-1.8.0.tar.gz | tar xzvf -
52-
cd libmaxminddb-1.8.0
53-
curl -O https://github.com/maxmind/libmaxminddb/commit/e695f1b59640760ae14fcfaecfb26d8c0bd47f3e.diff
54-
unix2dos e695f1b59640760ae14fcfaecfb26d8c0bd47f3e.diff
55-
patch -p1 < e695f1b59640760ae14fcfaecfb26d8c0bd47f3e.diff
56-
mkdir build
57-
cd build
50+
mkdir libmaxminddb-1.8.0\build
51+
cd libmaxminddb-1.8.0\build
5852
cmake ..
5953
cmake --build .
6054
cmake --build . --target install
55+
rename "C:\Program Files (x86)\maxminddb\include\maxminddb.h" maxminddb.h.bak
56+
sed "/typedef ADDRESS_FAMILY sa_family_t/d" "C:\Program Files (x86)\maxminddb\include\maxminddb.h.bak" > "C:\Program Files (x86)\maxminddb\include\maxminddb.h"
6157
shell: cmd
6258

6359
- name: Build Zeek (Windows)
@@ -96,10 +92,8 @@ jobs:
9692
sudo make install
9793
sudo strip /usr/local/zeek/bin/zeek
9894
99-
- name: Finish packaging release
95+
- name: Finish packaging artifact
10096
run: ./release.sh
101-
env:
102-
RELEASE_TAG: ${{ inputs.release_tag }}
10397
shell: sh
10498

10599
- name: Upload artifact
@@ -109,11 +103,11 @@ jobs:
109103
path: zeek-*.zip
110104

111105
- name: Publish artifact as release
112-
if: startsWith(inputs.release_tag, 'v')
106+
if: startsWith(github.event.ref, 'refs/tags/')
113107
uses: svenstaro/upload-release-action@2.7.0
114108
with:
115109
repo_token: ${{ secrets.GITHUB_TOKEN }}
116110
file: zeek-*.zip
117111
file_glob: true
118-
tag: ${{ inputs.release_tag }}
112+
tag: ${{ github.ref }}
119113
overwrite: true

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,3 @@ glue found here starts from the official Zeek source code and makes only the
2020
changes necessary to build in GitHub Actions, add some needed
2121
[Zeek Packages](https://packages.zeek.org/), and produce artifacts ready for
2222
use in Brimcap/Zui.
23-
24-
## Usage
25-
26-
Create artifacts using the **Create Zeek release** workflow.
27-
28-
![Create Zeek release workflow](workflow.png)
29-
30-
If the given `release_tag` starts with a `v` the artifacts will be published
31-
to the **Releases** area of this repo. If not, the artifacts will just be
32-
attached to the Actions run.

release.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ install_zeek_package() {
5050

5151
build_command=$(zkg_meta package build_command)
5252
if [ "$build_command" ]; then
53-
if [ "$OS" = Windows_NT ]; then
54-
export LDFLAGS='-static -Wl,--allow-multiple-definition'
55-
fi
56-
sh -c "$build_command"
57-
$sudo tar -xf build/*.tgz -C /usr/local/zeek/lib/zeek/plugins
53+
echo "building plugins not currently supported"
54+
exit 1
5855
fi
5956

6057
test_command=$(zkg_meta package test_command)
@@ -85,9 +82,8 @@ echo "@load policy/protocols/conn/community-id-logging" | $sudo tee -a /usr/loca
8582
mkdir -p zeek/bin zeek/lib/zeek zeek/share/zeek
8683
cp zeekrunner$exe zeek/
8784
cp /usr/local/zeek/bin/zeek$exe zeek/bin/
88-
cp -R /usr/local/zeek/lib/zeek/plugins zeek/lib/zeek/
8985
for d in base policy site builtin-plugins; do
9086
cp -R /usr/local/zeek/share/zeek/$d zeek/share/zeek/
9187
done
9288

93-
$zip -r zeek-$RELEASE_TAG.$(go env GOOS)-$(go env GOARCH).zip zeek
89+
$zip -r zeek-$(git describe --always --tags).$(go env GOOS)-$(go env GOARCH).zip zeek

workflow.png

-24 KB
Binary file not shown.

zeekrunner

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
44

55
export ZEEKPATH=$dir/share/zeek:$dir/share/zeek/policy:$dir/share/zeek/site
6-
export ZEEK_PLUGIN_PATH=$dir/lib/zeek/plugins
76

87
# The packet filter and loaded scripts are disabled because they emit either
98
# timeless logs or logs with timestamp set to execution time rather than time

zeekrunner.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ var (
2323
"share/zeek/policy",
2424
"share/zeek/site",
2525
}
26-
zeekPluginRelPaths = []string{
27-
"lib/zeek/plugins",
28-
}
2926
)
3027

3128
func pathEnvVar(name, topDir string, subdirs []string) string {
@@ -46,13 +43,12 @@ event zeek_init() {
4643

4744
func launchZeek(zdepsZeekDir, zeekExecPath string) error {
4845
zeekPath := pathEnvVar("ZEEKPATH", zdepsZeekDir, zeekPathRelPaths)
49-
zeekPlugin := pathEnvVar("ZEEK_PLUGIN_PATH", zdepsZeekDir, zeekPluginRelPaths)
5046

5147
cmd := exec.Command(zeekExecPath, "-C", "-r", "-", "--exec", ExecScript, "local")
5248
cmd.Stdin = os.Stdin
5349
cmd.Stdout = os.Stdout
5450
cmd.Stderr = os.Stderr
55-
cmd.Env = append(os.Environ(), zeekPath, zeekPlugin)
51+
cmd.Env = append(os.Environ(), zeekPath)
5652

5753
return cmd.Run()
5854
}

0 commit comments

Comments
 (0)