tartrazine/build_static.sh
Roberto Alsina 3d9d3ab5cf
Some checks failed
Tests / build (push) Has been cancelled
fix: strip binaries for release artifacts
2024-09-21 21:28:13 -03:00

17 lines
731 B
Bash
Executable File

#!/bin/bash
set -e
docker run --rm --privileged \
multiarch/qemu-user-static \
--reset -p yes
# Build for AMD64
docker build . -f Dockerfile.static -t tartrazine-builder
docker run -ti --rm -v "$PWD":/app --user="$UID" tartrazine-builder /bin/sh -c "cd /app && rm -rf lib shard.lock && shards build --static --release && strip bin/*"
mv bin/tartrazine bin/tartrazine-static-linux-amd64
# Build for ARM64
docker build . -f Dockerfile.static --platform linux/arm64 -t tartrazine-builder
docker run -ti --rm -v "$PWD":/app --platform linux/arm64 --user="$UID" tartrazine-builder /bin/sh -c "cd /app && rm -rf lib shard.lock && shards build --static --release && strip bin/*"
mv bin/tartrazine bin/tartrazine-static-linux-arm64