diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 487600e24..8e49169a6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -302,6 +302,38 @@ jobs: cd ${RUNNER_WORKSPACE}/build-antimony ctest -C ${{ matrix.platform.build_type }} --output-on-failure --verbose --extra-verbose --progress + # Only the windows-latest-release leg has a QTAntimony.exe built with + # the exact Qt version (5.15.2, see 'Install Qt' above) win32/antimonyInstaller.iss + # expects, so the installer is only packaged there. InstallDir points + # iscc at this leg's actual install prefix (see 'Configure CMake for + # Antimony' above) rather than the '..\install-release' sibling + # directory the .iss defaults to for local/manual runs. + - name: Install Inno Setup + if: matrix.platform.name == 'windows-latest-release' + shell: bash + run: choco install innosetup --no-progress -y + + - name: Build QTAntimony installer + if: matrix.platform.name == 'windows-latest-release' + shell: bash + # MSYS_NO_PATHCONV=1: Git Bash auto-converts any argument that looks + # like a POSIX path (starts with '/') into a Windows path before + # handing it to a native .exe. iscc's /D switches start with '/' and + # aren't paths at all, so without this they get mangled and iscc + # fails with 'You may not specify more than one script filename.' + run: | + cd ${RUNNER_WORKSPACE}/build-antimony + ANTIMONY_VERSION=$(cat antimony_version.txt) + cd ${GITHUB_WORKSPACE}/win32 + MSYS_NO_PATHCONV=1 iscc "/DInstallDir=${RUNNER_WORKSPACE}/install-antimony" "/DMyAppVersion=${ANTIMONY_VERSION}" antimonyInstaller.iss + + - name: Upload QTAntimony installer + if: matrix.platform.name == 'windows-latest-release' + uses: actions/upload-artifact@main + with: + name: antimonyInstaller-windows + path: win32/antimonyInstaller_v*.exe + # Valgrind is Linux-only (no Windows support, weak/no Apple Silicon # support), so this only runs on one leg of the matrix rather than # across every platform/config combination. See MEMORYCHECK_* in the diff --git a/CMakeLists.txt b/CMakeLists.txt index 24afeee28..c4a74e614 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,13 @@ INCLUDE(CPack) SET(LIBANTIMONY_VERSION_STRING "v${LIBANTIMONY_VERSION_MAJOR}.${LIBANTIMONY_VERSION_MINOR}${LIBANTIMONY_VERSION_PATCH}${LIBANTIMONY_VERSION_RELEASE}") +# Bare version (no leading 'v'), written to a file so tooling outside of +# CMake itself -- e.g. the GitHub Actions step that packages +# win32/antimonyInstaller.iss via 'iscc /DMyAppVersion=...' -- can pick up +# the current version without parsing this file. +SET(LIBANTIMONY_VERSION_STRING_BARE "${LIBANTIMONY_VERSION_MAJOR}.${LIBANTIMONY_VERSION_MINOR}${LIBANTIMONY_VERSION_PATCH}${LIBANTIMONY_VERSION_RELEASE}") +file(WRITE "${CMAKE_BINARY_DIR}/antimony_version.txt" "${LIBANTIMONY_VERSION_STRING_BARE}") + option(BUILD_SHARED_LIBS "Build shared library (Set to OFF to build static libraries)" ON) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS are used), Debug, Release, RelWithDebInfo, MinSizeRel" ) @@ -681,7 +688,7 @@ if (WITH_QTANTIMONY) add_definitions(${QT_DEFINITIONS}) set(MACOSX_BUNDLE_ICON_FILE ${QTANTIMONY_SRC_DIR}antimony.icns) install(TARGETS QTAntimony DESTINATION bin) - install(FILES ${QTANTIMONY_SRC_DIR}antimony.ico ${QTANTIMONY_SRC_DIR}antimony_ico.png DESTINATION bin) + install(FILES ${QTANTIMONY_SRC_DIR}antimony.ico ${QTANTIMONY_SRC_DIR}antimony_ico.png ${CMAKE_SOURCE_DIR}/win32/README.txt DESTINATION bin) set_target_properties(QTAntimony PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/QTAntimony/$<0:>") diff --git a/win32/antimonyInstaller.iss b/win32/antimonyInstaller.iss index 200850201..466820cc6 100644 --- a/win32/antimonyInstaller.iss +++ b/win32/antimonyInstaller.iss @@ -1,8 +1,17 @@ -#define MinimalSetupInstaller "AntimonyPythonBindings-2.12.0-win32.exe" #define MyAppName "QTAntimony" -#define MyAppVersion "2.12.0" +#ifndef MyAppVersion + #define MyAppVersion "3.1.3" +#endif #define MyAppSetupIconFile "..\QTAntimony_src\antimony.ico" +; Defaults to the relative layout a local 'cmake --install' with the +; convention used elsewhere in this repo (an install-release/ dir sibling to +; win32/) produces. CI overrides this via 'iscc /DInstallDir=...' to point at +; wherever its own install step actually put things. +#ifndef InstallDir + #define InstallDir "..\install-release" +#endif + [Setup] AppId={{9F5DF3DE-FBE7-4AC4-9AFD-357A1C256847} DefaultGroupName=Antimony @@ -20,32 +29,27 @@ Name: {group}\{cm:UninstallProgram, QTAntimony}; Filename: {uninstallexe} Name: {group}\QTAntimony; Filename: {app}\QTAntimony.exe; WorkingDir: {userdocs} Name: {group}\README; Filename: {app}\README.txt [Run] -Filename: "{tmp}\{#MinimalSetupInstaller}"; Description: Run libantimonypython installer; -; Flags: ignoreversion Filename: {app}\README.txt; Description: View the README file; Flags: postinstall shellexec skipifsilent Filename: {app}\QTAntimony.exe; WorkingDir: {userdocs}; Flags: postinstall unchecked [Dirs] Name: {app}\biomodels [Files] -Source: "{#MinimalSetupInstaller}"; DestDir: "{tmp}"; Flags: ignoreversion onlyifdoesntexist -Source: ..\install-release\bindings\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs -Source: ..\install-release\bin\QTAntimony.exe; DestDir: {app} -Source: ..\install-release\bin\Qt5Core.dll; DestDir: {app} -Source: ..\install-release\bin\Qt5Gui.dll; DestDir: {app} -Source: ..\install-release\bin\Qt5PrintSupport.dll; DestDir: {app} -Source: ..\install-release\bin\Qt5Widgets.dll; DestDir: {app} -Source: ..\install-release\bin\platforms\qwindows.dll; DestDir: {app}\platforms -Source: ..\install-release\bin\README.txt; DestDir: {app} -Source: ..\install-release\bin\antimony.ico; DestDir: {app} -Source: ..\install-release\bin\antimony_ico.png; DestDir: {app} -Source: ..\install-release\bin\antimony2sbml.exe; DestDir: {app} -Source: ..\install-release\bin\libxml2.dll; DestDir: {app} -Source: ..\install-release\bin\rehashantimony.exe; DestDir: {app} -Source: ..\install-release\bin\sbml2antimony.exe; DestDir: {app} -Source: ..\install-release\bin\sbtranslate.exe; DestDir: {app} -Source: ..\install-release\bin\testantimony.exe; DestDir: {app} -Source: ..\install-release\lib\libantimony.dll; DestDir: {app} -Source: ..\install-release\lib\libantimony.lib; DestDir: {app} +Source: {#InstallDir}\bin\QTAntimony.exe; DestDir: {app} +Source: {#InstallDir}\bin\Qt5Core.dll; DestDir: {app} +Source: {#InstallDir}\bin\Qt5Gui.dll; DestDir: {app} +Source: {#InstallDir}\bin\Qt5PrintSupport.dll; DestDir: {app} +Source: {#InstallDir}\bin\Qt5Widgets.dll; DestDir: {app} +Source: {#InstallDir}\bin\platforms\qwindows.dll; DestDir: {app}\platforms +Source: {#InstallDir}\bin\README.txt; DestDir: {app} +Source: {#InstallDir}\bin\antimony.ico; DestDir: {app} +Source: {#InstallDir}\bin\antimony_ico.png; DestDir: {app} +Source: {#InstallDir}\bin\antimony2sbml.exe; DestDir: {app} +Source: {#InstallDir}\bin\rehashantimony.exe; DestDir: {app} +Source: {#InstallDir}\bin\sbml2antimony.exe; DestDir: {app} +Source: {#InstallDir}\bin\sbtranslate.exe; DestDir: {app} +Source: {#InstallDir}\bin\testantimony.exe; DestDir: {app} +Source: {#InstallDir}\lib\libantimony.dll; DestDir: {app} +Source: {#InstallDir}\lib\libantimony.lib; DestDir: {app} Source: ..\doc\examples\ex_antimony_output.txt; DestDir: {app} Source: ..\doc\examples\ex_sbml_input.xml; DestDir: {app} Source: ..\doc\examples\ex_sbml_output___main_sbml.xml; DestDir: {app}