-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·40 lines (32 loc) · 1004 Bytes
/
release.sh
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
# !/bin/bash
# exit on error
set -e
# prep
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
mkdir -p release
# build: x86
target=x86_64-apple-darwin
final_binary_name=drum-break-x86
cargo build --release --target $target
cp target/x86_64-apple-darwin/release/drum-break ./release/$final_binary_name
chmod 700 ./release/$final_binary_name
# build: arm
cargo build --release --target aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/drum-break ./release/drum-break-aarch64
chmod 700 ./release/drum-break-aarch64
# add assets
cp -r assets/ ./release/assets/
# zip it up and ship the release
version="$(cat VERSION)"
zip_file=release-$version.zip
zip -r $zip_file release
echo "About to upload release version '$version' to Github ..."
read -p "Are you sure? (y/n) " -n 1 -r
echo # (optional) move to a new line
if ! [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Canceled release."
exit 0;
fi
gh release create $version $zip_file --prerelease --notes "$version"