Skip to content

Commit

Permalink
feat(installer): add installer as a submodule (#2110)
Browse files Browse the repository at this point in the history
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 <sylvain.leclerc@rte-france.com>
Co-authored-by: Sylvain Leclerc <sylvain.leclerc@rte-france.com>
  • Loading branch information
maugde and sylvlecl authored Aug 29, 2024
1 parent 178647a commit adf9146
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "installer"]
path = installer
url = https://github.com/AntaresSimulatorTeam/antares-web-installer.git
1 change: 1 addition & 0 deletions installer
Submodule installer added at e7552a
26 changes: 26 additions & 0 deletions scripts/package_antares_installer.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit adf9146

Please sign in to comment.