1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-05-12 12:00:13 +00:00
QB64-PE/.ci/read-version.sh
Matthew Kilgore 865371f4b1 Add version onto artifact names
The artifacts like 'qb64-lnx.tar.gz' will now also include the version
in them, making them 'qb64-lnx-X.Y.Z.tar.gz' instead.

Fixes: #104
2022-06-10 11:21:24 -04:00

17 lines
668 B
Bash
Executable file

#!/bin/bash
# Pull the version out of the QB64 source. A little ugly but we're match for the first assignment line
versionLine=$(cat ./source/global/version.bas | grep "Version\$ = " | head -n 1 | tr -d '\n' | tr -d '\r')
# This uses a regular expression to pull the X.Y.Z version out of the assignment line
version=$(echo "$versionLine" | sed -r 's/^Version\$ = "([0-9]*\.[0-9]*\.[0-9]*)"/\1/' | tr -d '\n')
# if ./internal/version.txt exists, then we have a tag at the end of our version number
# (IE. non-release version)
if [ -f "./internal/version.txt" ]
then
version="$version$(cat ./internal/version.txt | tr -d '\n' | tr -d '\r')"
fi
printf "$version"