-
Notifications
You must be signed in to change notification settings - Fork 19
/
prepare-release.sh
executable file
·50 lines (38 loc) · 1.15 KB
/
prepare-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
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Builds tarball and assets for Open Build Service
# OBS build VMs have **no internet** gasp omg
check_version_numbers() {
files=(Cargo.toml build/wsta.spec HomebrewFormula/wsta.rb build/wsta.dsc build/debian/changelog wsta.1)
for file in "${files[@]}"; do
echo "$file" "$1"
grep -q "$1" "$file"
status=$?
if [ $status -ne 0 ]; then
echo ----------------------------------------------
echo remember to set version "$1" in "$file"
echo ----------------------------------------------
fi
done
}
if [ "$1" == "" ]; then
echo "Please provide a version like 0.1.0"
exit 1
fi
check_version_numbers "$1"
echo Cleaning up after you....
rm -rfv deploy
rm -rf ~/.cargo/registry
cargo clean
./package-debian.sh
echo Fetching offline assets
cargo fetch
echo Creating tarball
mkdir -p "deploy/wsta-$1"
cp -rv {Cargo.*,src,wsta.1,README.md,Makefile,LICENCE} "deploy/wsta-$1"
mkdir -v "deploy/wsta-$1/.cargo"
cp -r ~/.cargo/registry "deploy/wsta-$1/.cargo"
cp -v rust/* "deploy/wsta-$1"
tar -C deploy -czf "deploy/$1.tar.gz" "wsta-$1"
cp "deploy/$1.tar.gz" "deploy/wsta_$1.orig.tar.gz"
rm -rf "deploy/wsta-$1"
echo Done!