template/scripts/create-release.sh

32 lines
752 B
Bash
Raw Normal View History

2017-07-16 14:59:00 +00:00
#!/bin/bash
MAJOR=`cat serial/major`
MINOR=`cat serial/minor`
RELEASE=`cat serial/release`
TOTRELEASE="$MAJOR.$MINOR.$RELEASE"
filebase="slt-$TOTRELEASE"
filename="$filebase.tar.gz"
outname="releases/$filename"
xmlname="releases/$filebase.xml"
2017-07-16 14:59:00 +00:00
mkdir -p releases
# First check if the named release exists already
if [ -f "$outname" ]; then
echo "The file $outname existes already. Either remove the release from the folder manually or increase the release version."
echo "Aborting."
exit 1
fi
cp slt.tar.gz "$outname"
2022-04-10 12:07:18 +00:00
sha=$(sha512sum slt.tar.gz | cut -d' ' -f1)
2022-04-09 14:54:31 +00:00
export VERSION="$TOTRELEASE"
export FORMAT='tar.gz'
export DOWNLOAD_URL="\$DL_PREFIX/$filename"
2022-04-10 12:07:18 +00:00
export SUMS="<sha512>$sha</sha512>"
cat res/update.template | envsubst > "$xmlname"