-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_release.sh
More file actions
executable file
·49 lines (39 loc) · 1.15 KB
/
Copy pathbuild_release.sh
File metadata and controls
executable file
·49 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# build_release.sh - 複数アーキテクチャ向けリリースビルド
set -e
VERSION="${1:-1.0.2}"
TARGETS=(
"aarch64-macos" # darwin-arm64
"x86_64-macos" # darwin-amd64
"aarch64-linux" # linux-arm64
"x86_64-linux" # linux-amd64
)
echo "Building ze v$VERSION for multiple platforms..."
rm -rf dist
mkdir -p dist
for target in "${TARGETS[@]}"; do
echo ""
echo "=== Building for $target ==="
zig build -Doptimize=ReleaseFast -Dtarget=$target
# ターゲット名を変換
case $target in
aarch64-macos) name="ze-darwin-arm64" ;;
x86_64-macos) name="ze-darwin-amd64" ;;
aarch64-linux) name="ze-linux-arm64" ;;
x86_64-linux) name="ze-linux-amd64" ;;
esac
# tarballに固めてzeという名前でアーカイブ
mkdir -p "dist/tmp"
cp zig-out/bin/ze "dist/tmp/ze"
tar -czvf "dist/$name.tar.gz" -C dist/tmp ze
rm -rf "dist/tmp"
echo "Created: dist/$name.tar.gz"
done
# SHA256を計算
echo ""
echo "=== Checksums ==="
cd dist
shasum -a 256 *.tar.gz | tee checksums.txt
echo ""
echo "Done! Upload these files to GitHub Release:"
ls -la