Skip to content

Bundle

Bundle #47

Workflow file for this run

name: Bundle
on: workflow_dispatch
jobs:
bundle:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
- name: Bundle (MacOS)
run: |
python -m nuitka --report=report.txt --standalone --include-data-dir=source=source --remove-output --assume-yes-for-downloads --macos-create-app-bundle --macos-app-icon=source/resources/icon.png --noinclude-setuptools-mode=nofollow microcosm.py
ditto -c -k --sequesterRsrc --keepParent microcosm.app microcosm-osx.zip
if: matrix.os == 'macos-latest'
- name: Bundle (Ubuntu)
run: |
python -m nuitka --onefile --standalone --include-data-dir=source=source --remove-output --assume-yes-for-downloads --linux-icon=source/resources/icon.png --noinclude-setuptools-mode=nofollow -o microcosm microcosm.py
chmod 744 microcosm
tar -czvf microcosm.tar.gz microcosm
if: matrix.os == 'ubuntu-latest'
- name: Bundle (Windows)
# The Windows installation of miniupnpc does not include the DLL that it requires to run. As such, we need to
# copy the miniupnpc DLL to the Python site-packages directory first, so that it can be picked up by Nuitka
# during the bundle.
run: |
cp source/resources/dll/miniupnpc.dll C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\
python -m nuitka --onefile --standalone --include-data-dir=source=source --remove-output --assume-yes-for-downloads --mingw64 --windows-icon-from-ico=source/resources/icon.png --user-package-configuration-file=windows-nuitka-package.config.yml --noinclude-setuptools-mode=nofollow microcosm.py
if: matrix.os == 'windows-latest'
- name: Upload artifact (MacOS)
uses: actions/upload-artifact@v3
with:
name: microcosm-osx
path: microcosm-osx.zip
if: matrix.os == 'macos-latest'
- name: Upload artifact (MacOS)
uses: actions/upload-artifact@v3
with:
name: report
path: report.txt
if: matrix.os == 'macos-latest'
- name: Upload artifact (Ubuntu)
uses: actions/upload-artifact@v3
with:
name: microcosm-ubuntu-x86
path: microcosm.tar.gz
if: matrix.os == 'ubuntu-latest'
- name: Upload artifact (Windows)
uses: actions/upload-artifact@v3
with:
name: microcosm-windows
path: microcosm.exe
if: matrix.os == 'windows-latest'
bundle-fedora:
runs-on: ubuntu-latest
container: fedora
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install system packages
run: |
dnf update -y
dnf install -y patchelf gcc-c++
- name: Install requirements
run: |
python -m pip install --upgrade pip
python -m pip install -r dev_requirements.txt
- name: Bundle
run: |
python -m nuitka --onefile --standalone --include-data-dir=source=source --remove-output --assume-yes-for-downloads --linux-icon=source/resources/icon.png --noinclude-setuptools-mode=nofollow -o microcosm microcosm.py
chmod 744 microcosm
tar -czvf microcosm.tar.gz microcosm
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: microcosm-fedora-x86
path: microcosm.tar.gz