Skip to content

Commit

Permalink
Fix Windows versioning as well.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Keller <[email protected]>
  • Loading branch information
mikeller committed Aug 1, 2024
1 parent 6c4bb6d commit 009e8a3
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 39 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
bash -x subsurface/packaging/windows/container-prep.sh 2>&1 | tee pre-build.log
- name: run build
env:
CANONICALVERSION: ${{ steps.version_number.outputs.version }}
CANONICALVERSION_4: ${{ steps.version_number.outputs.version_4 }}
run: |
export OUTPUT_DIR="$GITHUB_WORKSPACE"
cd /win
Expand Down
40 changes: 21 additions & 19 deletions cmake/Modules/version.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
message(STATUS "processing version.cmake")

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
)

execute_process(
COMMAND bash ${CMAKE_TOP_SRC_DIR}/scripts/get-version.sh 3
WORKING_DIRECTORY ${CMAKE_TOP_SRC_DIR}
OUTPUT_VARIABLE CANONICAL_VERSION_STRING_3
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(DEFINED ENV{CANONICALVERSION})
set(CANONICAL_VERSION_STRING $ENV{CANONICALVERSION})
else()
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
)
endif()

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
)
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)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down
11 changes: 7 additions & 4 deletions packaging/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ if [[ $QT_VERSION = 5.15* ]] ; then
fi

# 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
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
CANONICALVERSION_3=$("$SUBSURFACE_SOURCE"/scripts/get-version.sh 3)
echo "#define CANONICAL_VERSION_STRING_3 \"$CANONICALVERSION_3\"" >> "$SUBSURFACE_SOURCE"/ssrf-version.h
CANONICALVERSION_3=${CANONICALVERSION_4%.*}

BUNDLE=org.subsurface-divelog.subsurface-mobile
if [ "${IOS_BUNDLE_PRODUCT_IDENTIFIER}" != "" ] ; then
Expand Down
3 changes: 1 addition & 2 deletions packaging/windows/mxe-based-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,11 @@ else
touch Release
fi


cd "$BASEDIR"/subsurface

# libdivecomputer
# ensure the git submodule is present and the autotools are set up

cd "$BASEDIR"/subsurface
if [ ! -d libdivecomputer/src ] ; then
git submodule init
git submodule update --recursive
Expand Down
2 changes: 0 additions & 2 deletions scripts/get-atomic-buildnr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#
# 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
# the clone followed by the pointless push should verify that the password is stored in the config
Expand All @@ -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)"
cp nightly-builds/latest-subsurface-buildnumber subsurface/
[[ -n $3 ]] && echo "$3" > subsurface/latest-subsurface-buildnumber-extension
bash subsurface/scripts/get-version.sh > subsurface/release-version
33 changes: 21 additions & 12 deletions smtk-import/cmake/Modules/version.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
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(
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
)
if(DEFINED ENV{CANONICALVERSION})
set(CANONICAL_VERSION_STRING $ENV{CANONICALVERSION})
else()
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
)
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)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down

0 comments on commit 009e8a3

Please sign in to comment.