From 913bc8c547e97a785cf1cd9fc20f8377f898da2c Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 3 May 2020 17:01:03 +0200 Subject: 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. --- make-release-archives.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 make-release-archives.sh 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 -- cgit v1.2.3