name: Build MusicTools on: workflow_dispatch: push: tags: - 'v*' permissions: contents: write # serve per creare le Release jobs: # ========================================================= # macOS # ========================================================= build-macos: runs-on: macos-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | pip install -r requirements.txt pip install pyinstaller - name: Install ffmpeg run: brew install ffmpeg - name: Build app run: python build_macos.py - name: Package .app -> zip run: | cd dist ditto -c -k --sequesterRsrc --keepParent MusicTools.app ../MusicTools-macOS.zip ls -lh ../MusicTools-macOS.zip - name: Upload artifact uses: actions/upload-artifact@v4 with: name: MusicTools-macOS path: MusicTools-macOS.zip retention-days: 14 # ========================================================= # Windows # ========================================================= build-windows: runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies run: | pip install -r requirements.txt pip install pyinstaller - name: Build exe run: python build_windows.py - name: Package -> zip shell: pwsh run: | Compress-Archive -Path dist/MusicTools/* -DestinationPath MusicTools-Windows.zip -CompressionLevel Optimal Get-Item MusicTools-Windows.zip - name: Upload artifact uses: actions/upload-artifact@v4 with: name: MusicTools-Windows path: MusicTools-Windows.zip retention-days: 14 # ========================================================= # Release (solo su tag v*) # ========================================================= release: needs: [build-macos, build-windows] if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest steps: - name: Download macOS artifact uses: actions/download-artifact@v4 with: name: MusicTools-macOS path: artifacts/macos - name: Download Windows artifact uses: actions/download-artifact@v4 with: name: MusicTools-Windows path: artifacts/windows - name: Create Release uses: softprops/action-gh-release@v2 with: name: MusicTools ${{ github.ref_name }} tag_name: ${{ github.ref_name }} generate_release_notes: true fail_on_unmatched_files: true files: | artifacts/macos/MusicTools-macOS.zip artifacts/windows/MusicTools-Windows.zip