Fix Windows versioning as well.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2024-07-31 10:16:17 +12:00
parent 6c4bb6ddeb
commit 009e8a32bb
6 changed files with 53 additions and 39 deletions

View file

@ -43,6 +43,9 @@ jobs:
bash -x subsurface/packaging/windows/container-prep.sh 2>&1 | tee pre-build.log bash -x subsurface/packaging/windows/container-prep.sh 2>&1 | tee pre-build.log
- name: run build - name: run build
env:
CANONICALVERSION: ${{ steps.version_number.outputs.version }}
CANONICALVERSION_4: ${{ steps.version_number.outputs.version_4 }}
run: | run: |
export OUTPUT_DIR="$GITHUB_WORKSPACE" export OUTPUT_DIR="$GITHUB_WORKSPACE"
cd /win cd /win

View file

@ -1,24 +1,26 @@
message(STATUS "processing version.cmake")
execute_process( if(DEFINED ENV{CANONICALVERSION})
COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh 4 set(CANONICAL_VERSION_STRING $ENV{CANONICALVERSION})
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR} else()
OUTPUT_VARIABLE CANONICAL_VERSION_STRING_4 execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh
) WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
OUTPUT_VARIABLE CANONICAL_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
execute_process( if(DEFINED ENV{CANONICALVERSION_4})
COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh 3 set(CANONICAL_VERSION_STRING_4 $ENV{CANONICALVERSION_4})
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR} else()
OUTPUT_VARIABLE CANONICAL_VERSION_STRING_3 execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh 4
) WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
OUTPUT_VARIABLE CANONICAL_VERSION_STRING_4
execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE
COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh )
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR} endif()
OUTPUT_VARIABLE CANONICAL_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
)
configure_file(${SRC} ${DST} @ONLY) configure_file(${SRC} ${DST} @ONLY)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")

View file

@ -77,12 +77,15 @@ if [[ $QT_VERSION = 5.15* ]] ; then
fi fi
# set up the Subsurface versions by hand # set up the Subsurface versions by hand
CANONICALVERSION=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh) if [ -z "${CANONICALVERSION+X}" ] ; then
CANONICALVERSION=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh)
fi
echo "#define CANONICAL_VERSION_STRING \"$CANONICALVERSION\"" > "$SUBSURFACE_SOURCE"/ssrf-version.h echo "#define CANONICAL_VERSION_STRING \"$CANONICALVERSION\"" > "$SUBSURFACE_SOURCE"/ssrf-version.h
CANONICALVERSION_4=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh 4) if [ -z "${CANONICALVERSION_4+X}" ] ; then
CANONICALVERSION_4=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh 4)
fi
echo "#define CANONICAL_VERSION_STRING_4 \"$CANONICALVERSION_4\"" >> "$SUBSURFACE_SOURCE"/ssrf-version.h echo "#define CANONICAL_VERSION_STRING_4 \"$CANONICALVERSION_4\"" >> "$SUBSURFACE_SOURCE"/ssrf-version.h
CANONICALVERSION_3=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh 3) CANONICALVERSION_3=${CANONICALVERSION_4%.*}
echo "#define CANONICAL_VERSION_STRING_3 \"$CANONICALVERSION_3\"" >> "$SUBSURFACE_SOURCE"/ssrf-version.h
BUNDLE=org.subsurface-divelog.subsurface-mobile BUNDLE=org.subsurface-divelog.subsurface-mobile
if [ "${IOS_BUNDLE_PRODUCT_IDENTIFIER}" != "" ] ; then if [ "${IOS_BUNDLE_PRODUCT_IDENTIFIER}" != "" ] ; then

View file

@ -137,12 +137,11 @@ else
touch Release touch Release
fi fi
cd "$BASEDIR"/subsurface
# libdivecomputer # libdivecomputer
# ensure the git submodule is present and the autotools are set up # ensure the git submodule is present and the autotools are set up
cd "$BASEDIR"/subsurface
if [ ! -d libdivecomputer/src ] ; then if [ ! -d libdivecomputer/src ] ; then
git submodule init git submodule init
git submodule update --recursive git submodule update --recursive

View file

@ -6,7 +6,6 @@
# #
# Usage: get-atomic-buildnr.sh SHA secrets.NIGHTLY_BUILDS [extra-name-component] # Usage: get-atomic-buildnr.sh SHA secrets.NIGHTLY_BUILDS [extra-name-component]
# #
# the resulting release version is stored in the file ./release-version
# checkout the nightly-builds repo in parallel to the main repo # checkout the nightly-builds repo in parallel to the main repo
# the clone followed by the pointless push should verify that the password is stored in the config # the clone followed by the pointless push should verify that the password is stored in the config
@ -25,4 +24,3 @@ bash subsurface/scripts/get-or-create-build-nr.sh "$1"
echo "build number after get-or-create is $(<nightly-builds/latest-subsurface-buildnumber)" echo "build number after get-or-create is $(<nightly-builds/latest-subsurface-buildnumber)"
cp nightly-builds/latest-subsurface-buildnumber subsurface/ cp nightly-builds/latest-subsurface-buildnumber subsurface/
[[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension [[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension
bash subsurface/scripts/get-version.sh > subsurface/release-version

View file

@ -1,17 +1,26 @@
message(STATUS "processing version.cmake") message(STATUS "processing version.cmake")
execute_process(
COMMAND bash ${CMAKE_TOP_SRC_DIR}/../scripts/get-version.sh
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
OUTPUT_VARIABLE CANONICAL_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process( if(DEFINED ENV{CANONICALVERSION})
COMMAND bash ${CMAKE_TOP_SRC_DIR}/../scripts/get-version.sh 4 set(CANONICAL_VERSION_STRING $ENV{CANONICALVERSION})
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR} else()
OUTPUT_VARIABLE CANONICAL_VERSION_STRING_4 execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh
) WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
OUTPUT_VARIABLE CANONICAL_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
if(DEFINED ENV{CANONICALVERSION_4})
set(CANONICAL_VERSION_STRING_4 $ENV{CANONICALVERSION_4})
else()
execute_process(
COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh 4
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
OUTPUT_VARIABLE CANONICAL_VERSION_STRING_4
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
configure_file(${SRC} ${DST} @ONLY) configure_file(${SRC} ${DST} @ONLY)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(CMAKE_SYSTEM_NAME STREQUAL "Windows")