From adf914645cd4e49730cbf97126474f8a47453360 Mon Sep 17 00:00:00 2001 From: maugde <167874615+maugde@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:33:00 +0200 Subject: [PATCH] feat(installer): add installer as a submodule (#2110) The installer is now packaged together with antares desktop. For windows, we provide the GUI version, for linux we only provide the command line version. Installer code is added as a git submodule and built with its hatch build system. JIRA ANT-1966 --------- Signed-off-by: Sylvain Leclerc Co-authored-by: Sylvain Leclerc --- .github/workflows/deploy.yml | 8 ++++++++ .gitmodules | 3 +++ installer | 1 + scripts/package_antares_installer.sh | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 .gitmodules create mode 160000 installer create mode 100755 scripts/package_antares_installer.sh diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8fd2adfce7..e34aef58ae 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,6 +18,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: true - name: 🔗 Install wget for Windows if: matrix.os == 'windows-latest' @@ -57,6 +58,13 @@ jobs: run: bash ./package_antares_web.sh working-directory: scripts + - name: Add installer to package + shell: bash + run: | + pip install hatch + ./package_antares_installer.sh + working-directory: scripts + - name: 📜️ Copy changelog file run: | cp docs/CHANGELOG.md dist/package/CHANGELOG.md diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..553c74283c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "installer"] + path = installer + url = https://github.com/AntaresSimulatorTeam/antares-web-installer.git diff --git a/installer b/installer new file mode 160000 index 0000000000..e7552a8a66 --- /dev/null +++ b/installer @@ -0,0 +1 @@ +Subproject commit e7552a8a66bef72f9e4b8fc6e1b274895f15a180 diff --git a/scripts/package_antares_installer.sh b/scripts/package_antares_installer.sh new file mode 100755 index 0000000000..0050a3edb5 --- /dev/null +++ b/scripts/package_antares_installer.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Antares Desktop Installer +# +# This script must be run by ̀.github/worflows/deploy.yml`. +# It builds the installer application and stores it in the package directory. + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) +PROJECT_DIR=$(dirname -- "${SCRIPT_DIR}") +INSTALLER_DIR="${PROJECT_DIR}/installer" +DIST_DIR="${PROJECT_DIR}/dist/package" + +# build package +echo "INFO: Generating the Installer..." + +pushd ${INSTALLER_DIR} +if [[ "$OSTYPE" == "msys"* ]]; then + # For windows we build the GUI version + hatch run pyinstaller:build_gui AntaresWebInstaller + mv dist/AntaresWebInstaller ${DIST_DIR} +else + # For linux we build the command line version + hatch run pyinstaller:build_cli AntaresWebInstallerCLI + mv dist/AntaresWebInstallerCLI ${DIST_DIR} +fi +popd