template/scripts/create-release.sh

29 lines
671 B
Bash
Executable File

#!/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"
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"
export VERSION="$TOTRELEASE"
export FORMAT='tar.gz'
export DOWNLOAD_URL="\$DL_PREFIX/$filename"
cat res/update.template | envsubst > "$xmlname"