diff options
author | Daniel <kingdread@gmx.de> | 2020-05-03 17:01:03 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-05-03 17:01:03 +0200 |
commit | 913bc8c547e97a785cf1cd9fc20f8377f898da2c (patch) | |
tree | 138f32310f1bfe0e75452183b90d7d2ca854bdd5 | |
parent | f1fbfc32b6856528fef1fa838103cd3030861e7e (diff) | |
download | raidgrep-913bc8c547e97a785cf1cd9fc20f8377f898da2c.tar.gz raidgrep-913bc8c547e97a785cf1cd9fc20f8377f898da2c.tar.bz2 raidgrep-913bc8c547e97a785cf1cd9fc20f8377f898da2c.zip |
add a script to compile and package raidgrep
Since we now also have a manpage to distribute, simply having the
executable file on its own is no longer really a viable distribution
option for binary builds.
This script makes sure that a .tar.gz archive is built, which not only
reduces the space and bandwidth needed, but also allows us to include
the manpage/HTML help.
-rwxr-xr-x | make-release-archives.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/make-release-archives.sh b/make-release-archives.sh new file mode 100755 index 0000000..108a39b --- /dev/null +++ b/make-release-archives.sh @@ -0,0 +1,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 |