blob: 108a39be44e82fbb15409b7d003ba0e5ba62551f (
plain)
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
|
#!/bin/bash
set -e
echo "This script will compile and package raidgrep."
echo "Ensure that your working directory is in the desired state!"
echo "Press Enter to continue."
read
version() {
grep -m 1 "^version =" Cargo.toml | cut -d '"' -f 2
}
output() {
echo -e "\033[33m$1\033[0m"
}
VERSION=$(version)
output "Building $VERSION"
output "=> Linux build"
cargo build --release
output "=> Windows build"
cargo build --release --target=x86_64-pc-windows-gnu
output "=> Manpage"
a2x -f manpage raidgrep.1.asciidoc
output "=> HTML help"
asciidoc raidgrep.1.asciidoc
output "=> Packaging it up"
mkdir -p target/archive/
output " Linux"
tar -czvf target/archive/raidgrep-$VERSION.tar.gz \
raidgrep.1 \
raidgrep.1.html \
-C target/release/ raidgrep
output " Windows"
zip -j target/archive/raidgrep-$VERSION.zip \
raidgrep.1.html \
target/x86_64-pc-windows-gnu/release/raidgrep.exe
output " Checksums"
cd target/archive
sha256sum raidgrep-$VERSION.{tar.gz,zip} > raidgrep-$VERSION.sha256sum
|