Skip to content

Commit

Permalink
update the spec and action
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian committed Jul 3, 2024
1 parent 321c429 commit 2dbc44b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,7 @@ jobs:
poetry install
poetry add pyinstaller
- name: Generate initial spec file and build executable
run: |
poetry run pyinstaller --name orion_intel --onedir --add-data "orion_cli/services/*.py:orion_cli/services" orion_cli/cli.py
- name: Modify spec file
run: |
sed -i '' 's/optimize=0/optimize=2/' orion_intel.spec
sed -i '' 's/strip=False/strip=True/' orion_intel.spec
sed -i '' 's/upx=True/upx=False/' orion_intel.spec
- name: Rebuild executable using modified spec file
- name: Build executable using provided spec file
run: |
poetry run pyinstaller orion_intel.spec
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ venv
# Additional entries

# Distribution / packaging
dist/orion/*
dist/*
build/

# Virtual environment
Expand Down
Binary file removed dist/orion_intel
Binary file not shown.
44 changes: 44 additions & 0 deletions orion_intel.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None

a = Analysis(
['orion_cli/cli.py'],
pathex=[],
binaries=[],
datas=[('orion_cli/services/*.py', 'orion_cli/services')],
hiddenimports=['requests', 'pygithub'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=2, # Optimize the bytecode
)

pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='orion_intel',
debug=False,
bootloader_ignore_signals=False,
strip=True, # Strip the executable
upx=False, # Disable UPX compression
console=True,
onefile=True, # Ensure single-file mode
)

coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=False,
name='orion_intel',
)

0 comments on commit 2dbc44b

Please sign in to comment.