macOS Build #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| - name: Build macOS App with py2app | |
| run: | | |
| python setup.py py2app | |
| - name: Verify Build | |
| run: | | |
| if [ -d "dist/main.app" ]; then | |
| echo "✓ Build successful!" | |
| ls -lh dist/ | |
| else | |
| echo "✗ Build failed - .app bundle not found" | |
| exit 1 | |
| fi | |
| - name: Create DMG (optional) | |
| run: | | |
| # Create a simple compressed archive for distribution | |
| cd dist | |
| zip -r pixel-panel-${{ env.BUILD_VERSION }}-macos.zip main.app | |
| 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/main.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 }} |