Refactor: Unificar estructura de caché y limpiar código redundante #11
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 VisageVault Releases | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| jobs: | |
| ########################################## | |
| # 1) WINDOWS | |
| ########################################## | |
| build-windows: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| 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 cmake | |
| - name: Build EXE with PyInstaller | |
| run: | | |
| pyinstaller --noconfirm \ | |
| --onefile \ | |
| --windowed \ | |
| --name "VisageVault" \ | |
| --add-data "visagevault.png;." \ | |
| --collect-data face_recognition_models \ | |
| --collect-all rawpy \ | |
| --hidden-import piexif \ | |
| --hidden-import numpy \ | |
| --hidden-import sklearn \ | |
| --hidden-import scipy._cyutility \ | |
| --hidden-import sklearn._cyutility \ | |
| visagevault.py | |
| - name: Upload Windows Asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/VisageVault.exe | |
| tag_name: ${{ github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| prerelease: false | |
| ########################################## | |
| # 2) 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 cmake | |
| brew install create-dmg | |
| - name: Build macOS App | |
| run: | | |
| pyinstaller --noconfirm \ | |
| --onedir \ | |
| --windowed \ | |
| --name "VisageVault" \ | |
| --add-data "visagevault.png:." \ | |
| --collect-data face_recognition_models \ | |
| --collect-all rawpy \ | |
| --hidden-import piexif \ | |
| --hidden-import numpy \ | |
| --hidden-import sklearn \ | |
| --hidden-import scipy._cyutility \ | |
| --hidden-import sklearn._cyutility \ | |
| visagevault.py | |
| - name: Create DMG | |
| run: | | |
| create-dmg \ | |
| --volname "VisageVault Installer" \ | |
| --window-pos 200 120 \ | |
| --window-size 800 400 \ | |
| --icon-size 100 \ | |
| --icon "VisageVault.app" 200 190 \ | |
| --hide-extension "VisageVault.app" \ | |
| --app-drop-link 600 185 \ | |
| "VisageVault-macOS.dmg" \ | |
| "dist/VisageVault.app" | |
| - name: Upload macOS Asset | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: VisageVault-macOS.dmg | |
| tag_name: ${{ github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| prerelease: false | |
| ########################################## | |
| # 3) LINUX (AppImage + DEB + RPM + PKG) | |
| ########################################## | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libopenblas-dev liblapack-dev \ | |
| ffmpeg qt6-base-dev ruby-dev libarchive-tools | |
| sudo gem install fpm | |
| - name: Download linuxdeploy | |
| run: | | |
| wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | |
| chmod +x linuxdeploy-x86_64.AppImage | |
| - name: Install Python deps | |
| run: | | |
| pip install -r requirements.txt | |
| pip install pyinstaller | |
| - name: Build Linux Binary | |
| run: | | |
| pyinstaller --noconfirm \ | |
| --onedir \ | |
| --windowed \ | |
| --name "VisageVault" \ | |
| --add-data "visagevault.png:." \ | |
| --collect-data face_recognition_models \ | |
| --collect-all rawpy \ | |
| --hidden-import piexif \ | |
| --hidden-import numpy \ | |
| --hidden-import sklearn \ | |
| --hidden-import scipy._cyutility \ | |
| --hidden-import sklearn._cyutility \ | |
| visagevault.py | |
| - name: Prepare AppDir | |
| run: | | |
| mkdir -p AppDir/usr/bin | |
| mkdir -p AppDir/usr/share/applications | |
| mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps | |
| # COHERENCIA: Copiar carpeta generada con nombre "VisageVault" | |
| cp -r dist/VisageVault/* AppDir/usr/bin/ | |
| # Asegurar permisos al binario principal "VisageVault" | |
| chmod +x AppDir/usr/bin/VisageVault | |
| cp visagevault.png AppDir/usr/share/icons/hicolor/256x256/apps/visagevault.png | |
| # COHERENCIA: El Exec apunta a "VisageVault" (Mayúsculas) | |
| cat << EOF > AppDir/usr/share/applications/visagevault.desktop | |
| [Desktop Entry] | |
| Name=VisageVault | |
| Comment=Gestor Inteligente de Fotos y Videos | |
| Exec=VisageVault | |
| Icon=visagevault | |
| Type=Application | |
| Categories=Graphics;Photography; | |
| Terminal=false | |
| EOF | |
| - name: Generate AppImage | |
| run: | | |
| export LINUXDEPLOY_OUTPUT_VERSION="${{ github.ref_name }}" | |
| ./linuxdeploy-x86_64.AppImage \ | |
| --appdir AppDir \ | |
| --desktop-file AppDir/usr/share/applications/visagevault.desktop \ | |
| --executable AppDir/usr/bin/VisageVault \ | |
| --icon-file AppDir/usr/share/icons/hicolor/256x256/apps/visagevault.png \ | |
| --output appimage | |
| - name: Build DEB / RPM / PACMAN | |
| run: | | |
| VERSION_TAG=$(echo ${{ github.ref_name }} | sed 's/v//') | |
| # COHERENCIA: Nombre del paquete "VisageVault" | |
| # DEB | |
| fpm -s dir -t deb -n VisageVault -v $VERSION_TAG \ | |
| --architecture amd64 \ | |
| --description "Gestor de Fotos y Videos Inteligente" \ | |
| --maintainer "Daniel Serrano" \ | |
| -C AppDir --prefix "/" . | |
| # RPM | |
| fpm -s dir -t rpm -n VisageVault -v $VERSION_TAG \ | |
| --architecture x86_64 \ | |
| --description "Gestor de Fotos y Videos Inteligente" \ | |
| --maintainer "Daniel Serrano" \ | |
| -C AppDir --prefix "/" . | |
| # PACMAN | |
| fpm -s dir -t pacman -n VisageVault -v $VERSION_TAG \ | |
| --architecture x86_64 \ | |
| --description "Gestor de Fotos y Videos Inteligente" \ | |
| --maintainer "Daniel Serrano" \ | |
| -C AppDir --prefix "/" . | |
| - name: Upload Linux Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| *.AppImage | |
| *.deb | |
| *.rpm | |
| *.pkg.tar.zst | |
| tag_name: ${{ github.ref_name }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| prerelease: false |