Skip to content

Commit 6e505f5

Browse files
authored
scripts: add script to reproduce binaries locally (#1477)
1 parent a491a1d commit 6e505f5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

scripts/reproduce-builds.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
tag="$1"
5+
6+
git clone https://github.com/simplex-chat/simplexmq && cd simplexmq
7+
8+
git checkout "$tag"
9+
10+
for os in 20.04 22.04 24.04; do
11+
mkdir -p out-${os}-github;
12+
13+
docker build -f Dockerfile.build --build-arg TAG=${os} -t repro-${os} .
14+
docker run -t -d --name builder-${os} repro-${os}
15+
16+
apps='smp-server xftp-server ntf-server xftp'
17+
os_url="$(printf '%s' "$os" | tr '.' '_')"
18+
19+
docker exec -t -e apps="$apps" builder-${os} sh -c 'cabal build && mkdir /out && for i in $apps; do bin=$(find /project/dist-newstyle -name "$i" -type f -executable); strip "$bin"; chmod +x "$bin"; mv "$bin" /out/; done'
20+
21+
docker cp builder-${os}:/out out-${os}
22+
23+
for app in $apps; do
24+
curl -L "https://github.com/simplex-chat/simplexmq/releases/download/${tag}/${app}-ubuntu-${os_url}-x86-64" -o out-${os}-github/${app}
25+
done
26+
27+
docker stop builder-${os}
28+
docker rm builder-${os}
29+
docker image rm repro-${os}
30+
done

0 commit comments

Comments
 (0)