chore: fix static release binaries using zigbuild

This commit is contained in:
Jef Roosens 2025-06-06 13:48:45 +02:00
parent 275d249320
commit 82d914ebbb
No known key found for this signature in database
GPG key ID: 21FD3D77D56BAF49
5 changed files with 32 additions and 14 deletions

View file

@ -6,15 +6,15 @@ alias b := build
# Build statically linked release binaries for all supported architectures
[group('build')]
build-release-static:
cargo build \
cargo zigbuild \
--release \
--frozen \
--workspace \
--target 'x86_64-unknown-linux-musl' \
--target 'aarch64-unknown-linux-musl'
[ "$(readelf -d target/x86_64-unknown-linux-musl/release/otterd | grep NEEDED | wc -l)" = 0 ]
[ "$(readelf -d target/aarch64-unknown-linux-musl/release/otterd | grep NEEDED | wc -l)" = 0 ]
[ "$(readelf -d target/x86_64-unknown-linux-musl/release/otter | grep NEEDED | wc -l)" = 0 ]
[ "$(readelf -d target/aarch64-unknown-linux-musl/release/otter | grep NEEDED | wc -l)" = 0 ]
test:
cargo test --frozen --workspace
@ -38,6 +38,13 @@ fetch:
clean:
cargo clean
run:
cargo run \
--bin otter \
-- serve \
-c ./otter.toml \
--log debug
doc:
cargo doc --workspace --frozen
@ -45,10 +52,10 @@ publish-release-binaries tag: build-release-static
curl \
--netrc \
--fail \
--upload-file target/x86_64-unknown-linux-musl/release/otterd \
https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otterd-linux-amd64
--upload-file target/x86_64-unknown-linux-musl/release/otter \
https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otter-linux-amd64
curl \
--netrc \
--fail \
--upload-file target/aarch64-unknown-linux-musl/release/otterd \
https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otterd-linux-arm64
--upload-file target/aarch64-unknown-linux-musl/release/otter \
https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/"{{ tag }}"/otter-linux-arm64