diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f55238777..8675c3b8a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -93,7 +93,7 @@ jobs: run: | .\tools\ci_setup_windows.ps1 -qtdir "$Home\Cache\Qt\${{ matrix.QT_VERSION }}\${{ matrix.COMPILER }}" -arch "${{ matrix.ARCH }}" -host_arch "${{ matrix.HOST_ARCH }}" -vcversion "${{ matrix.VCVERSION }}" if ( "${{ matrix.generator }}" ) { - .\tools\ci_script_windows.ps1 -generator "${{ matrix.GENERATOR }}" -arch "${{ matrix.ARCH }}" + .\tools\ci_script_windows.ps1 -generator "${{ matrix.GENERATOR }}" -arch "${{ matrix.ARCH }}" -toolset "${{ matrix.TOOLSET }}" } else { .\tools\make_windows_release.ps1 -iscc "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" -buildinstaller true -flow "${{ matrix.FLOW }}" -arch "${{ matrix.ARCH }}" } diff --git a/.github/workflows/windows_ondemand.yml b/.github/workflows/windows_ondemand.yml index d3eace547..015b0eec7 100644 --- a/.github/workflows/windows_ondemand.yml +++ b/.github/workflows/windows_ondemand.yml @@ -20,6 +20,7 @@ jobs: COMPILER: 'msvc2017_64' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' + RELEASE: false os: windows-2019 - QT_VERSION: '5.12.12' ARCH: 'amd64' @@ -28,6 +29,7 @@ jobs: TOOLSET: 'v141,version=14.16.27023' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' + RELEASE: false os: windows-2019 - QT_VERSION: '5.12.12' ARCH: 'x86' @@ -35,6 +37,7 @@ jobs: COMPILER: 'msvc2017' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' + RELEASE: false os: windows-2019 - QT_VERSION: '6.2.4' ARCH: 'amd64' @@ -42,6 +45,7 @@ jobs: COMPILER: 'msvc2019_64' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' + RELEASE: false os: windows-2019 - QT_VERSION: '6.2.4' ARCH: 'amd64' @@ -49,6 +53,7 @@ jobs: COMPILER: 'msvc2019_64' METHOD: 'aqt' GENERATOR: 'Visual Studio 17 2022' + RELEASE: false os: windows-latest steps: @@ -100,6 +105,17 @@ jobs: PNAME=./bld/gui/package/gpsbabel.exe GBTEMP=./gbtemp ./testo 2>&1 PNAME=./bld/gui/package/gpsbabel.exe GBTEMP=./gbtemp ./test_encoding_utf8 2>&1 + - name: Deploy + # This only handles continous releases now, for other events artifacts may be saved in + # the 'Upload Artifacts' step. + if: ( github.event_name == 'push' ) && ( github.ref == 'refs/heads/master' ) && matrix.RELEASE + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_NAME: Continuous-${{ runner.os }} + run: | + ./tools/uploadtool/upload_github.sh bld/gui/GPSBabel-*-Setup.exe + - name: 'Upload Artifacts' uses: actions/upload-artifact@v3 with: diff --git a/gbversion.cmake b/gbversion.cmake index ca2befc32..7ed8fc24c 100644 --- a/gbversion.cmake +++ b/gbversion.cmake @@ -24,6 +24,7 @@ list(GET VERSION_COMPONENTS 2 GB.MICRO) set(GB.BUILD 32 CACHE STRING "Fourth component of Windows VERSIONINFO resource FILEVERSION and PRODUCTVERSION parameters.") set(GB.PACKAGE_RELEASE "" CACHE STRING "String to append to VERSION tuple.") # .e.g. "-beta20190413" set(GB.SHA $ENV{GITHUB_SHA}) +string(TIMESTAMP GB.COPYRIGHT_YEAR "%Y" UTC) # may be overridden on cmake command line set(DOCVERSION ${GB.VERSION} CACHE STRING "String appended to documentation location for www.gpsbabel.org.") diff --git a/gbversion.h.in b/gbversion.h.in index b88226a76..d73146d1b 100644 --- a/gbversion.h.in +++ b/gbversion.h.in @@ -11,6 +11,7 @@ #define VER_PRODUCT @GB.MAJOR@,@GB.MINOR@,@GB.MICRO@,@GB.BUILD@ #define VER_FILE_STR "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@" #define VER_PRODUCT_STR "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@" +#define VER_COPYRIGHT_YEAR @GB.COPYRIGHT_YEAR@ #else #define VERSION "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@" constexpr char kVersionSHA[] = "@GB.SHA@"; diff --git a/gbversion.h.qmake.in b/gbversion.h.qmake.in index 1b50b9548..37c55f6ad 100644 --- a/gbversion.h.qmake.in +++ b/gbversion.h.qmake.in @@ -11,6 +11,7 @@ #define VER_PRODUCT $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD} #define VER_FILE_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" #define VER_PRODUCT_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" +#define VER_COPYRIGHT_YEAR $${GB.COPYRIGHT_YEAR} #else #define VERSION \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\" constexpr char kVersionSHA[] = \"$${GB.SHA}\"; diff --git a/gbversion.pri b/gbversion.pri index 9a50bd5f6..1b5f66649 100644 --- a/gbversion.pri +++ b/gbversion.pri @@ -24,6 +24,7 @@ GB.MICRO = $$member(GB.VERSION_COMPONENTS, 2) GB.BUILD = 32 # GB.PACKAGE_RELEASE = "-beta20190413" GB.SHA = $$(GITHUB_SHA) +GB.COPYRIGHT_YEAR = 2022 # may be overridden on qmake command line !defined(DOCVERSION, var) { diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 03a87f47e..8f89ef773 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -151,8 +151,12 @@ if(APPLE) # Info.plist has not been debugged with the cmake flow, it's a bit different than with the qmake flow. set_target_properties(gpsbabelfe PROPERTIES + MACOSX_BUNDLE_BUNDLE_NAME GPSBabel + MACOSX_BUNDLE_BUNDLE_VERSION ${GB.BUILD} + MACOSX_BUNDLE_COPYRIGHT "© 2002-${GB.COPYRIGHT_YEAR} Robert Lipe" MACOSX_BUNDLE_GUI_IDENTIFIER org.gpsbabel.gpsbabelfe MACOSX_BUNDLE_ICON_FILE ${MACOSX_BUNDLE_ICON_FILE} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION} ) else() target_sources(gpsbabelfe PRIVATE ${SOURCES} ${HEADERS} ${RESOURCES}) @@ -197,16 +201,16 @@ else() if(APPLE) get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION) add_custom_target(package_app - COMMAND QMAKE=${_qmake_executable} ${CMAKE_CURRENT_SOURCE_DIR}/package_app $ $ ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $ -l -q ${_qmake_executable} -g $ -s ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E copy $/../GPSBabelFE.dmg ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS gpsbabelfe gpsbabel coretool_lrelease + DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease VERBATIM USES_TERMINAL) elseif(UNIX) get_target_property(_qmake_executable Qt${QT_VERSION_MAJOR}::qmake IMPORTED_LOCATION) add_custom_target(package_app - COMMAND QMAKE=${_qmake_executable} ${CMAKE_CURRENT_SOURCE_DIR}/package_app $ $ ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS gpsbabelfe gpsbabel coretool_lrelease + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/package_app -a $ -l -q ${_qmake_executable} -g $ -s ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS gpsbabelfe gpsbabel gpsbabelfe_lrelease coretool_lrelease VERBATIM USES_TERMINAL) elseif(WIN32) diff --git a/gui/app.rc b/gui/app.rc index e5bbb3d65..fd6768910 100644 --- a/gui/app.rc +++ b/gui/app.rc @@ -1,6 +1,10 @@ #include #include "gbversion.h" +#define stringize_(S) #S +#define stringize(S) stringize_(S) +#define copyright_str(YEAR) stringize(\xa9 2002-##YEAR Robert Lipe) + IDI_ICON1 ICON "images/appicon.ico" VS_VERSION_INFO VERSIONINFO @@ -24,7 +28,7 @@ BEGIN VALUE "FileDescription", "GPS format converter" VALUE "FileVersion", VER_FILE_STR VALUE "InternalName", "GPSBabelFE.exe" - VALUE "LegalCopyright", L"\x00a9 2002-2022 Robert Lipe" + VALUE "LegalCopyright", copyright_str(VER_COPYRIGHT_YEAR) VALUE "OriginalFilename", "GPSBabelFE.exe" VALUE "ProductName", "GPSBabel" VALUE "ProductVersion", VER_PRODUCT_STR diff --git a/gui/package_app b/gui/package_app index a4d93ce07..fc0c263e8 100755 --- a/gui/package_app +++ b/gui/package_app @@ -42,7 +42,7 @@ function convert_qt_translations() echo '' >> "$resourceskel" fi - pushd "$(${QMAKE} -query QT_INSTALL_TRANSLATIONS)" > /dev/null + pushd "${QT_INSTALL_TRANSLATIONS}" > /dev/null languages=($(echo qtbase_??.qm | sed 's/qtbase_\(..\).qm/\1/g')) for language in "${languages[@]}" do @@ -67,35 +67,52 @@ function convert_qt_translations() fi } -QMAKE="${QMAKE:-qmake}" - -LUPDATE="$(${QMAKE} -query QT_INSTALL_BINS)/lupdate" -LRELEASE="$(${QMAKE} -query QT_INSTALL_BINS)/lrelease" -LCONVERT="$(${QMAKE} -query QT_INSTALL_BINS)/lconvert" -MACDEPLOYQT="$(${QMAKE} -query QT_INSTALL_BINS)/macdeployqt" - -GPSBABEL=${2:-../gpsbabel} -SOURCEDIR=${3:-.} - case "$(uname -s)" in Linux*) machine=Linux;; Darwin*) machine=Mac;; *) echo "Unknown kernel name $(uname -s)." 1>&2; exit 1;; esac -# update our translations and compile them. -"${LUPDATE}" "${SOURCEDIR}/app.pro" -"${LRELEASE}" "${SOURCEDIR}/app.pro" +if [ "${machine}" = "Linux" ]; then + APPDIR=GPSBabelFE +else + APPDIR=GPSBabelFE.app +fi +SKIP_UPDATE_RELEASE= +GPSBABEL=../gpsbabel +QMAKE=qmake +SOURCEDIR=. +while getopts a:lg:q:s: name +do + case $name in + a) APPDIR="$OPTARG";; + l) SKIP_UPDATE_RELEASE=1;; + g) GPSBABEL="$OPTARG";; + q) QMAKE="$OPTARG";; + s) SOURCEDIR="$OPTARG";; + ?) printf "Usage: %s: [-a package_directory] [-g gpsbabel] [-l] [-q qmake] [-s source_directory]\n" "$0" + exit 2;; + esac +done +# need absolute paths for convert_qt_translations() +APPDIR="$( cd "${APPDIR}" && pwd )" + +LCONVERT="$(${QMAKE} -query QT_INSTALL_BINS)/lconvert" +LUPDATE="$(${QMAKE} -query QT_INSTALL_BINS)/lupdate" +LRELEASE="$(${QMAKE} -query QT_INSTALL_BINS)/lrelease" +MACDEPLOYQT="$(${QMAKE} -query QT_INSTALL_BINS)/macdeployqt" +QT_INSTALL_TRANSLATIONS="$(${QMAKE} -query QT_INSTALL_TRANSLATIONS)" + +if [ -z "${SKIP_UPDATE_RELEASE}" ]; then + # update our translations and compile them. + "${LUPDATE}" "${SOURCEDIR}/app.pro" + "${LRELEASE}" "${SOURCEDIR}/app.pro" +fi if [ "${machine}" = "Linux" ]; then - # need absolute paths for convert_qt_translations() - APPDIR="$( cd "${1:-GPSBabelFE}" && pwd )" LANGDIR="${APPDIR}/translations" else - # need absolute paths for convert_qt_translations() - APPDIR="$( cd "${1:-GPSBabelFE.app}" && pwd )" LANGDIR="${APPDIR}/Contents/MacOS/translations" - APPBUNDLE=$(basename "$APPDIR") fi rm -fr "${LANGDIR}" @@ -120,6 +137,7 @@ else # Mac pushd "${APPDIR}/.." rm -f GPSBabelFE.dmg # macdeploytqt likes relative paths or else the dmg mount points get funky. + APPBUNDLE="$(basename "$APPDIR")" "${MACDEPLOYQT}" "${APPBUNDLE}" -executable="${APPBUNDLE}/Contents/MacOS/gpsbabel" -dmg -verbose=2 popd fi diff --git a/win32/gpsbabel.rc b/win32/gpsbabel.rc index 6dd05fd32..491de0baa 100644 --- a/win32/gpsbabel.rc +++ b/win32/gpsbabel.rc @@ -1,6 +1,10 @@ #include #include "gbversion.h" +#define stringize_(S) #S +#define stringize(S) stringize_(S) +#define copyright_str(YEAR) stringize(\xa9 2002-##YEAR Robert Lipe) + IDI_ICON1 ICON "gpsbabel.ico" VS_VERSION_INFO VERSIONINFO @@ -24,7 +28,7 @@ BEGIN VALUE "FileDescription", "GPS format converter" VALUE "FileVersion", VER_FILE_STR VALUE "InternalName", "gpsbabel.exe" - VALUE "LegalCopyright", L"\x00a9 2002-2022 Robert Lipe" + VALUE "LegalCopyright", copyright_str(VER_COPYRIGHT_YEAR) VALUE "OriginalFilename", "gpsbabel.exe" VALUE "ProductName", "GPSBabel" VALUE "ProductVersion", VER_PRODUCT_STR