Skip to content

Update build-prod.yml #91

Update build-prod.yml

Update build-prod.yml #91

Workflow file for this run

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%
# renommage des assets
- name: Assets hashing
shell: cmd
run: |
AssetForge --Prod --ci -r web\ -d .\Output\web -m C:\actions-runner\Manifest.json
# Génération de la traduction
- name: Add I18nForgeX to PATH
shell: cmd
run: |
echo C:\Users\danyleblanc\Documents\DL-Projets\I18nForgeX\src\cli\Win64\Release>> %GITHUB_PATH%
- name: Generate translation
shell: powershell
run: |
$ErrorActionPreference = 'Stop'
i18nForgeX --ci -p .\i18n\Translate.i18x --scan
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
i18nForgeX --ci -p .\i18n\Translate.i18x --Export-Excel
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
i18nForgeX --ci -p .\i18n\Translate.i18x --Tranlate
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
i18nForgeX --ci -p .\i18n\Translate.i18x --Build-JSon
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Constitution du dossier de déploiement
- name: create destination folder
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path "deploy"
Move-Item -Path "Output\web\*" -Destination "deploy\" -Force
Move-Item -Path "deploy\css" -Destination "deploy\Templates\static\css" -Force
Move-Item -Path "deploy\img" -Destination "deploy\Templates\static\img" -Force
Move-Item -Path "deploy\js" -Destination "deploy\Templates\static\js" -Force
Move-Item -Path "deploy\Templates\locales" -Destination "deploy\Templates\static\locales" -Force
Move-Item -Path "src\Output\Release\FeedFlow.dll" -Destination "deploy\FeedFlow.dll" -Force