File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -441,3 +441,45 @@ jobs:
441441
442442 - name : Publish the Python distribution to PyPI
443443 uses : pypa/gh-action-pypi-publish@release/v1
444+
445+ build-deb :
446+ name : Build standalone executable
447+ # Build the standalone executable only on PRs and tags
448+ if : github.event_name == 'pull_request' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
449+ runs-on : ubuntu-20.04
450+ steps :
451+ - name : Fetch sources
452+ uses : actions/checkout@v4
453+ with :
454+ submodules : true
455+
456+ - name : Set up Python
457+ uses : actions/setup-python@v5
458+ with :
459+ python-version : ${{ env.DEFAULT_PYTHON_VERSION }}
460+ cache : ' pip'
461+
462+ - name : Install required Python packages
463+ run : |
464+ python -m pip install -U pip
465+ python -m pip install -U pyinstaller fpm
466+ pip freeze
467+
468+ # Create stub to work around pyinstaller bug with __main__
469+ - name : Create stub
470+ run : echo -e "from frequenz.client.dispatch.__main__ import main\n\nmain()" > stub.py
471+
472+ - name : Build the standalone executable
473+ run : pyinstaller --onefile --name dispatch-cli --collect-all frequenz.client.dispatch stub.py
474+
475+ - name : Create deb package
476+ run : |
477+ git fetch --tags
478+ VERSION=$(git describe)
479+ fpm -s dir -t deb -n dispatch-cli -v ${VERSION} dist/dispatch-cli=/usr/bin/dispatch-cli
480+
481+ - name : Upload deb package
482+ uses : actions/upload-artifact@v4
483+ with :
484+ name : dispatch-cli
485+ path : ' *.deb'
You can’t perform that action at this time.
0 commit comments