Add .version file when generating source tarball

This commit is contained in:
Janek Bevendorff 2018-02-22 21:53:29 +01:00
parent 3089894d20
commit 32a4078240

View File

@ -614,9 +614,19 @@ build() {
if ${BUILD_SOURCE_TARBALL}; then
logInfo "Creating source tarball..."
local app_name_lower="$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]')"
TARBALL_NAME="${app_name_lower}-${RELEASE_NAME}-src.tar.xz"
git archive --format=tar "$TAG_NAME" --prefix="${app_name_lower}-${RELEASE_NAME}/" \
| xz -6 > "${OUTPUT_DIR}/${TARBALL_NAME}"
local prefix="${app_name_lower}-${RELEASE_NAME}"
local tarball_name="${prefix}-src.tar"
git archive --format=tar "$TAG_NAME" --prefix="${prefix}/" --output="${OUTPUT_DIR}/${tarball_name}"
# add .version file to tar
mkdir "${prefix}"
echo -n ${RELEASE_NAME} > "${prefix}/.version"
tar --append --file="${OUTPUT_DIR}/${tarball_name}" "${prefix}/.version"
rm "${prefix}/.version"
rmdir "${prefix}" 2> /dev/null
xz -6 "${OUTPUT_DIR}/${tarball_name}"
fi
if [ -e "${OUTPUT_DIR}/build-release" ]; then