.yaml file
name: Package offlineEditor.exe
on:
workflow_dispatch:
push:
branches: ["master", "main"]
jobs:
build:
strategy:
matrix:
os: ['windows-latest', 'ubuntu-latest']
python-version: ["3.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: actions/setup-python@v5
name: Setup Python
with:
python-version: ${{ matrix['python-version'] }}
- name: Refresh data folder from source
run: |
rm -r compiled/editor/data
cp -r src/data/ compiled/editor/data/
- name: Build Executables (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
Remove-Item -Path "compiled/editor/offlineEditor-windows.exe" -Force -ErrorAction SilentlyContinue
pip install pyinstaller
pyinstaller --distpath compiled/editor --workpath /tmp/win/ --name offlineEditor-windows.exe --clean --icon="src/data/icon.ico" -F src/main.py
- name: Upload Artifacts (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v4
with:
name: offlineEditor-artifact-windows
path: compiled/editor/offlineEditor-windows.exe
- name: Build Executables (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
rm -rf compiled/editor/offlineEditor-linux.sh
pip install pyinstaller
pyinstaller --distpath compiled/editor --workpath /tmp/linux/ --name offlineEditor-linux.sh --clean --icon="src/data/icon.ico" -F src/main.py
- name: Upload Artifacts (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: offlineEditor-artifact-linux
path: compiled/editor/offlineEditor-linux.sh
- name: Commit Artifacts
if: always() # Stellen sicher, dass dieser Schritt immer ausgeführt wird
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git pull origin main # Aktualisieren Sie zuerst lokale Änderungen
git add .
git commit -m "Automated build"
git push origin main
I try to autobuild .exe’s or .sh from a repo with python-code.
The exact same command used to build the windows-executable works on my powershell perfectly fine and produces a ~8mb big .exe
The one from the github-action is 6,8mb and doesnt run.
Also for Linux i need to set chmod +x and so on aswell i suppose? Or do people need to do that theyre own.