Update build-prod.yml #76
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 Delphi (Release) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: [self-hosted, Windows, X64, dev] | |
| steps: | |
| # Checkout + submodules (AUTH OK) | |
| - name: Checkout du code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.AUTOMATISATION_BUILD }} | |
| submodules: recursive | |
| fetch-depth: 1 | |
| persist-credentials: true | |
| - name: Debug auth Git | |
| shell: cmd | |
| run: | | |
| git config --list | |
| git remote -v | |
| # Vérification (debug simple) | |
| - name: Vérifier le contenu du repo | |
| shell: cmd | |
| run: | | |
| echo Workspace: %GITHUB_WORKSPACE% | |
| git status | |
| git submodule status | |
| dir /s /b src\Common | |
| # Création des dossiers de sortie | |
| - name: Créer les dossiers de sortie | |
| shell: cmd | |
| run: | | |
| cd /d "%GITHUB_WORKSPACE%" | |
| if not exist Output mkdir Output | |
| if not exist Output\Release mkdir Output\Release | |
| if not exist Output\Docs mkdir Output\Docs | |
| if not exist Output\Release\DCU mkdir Output\Release\DCU | |
| # Clean | |
| - name: Clean projet | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\rsvars.bat" | |
| call "%ProgramFiles(x86)%\Microsoft Visual Studio\18\BuildTools\Common7\Tools\VsDevCmd.bat" | |
| cd /d "%GITHUB_WORKSPACE%" | |
| msbuild src\FeedFlow.dproj ^ | |
| /t:Clean ^ | |
| /p:Config=Release ^ | |
| /p:Platform=Win64 | |
| # Build | |
| - name: Build Release Win64 | |
| shell: cmd | |
| run: | | |
| call "C:\Program Files (x86)\Embarcadero\Studio\37.0\bin\rsvars.bat" | |
| call "%ProgramFiles(x86)%\Microsoft Visual Studio\18\BuildTools\Common7\Tools\VsDevCmd.bat" | |
| cd /d "%GITHUB_WORKSPACE%" | |
| msbuild src\FeedFlow.dproj ^ | |
| /t:Build ^ | |
| /p:Config=Release ^ | |
| /p:Platform=Win64 | |
| msbuild Tests\FeedFlow.tests.dproj ^ | |
| /t:Build ^ | |
| /p:Config=Debug ^ | |
| /p:Platform=Win64 | |
| # Liste des artefacts générés | |
| - name: Lister les fichiers générés | |
| shell: cmd | |
| run: | | |
| dir /s /b Output\Release | |
| # Ajout gestionnare de mémoire | |
| - name: Add DUnit to PATH | |
| shell: cmd | |
| run: | | |
| echo C:\Users\danyleblanc\Documents\DL-Projets\FastMM4-master\FullDebugMode DLL\Precompiled>> %GITHUB_PATH% | |
| # Exécution des tests unitaire | |
| - name: Run DUnit tests | |
| shell: cmd | |
| run: | | |
| Tests\Win64\Debug\FeedFlow.tests.exe | |
| # Envoi des résultats | |
| - name: Publish test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() # Même si les tests échouent | |
| with: | |
| name: Test Results | |
| path: Tests\Win64\Debug\dunitx-results.xml | |
| # Ajout de la bibliothèque | |
| - name: Add Pasdoc to PATH | |
| shell: cmd | |
| run: | | |
| echo C:\Mac\Home\Documents\pasdoc\bin>> %GITHUB_PATH% | |
| # Génération de la documentation | |
| - name: Génération documentation | |
| shell: cmd | |
| run: | | |
| pasdoc --format html --output Output\Docs ^ | |
| src\Controllers\*.pas ^ | |
| src\Core\*.pas ^ | |
| src\Infrastructure\Config\*.pas ^ | |
| src\Infrastructure\Loggin\*.pas ^ | |
| src\Infrastructure\Routing\*.pas ^ | |
| src\Infrastructure\Security\*.pas ^ | |
| src\Infrastructure\Support\*.pas ^ | |
| src\Models\*.pas ^ | |
| src\Server\*.pas ^ | |
| src\Services\*.pas | |
| # Ajout path AssetForge | |
| - name: Add AssetForge to PATH | |
| shell: cmd | |
| run: | | |
| echo C:\Users\danyleblanc\Documents\DL-Projets\AssetForge\src\Win64\Release>> %GITHUB_PATH% | |
| # renomage des assets | |
| - name: Assets hashing | |
| shell: cmd | |
| run: | | |
| AssetForge --Prod --ci -r web\ -d .\Output\web -m C:\actions-runner\Manifest.json | |
| # Constitution du dossier de déploiement | |
| - name: create destination folder | |
| shell: powershell | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "deploy" | |
| Move-Item -Path "web\*" -Destination "deploy\" -Force | |
| Move-Item -Path "src\Output\Release\FeedFlow.dll" -Destination "deploy\FeedFlow.dll" -Force |