mirror of
https://github.com/xiaozhou233/JuiceAgent.git
synced 2026-12-05 21:15:56 +08:00
The runtime binaries are no longer committed, so compile them in the builder container (example JARs stay committed) and package both artifacts.
54 lines
1.8 KiB
Bash
54 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# JuiceAgent release build script.
|
|
# Runs inside the juiceagent-builder Docker container.
|
|
# The example JARs are committed to the repository, so only the native
|
|
# binaries are compiled here (MinGW cross-compile).
|
|
# Produces two artifacts:
|
|
# 1. JuiceAgent-windows-x64.zip - pure compiled binaries
|
|
# 2. JuiceAgent-windows-x64-examples.zip - binaries + runnable example
|
|
#
|
|
set -e
|
|
|
|
cd /workspace
|
|
|
|
EXAMPLE_DIR=examples/load-via-injector-exe
|
|
|
|
echo "========================================"
|
|
echo " [1/3] Building native binaries (MinGW)"
|
|
echo "========================================"
|
|
rm -rf build-mingw
|
|
cmake --preset mingw-release
|
|
cmake --build build-mingw
|
|
|
|
echo "========================================"
|
|
echo " [2/3] Packaging pure binaries"
|
|
echo "========================================"
|
|
rm -f /workspace/JuiceAgent-windows-x64.zip
|
|
cd build-mingw/bin
|
|
zip -9 -j /workspace/JuiceAgent-windows-x64.zip injector.exe libagent.dll libloader.dll libinject.dll
|
|
cd /workspace
|
|
|
|
echo "========================================"
|
|
echo " [3/3] Packaging binaries + example"
|
|
echo "========================================"
|
|
rm -rf /workspace/release-examples
|
|
mkdir -p /workspace/release-examples
|
|
|
|
cp -r "$EXAMPLE_DIR/." /workspace/release-examples/
|
|
|
|
cp build-mingw/bin/injector.exe /workspace/release-examples/
|
|
cp build-mingw/bin/libagent.dll /workspace/release-examples/
|
|
cp build-mingw/bin/libloader.dll /workspace/release-examples/
|
|
cp build-mingw/bin/libinject.dll /workspace/release-examples/
|
|
|
|
rm -f /workspace/JuiceAgent-windows-x64-examples.zip
|
|
cd /workspace/release-examples
|
|
zip -9 -r /workspace/JuiceAgent-windows-x64-examples.zip .
|
|
cd /workspace
|
|
|
|
echo "========================================"
|
|
echo " Done. Artifacts:"
|
|
ls -lh /workspace/JuiceAgent-windows-x64.zip /workspace/JuiceAgent-windows-x64-examples.zip
|
|
echo "========================================"
|