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>
This commit is contained in:
1 parent
8c06a26ddb
commit
c3f6088b58
1 file changed
+59
-7
@@ -1,12 +1,18 @@
|
|||||||
name: Build MusicDownload
|
name: Build MusicDownload
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Lancia manualmente da GitHub
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*' # Builda automaticamente sui tag (es. v1.0.0)
|
- 'v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # serve per creare le Release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# =========================================================
|
||||||
|
# macOS
|
||||||
|
# =========================================================
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -27,13 +33,22 @@ jobs:
|
|||||||
- name: Build app
|
- name: Build app
|
||||||
run: python build_macos.py
|
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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: MusicDownload-macOS
|
name: MusicDownload-macOS
|
||||||
path: dist/MusicDownload.app
|
path: MusicDownload-macOS.zip
|
||||||
compression-level: 9
|
retention-days: 14
|
||||||
|
|
||||||
|
# =========================================================
|
||||||
|
# Windows
|
||||||
|
# =========================================================
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -48,12 +63,49 @@ jobs:
|
|||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pyinstaller
|
pip install pyinstaller
|
||||||
|
|
||||||
- name: Build app
|
- name: Build exe
|
||||||
run: python build_windows.py
|
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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: MusicDownload-Windows
|
name: MusicDownload-Windows
|
||||||
path: dist/MusicDownload
|
path: MusicDownload-Windows.zip
|
||||||
compression-level: 9
|
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
|
||||||
Reference in new issue
Block a user