Skip to content

Commit

Permalink
fix(build): fix pyinstaller build (#1566)
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Leclerc <[email protected]>
Co-authored-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
laurent-laporte-pro and sylvlecl authored Jun 7, 2023
1 parent 34e1675 commit 2c7b899
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ on:
push:
branches:
- 'master'

- 'hotfix/**'

jobs:
binary:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
os: [windows-latest, ubuntu-20.04]
os: [ windows-latest, ubuntu-20.04 ]

steps:
- name: Checkout github repo (+ download lfs dependencies)
Expand Down Expand Up @@ -59,17 +59,17 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
git log -1 HEAD --format=%H > .\resources\commit_id
pyinstaller -F antarest\worker\archive_worker_service.py -n AntaresWebWorker --add-data ".\resources;.\resources"
pyinstaller -F antarest\worker\archive_worker_service.py -n AntaresWebWorker --add-data ".\resources;.\resources" --hidden-import 'pythonjsonlogger.jsonlogger'
- name: Generate Linux worker binary
if: matrix.os == 'ubuntu-20.04'
run: |
git log -1 HEAD --format=%H > .\resources\commit_id
pyinstaller -F antarest/worker/archive_worker_service.py -n AntaresWebWorker --add-data resources:resources
git log -1 HEAD --format=%H > ./resources/commit_id
pyinstaller -F antarest/worker/archive_worker_service.py -n AntaresWebWorker --add-data resources:resources --hidden-import 'pythonjsonlogger.jsonlogger'
- name: Packaging
run: bash ./package_antares_web.sh
working-directory: scripts
- name: install changelog requirements
run : npm install -g auto-changelog
run: npm install -g auto-changelog
- name: generate changelog file
run: |
auto-changelog -l false --hide-empty-releases
Expand Down
16 changes: 13 additions & 3 deletions AntaresWebLinux.spec
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# -*- mode: python ; coding: utf-8 -*-

from pathlib import Path

block_cipher = None

antares_web_server_a = Analysis(['antarest/gui.py'],
# We need to analyze all alembic files to be sure the migration phase works fine
migrations_dir = Path('alembic/versions')
migration_files = [str(f) for f in migrations_dir.iterdir() if f.is_file() and f.suffix == '.py']

antares_web_server_a = Analysis(['antarest/gui.py', 'alembic/env.py'] + migration_files,
pathex=[],
binaries=[('./alembic.ini', './alembic.ini')],
datas=[('./resources', './resources'), ('./alembic', './alembic')],
hiddenimports=['cmath', 'antarest.dbmodel', 'plyer.platforms.linux', 'plyer.platforms.linux.notification'],
hiddenimports=[
'cmath',
'antarest.dbmodel',
'plyer.platforms.linux',
'plyer.platforms.linux.notification',
'pythonjsonlogger.jsonlogger',
],
hookspath=['extra-hooks'],
hooksconfig={},
runtime_hooks=[],
Expand Down
16 changes: 13 additions & 3 deletions AntaresWebWin.spec
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# -*- mode: python ; coding: utf-8 -*-

from pathlib import Path

block_cipher = None

antares_web_server_a = Analysis(['antarest/gui.py'],
# We need to analyze all alembic files to be sure the migration phase works fine
migrations_dir = Path('alembic/versions')
migration_files = [str(f) for f in migrations_dir.iterdir() if f.is_file() and f.suffix == '.py']

antares_web_server_a = Analysis(['antarest/gui.py', 'alembic/env.py'] + migration_files,
pathex=[],
binaries=[('./alembic.ini', './alembic.ini')],
datas=[('./resources', './resources'), ('./alembic', './alembic')],
hiddenimports=['cmath', 'antarest.dbmodel', 'plyer.platforms.win', 'plyer.platforms.win.notification'],
hiddenimports=[
'cmath',
'antarest.dbmodel',
'plyer.platforms.win',
'plyer.platforms.win.notification',
'pythonjsonlogger.jsonlogger',
],
hookspath=['extra-hooks'],
hooksconfig={},
runtime_hooks=[],
Expand Down

0 comments on commit 2c7b899

Please sign in to comment.