build: Specifing files #8
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: Multi-Platform Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # Global variables for the daily build | |
| env: | |
| APP_NAME: MySlintApp | |
| APP_VERSION: 1.0.0 | |
| COMPANY_NAME: "Vinicius Costa" | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| artifact_name: Linux-Build | |
| - os: windows-latest | |
| artifact_name: Windows-Build | |
| - os: macos-latest | |
| artifact_name: macOS-Build | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Build with Nuitka (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| # Added: --assume-yes-for-downloads | |
| python -m nuitka --assume-yes-for-downloads --standalone --onefile --include-data-dir=src/ui=ui --output-dir=build --windows-product-name="${{ env.APP_NAME }}" --windows-product-version="${{ env.APP_VERSION }}" --windows-company-name="${{ env.COMPANY_NAME }}" --output-filename="${{ env.APP_NAME }}-${{ env.APP_VERSION }}-x64.exe" src/main.py | |
| - name: Build with Nuitka (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| python -m nuitka --standalone --include-data-dir=src/ui=ui --output-dir=build --macos-create-app-bundle --macos-app-name="${{ env.APP_NAME }}" --output-filename="${{ env.APP_NAME }}" src/main.py | |
| if [ -d "build/main.app" ]; then mv build/main.app "build/${{ env.APP_NAME }}.app"; fi | |
| - name: Build with Nuitka (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| # Installing ccache to speed up compilation and avoid timeouts | |
| sudo apt-get update && sudo apt-get install ccache -y | |
| # Added: --assume-yes-for-downloads | |
| python -m nuitka --assume-yes-for-downloads --standalone --onefile --include-data-dir=src/ui=ui --output-dir=build --output-filename="${{ env.APP_NAME }}-${{ env.APP_VERSION }}-linux.bin" src/main.py | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: | | |
| dist/*.exe | |
| dist/*.dmg | |
| dist/*.flatpak | |
| dist/*.bin |