Skip to content

macOS Build

macOS Build #9

Workflow file for this run

name: macOS Build
on:
# Runs on push to any of the below branches
push:
branches:
- main
# Runs on pull request events that target one of the below branches
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab of the repository
workflow_dispatch:
env:
BUILD_VERSION: 1.0.0
PYTHON_VERSION: 3.11.3
jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install py2app
echo "Installed packages:"
pip list
- name: Check tkinterdnd2 installation
run: |
python -c "import tkinterdnd2; print('tkinterdnd2 location:', tkinterdnd2.__file__)"
python -c "import tkinterdnd2; import os; print('tkinterdnd2 contents:'); [print(f) for f in os.listdir(os.path.dirname(tkinterdnd2.__file__))]"
- name: Build macOS App with py2app (Alias Mode)
run: |
echo "Starting py2app build in alias mode for testing..."
python setup_py2app.py py2app -A 2>&1 | tee build_alias.log || true
- name: Build macOS App with py2app (Full Build)
run: |
echo "Starting py2app full build..."
python setup_py2app.py py2app 2>&1 | tee build.log
BUILD_EXIT=$?
echo "Build command completed with exit code: $BUILD_EXIT"
exit $BUILD_EXIT
- name: Verify Build
run: |
echo "=== Checking for .app bundle ==="
# Find the .app bundle (could be main.app or "Pixel Panel.app")
APP_BUNDLE=$(find dist -name "*.app" -type d -maxdepth 1 | head -n 1)
if [ -n "$APP_BUNDLE" ]; then
echo "✓ Build successful!"
echo "Found app bundle: $APP_BUNDLE"
echo ""
echo "Dist directory contents:"
ls -lh dist/
echo ""
echo "App bundle structure:"
ls -la "$APP_BUNDLE/Contents/"
echo ""
echo "MacOS executables:"
ls -la "$APP_BUNDLE/Contents/MacOS/"
echo ""
echo "App size:"
du -sh "$APP_BUNDLE"
else
echo "✗ Build failed - .app bundle not found"
echo ""
echo "Dist directory contents:"
ls -la dist/ || echo "No dist directory"
echo ""
echo "Last 100 lines of build log:"
tail -100 build.log || echo "No build log found"
exit 1
fi
- name: Create DMG (optional)
run: |
# Find the .app bundle
APP_BUNDLE=$(find dist -name "*.app" -type d -maxdepth 1 | head -n 1)
APP_NAME=$(basename "$APP_BUNDLE")
echo "Creating archive for: $APP_NAME"
# Create a simple compressed archive for distribution
cd dist
zip -r "pixel-panel-${{ env.BUILD_VERSION }}-macos.zip" "$APP_NAME"
shasum -a 256 "pixel-panel-${{ env.BUILD_VERSION }}-macos.zip" > "pixel-panel-${{ env.BUILD_VERSION }}-macos.zip.sha256"
cd ..
- name: Upload macOS Artifact
uses: actions/upload-artifact@v4
with:
name: pixel-panel-macos
path: |
dist/*.app
dist/*.zip
dist/*.sha256
if-no-files-found: error
retention-days: 90
- name: Upload Release Assets (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
dist/pixel-panel-${{ env.BUILD_VERSION }}-macos.zip
dist/pixel-panel-${{ env.BUILD_VERSION }}-macos.zip.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}