build_for_release.sh (610B)
1 #!/bin/bash 2 3 # Using musl means everything is compiled statically 4 # which results in an independant binary be able to 5 # run it on any x86_64 based system. (That's how I understand it) 6 read -p "Version Number (e.g. v1.2.3): " versionNumber 7 test ${versionNumber:0:1} != "v" && versionNumber="v""$versionNumber" 8 declare -a cmds=( 9 "git tag $versionNumber" 10 "cargo build -r --target x86_64-unknown-linux-musl" 11 "cp target/x86_64-unknown-linux-musl/release/songy ." 12 "mv songy songy_"$versionNumber"_x86_64-unknown-linux-musl" 13 ) 14 for (( i=0; i<${#cmds[@]}; i++ )); 15 do 16 echo "${cmds[$i]}" 17 bash -c "${cmds[$i]}" 18 done