Update main.py #8
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: Build and Release for Windows | |
| # Si attiva quando crei un nuovo tag che inizia con 'v' (es. v1.0, v1.0.1) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # 1. Scarica il codice del repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 2. Imposta l'ambiente Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' # Puoi usare la versione che preferisci | |
| # 3. Installa le dipendenze del progetto | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| # 4. Compila l'applicazione con PyInstaller | |
| - name: Build executable with PyInstaller | |
| run: | | |
| pyinstaller --name="GoProProxyTool" --noconsole --onefile --icon="assets/icon.ico" --collect-all customtkinter --collect-all tkinterdnd2 main.py | |
| # 5. Prepara l'artefatto per la release (lo zippa) | |
| - name: Package release artifact | |
| run: | | |
| $TAG_NAME = "${{ github.ref_name }}" | |
| Compress-Archive -Path dist/GoProProxyTool.exe -DestinationPath "GoProProxyTool-windows-${TAG_NAME}.zip" | |
| shell: pwsh | |
| # 6. Crea la Release su GitHub e carica lo ZIP | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| # Il corpo della release conterrà automaticamente le note generate | |
| generate_release_notes: true | |
| # Carica il file ZIP creato nello step precedente | |
| files: | | |
| GoProProxyTool-windows-*.zip |