-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathmake_release
More file actions
executable file
·33 lines (25 loc) · 818 Bytes
/
Copy pathmake_release
File metadata and controls
executable file
·33 lines (25 loc) · 818 Bytes
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
#!/bin/bash
set -euxo pipefail
TAG=$(git describe --tags --exact-match HEAD)
RELEASE_DIR=${RELEASE_DIR:-"tmp/releases/${TAG}-$(uname -s)/"}
cargo test --release
rm -rf "${RELEASE_DIR}"
mkdir -p "${RELEASE_DIR}"
cargo build
cargo build --release
release_tarball_os="$(uname -s)"
release_tarball_arch="$(uname -m)"
cargo_target_dir_prefix=""
cargo_dir="target/${cargo_target_dir_prefix}"
cp "${cargo_dir}release/rubyfmt-main" "${RELEASE_DIR}/rubyfmt"
pwd
cp "${cargo_dir}debug/rubyfmt-main" "${RELEASE_DIR}/rubyfmt-debug"
pwd
cp RELEASE_README.md "${RELEASE_DIR}/RELEASE_README"
# check the binary
RES=$(echo 'a(1)' | "${RELEASE_DIR}/rubyfmt")
if [ "$RES" != "a(1)" ]; then
echo "formatting failed"
exit 1
fi
tar -cvz -f "rubyfmt-${TAG}-${release_tarball_os}-${release_tarball_arch}.tar.gz" "${RELEASE_DIR}"