Skip to content

Commit 6269d27

Browse files
committed
Remove version tweak, if present.
1 parent 9167952 commit 6269d27

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/check-libktx-only.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,11 @@ jobs:
113113
- name: Prepare version number and architecture for artifact
114114
id: libktx-version
115115
shell: bash
116-
# The ktx.version file in the parent of the build directory will include
117-
# the "tweak", if the package version has one. The library version though
118-
# reflects the API version so does not include the tewak. Extract the
119-
# version from the generated version.h file instead.
120-
#
121116
# Arch set up is to match arch to names used in releases and platforms.
122117
# N.B. If `>> ${{ github.env }} is used here variables are not seen in
123118
# following step on Windows runners. Linux and macOS have no problem.
124119
run: |
125-
echo KTX_VERSION=$(grep -A 1 -m 1 "Code version" lib/src/version.h | tail -n 1) >> $GITHUB_ENV
120+
echo KTX_VERSION=$(cat ${{ env.BUILD_DIR_TL }}/ktx.version) >> $GITHUB_ENV
126121
arch=$(echo ${{ runner.arch }} | tr '[:upper:]' '[:lower:]')
127122
if [ "$arch" = "x64" ]; then arch=x86_64; fi
128123
echo ARCH=$arch >> $GITHUB_ENV

scripts/check_lib_build_output.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ if [[ $# -ne 2 ]]; then
1717
fi
1818

1919
cd $1
20-
version=$2
21-
if [[ $version =~ ([0-9]+).[0-9]+.[0-9]+ ]]; then
20+
21+
fullversion=$2
22+
# If the incoming version is a full (package) version that includes
23+
# a tweak, remove it. Library version reflect the API version so do
24+
# not include a tweak.
25+
if [[ $fullversion =~ (([0-9]+).[0-9]+.[0-9]+)(-.*$)? ]]; then
2226
major=${BASH_REMATCH[1]}
23-
echo "major is $major"
27+
version=${BASH_REMATCH[2]}
28+
#echo "major is $major, version is $version"
2429
else
25-
echo "version number must have the form major.minor.patch".
30+
echo "version number must have the form major.minor.patch[-tweak]".
2631
usage
2732
exit 1
2833
fi

0 commit comments

Comments
 (0)