Conver build-release to POSIX sh and fix issues reported by shellcheck
This commit is contained in:
parent
87ccec2f5a
commit
8401602f32
1 changed files with 12 additions and 12 deletions
|
@ -1,18 +1,18 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if (( $# == 1 )); then
|
if [ $# = 1 ]; then
|
||||||
TAG=$1
|
TAG=$1
|
||||||
else
|
else
|
||||||
TAG=$(git tag | tail -n1)
|
TAG=$(git tag | tail -1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION_NR=$(printf $TAG | cut -c2-)
|
VERSION_NR=$(echo "$TAG" | cut -c2-)
|
||||||
|
|
||||||
printf "\e[34m Building release version $VERSION_NR\e[0m\n\n"
|
printf "\e[34m Building release version %s\e[0m\n\n" "$VERSION_NR"
|
||||||
|
|
||||||
|
|
||||||
printf "\e[34m Checking out $TAG\e[0m\n\n"
|
printf "\e[34m Checking out %s \e[0m\n\n" "$TAG"
|
||||||
git checkout tags/$TAG > /dev/null 2>&1
|
git checkout "tags/$TAG" > /dev/null 2>&1
|
||||||
|
|
||||||
printf "\e[34m Building with cargo\e[0m\n"
|
printf "\e[34m Building with cargo\e[0m\n"
|
||||||
cargo build --release --locked
|
cargo build --release --locked
|
||||||
|
@ -24,7 +24,7 @@ mkdir release
|
||||||
cp target/release/lqsd release/
|
cp target/release/lqsd release/
|
||||||
cp LICENSE release/
|
cp LICENSE release/
|
||||||
cp manpage.adoc release/
|
cp manpage.adoc release/
|
||||||
cd release
|
cd release || return
|
||||||
|
|
||||||
printf "\e[34m Signing binary with GPG\e[0m\n"
|
printf "\e[34m Signing binary with GPG\e[0m\n"
|
||||||
gpg --detach-sign --armor lqsd
|
gpg --detach-sign --armor lqsd
|
||||||
|
@ -52,14 +52,14 @@ asciidoctor -b manpage manpage.adoc
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
|
|
||||||
printf "\e[34m Compressing to tar.zst\e[0m\n\n"
|
printf "\e[34m Compressing to tar.zst\e[0m\n\n"
|
||||||
tar cf lqsd_${VERSION_NR}_x86_64.tar.zst * --zstd
|
tar cf lqsd_"${VERSION_NR}"_x86_64.tar.zst ./* --zstd
|
||||||
|
|
||||||
mv *.tar.zst ..
|
mv ./*.tar.zst ..
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
printf "\e[34m removing leftover files\e[0m\n\n"
|
printf "\e[34m removing leftover files\e[0m\n\n"
|
||||||
rm -r release
|
rm -r release
|
||||||
|
|
||||||
printf "\e[34m Returning to master\e[0m\n\n"
|
printf "\e[34m Returning to main\e[0m\n\n"
|
||||||
git checkout master > /dev/null 2>&1
|
git checkout main > /dev/null 2>&1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue