Files
musicdownload/.github/workflows/build.yml
T
luzadevandClaude Opus 4.7 c3f6088b58 CI: zip artifacts e Release automatica su tag
- macOS: ditto del .app -> MusicDownload-macOS.zip
- Windows: Compress-Archive di dist/MusicDownload -> MusicDownload-Windows.zip
- Job release con softprops/action-gh-release@v2: parte su tag v*,
  scarica entrambi gli artifact e li allega a una GitHub Release con
  note generate automaticamente.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 12:51:02 +02:00

112 lines
3.0 KiB
YAML

name: Build MusicDownload
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 MusicDownload.app ../MusicDownload-macOS.zip
ls -lh ../MusicDownload-macOS.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: MusicDownload-macOS
path: MusicDownload-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/MusicDownload/* -DestinationPath MusicDownload-Windows.zip -CompressionLevel Optimal
Get-Item MusicDownload-Windows.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: MusicDownload-Windows
path: MusicDownload-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: MusicDownload-macOS
path: artifacts/macos
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: MusicDownload-Windows
path: artifacts/windows
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: MusicDownload ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
artifacts/macos/MusicDownload-macOS.zip
artifacts/windows/MusicDownload-Windows.zip