Skip to content

Commit

Permalink
ci(workflow): fix deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
maugde committed Aug 23, 2024
1 parent 8db3a45 commit 4cb782c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,12 @@ jobs:
if: matrix.os == 'windows-latest'
run: pip install -r requirements-windows.txt

- name: Initialize installer environment
run: |
python -m venv .installer
source .installer/bin/activate
python -m pip install -r requirements.txt
- name: 📦 Packaging
run: bash ./package_antares_web.sh
working-directory: scripts

- name: Build installer
run: |
bash ./package_antares_installer.sh
deactivate
- name: Add installer in package
run: bash ./package_antares_installer.sh
working-directory: scripts

- name: 📜 Install changelog requirements
Expand Down
24 changes: 21 additions & 3 deletions scripts/package_antares_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,34 @@

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
PROJECT_DIR=$(dirname -- "${SCRIPT_DIR}")
INSTALLER_DIR="${PROJECT_DIR}/installer/src/antares_web_installer/"
INSTALLER_DIR="${PROJECT_DIR}/installer"
INSTALLER_SRC_DIR="${INSTALLER_DIR}/src/antares_web_installer"
DIST_DIR="${PROJECT_DIR}/dist/package"

echo "INFO: Initializing the virtual environment .installer"
if [[ "$OSTYPE" == "msys"* ]]; then
# initialize environment on windows
python -m venv .installer
.installer/bin/Activate.ps1
python -m pip install -r ${INSTALLER_DIR}/requirements.txt
else
# initialize environment on linux
python -m venv .installer
source .installer/bin/activate
python -m pip install -r ${INSTALLER_DIR}/requirements.txt
fi

# build package
echo "INFO: Generating the Installer for the Desktop application..."
if [[ "$OSTYPE" == "msys"* ]]; then
pushd ${PROJECT_DIR}
pyinstaller --onefile "${INSTALLER_DIR}gui/__main__.py" --distpath "${DIST_DIR}" --hidden-import antares_web_installer.shortcuts._linux_shell --hidden-import antares_web_installer.shortcuts._win32_shell --noconsole --name AntaresWebInstaller
pyinstaller --onefile "${INSTALLER_SRC_DIR}/gui/__main__.py" --distpath "${DIST_DIR}" --hidden-import antares_web_installer.shortcuts._linux_shell --hidden-import antares_web_installer.shortcuts._win32_shell --noconsole --name AntaresWebInstaller
popd
else
pushd ${PROJECT_DIR}
pyinstaller --onefile "${INSTALLER_DIR}cli/__main__.py" --distpath "${DIST_DIR}" --hidden-import antares_web_installer.shortcuts._linux_shell --hidden-import antares_web_installer.shortcuts._win32_shell --noconsole --name AntaresWebInstallerCLI
pyinstaller --onefile "${INSTALLER_SRC_DIR}/cli/__main__.py" --distpath "${DIST_DIR}" --hidden-import antares_web_installer.shortcuts._linux_shell --hidden-import antares_web_installer.shortcuts._win32_shell --noconsole --name AntaresWebInstallerCLI
popd
fi

deactivate
rm -r .installer

0 comments on commit 4cb782c

Please sign in to comment.