Skip to content

[Fix] Fix exploit with ennemie and seed #10

[Fix] Fix exploit with ennemie and seed

[Fix] Fix exploit with ennemie and seed #10

Workflow file for this run

name: 🚀 Make Build & Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
# ======================================================
# 1. PRÉPARATION
# ======================================================
check-integrity:
name: 🔍 Sanity Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Vérification structure
run: |
if [ ! -f Makefile ]; then echo "❌ Makefile manquant !"; exit 1; fi
# On vérifie si le dossier src existe car le Makefile l'attend
if [ ! -d src ]; then echo "❌ Dossier src/ manquant !"; exit 1; fi
echo "✅ Structure validée."
# ======================================================
# 2. BUILD LINUX (Natif)
# ======================================================
build-linux:
name: 🐧 Build Linux
needs: check-integrity
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compilation avec Make
# On lance simplement make. Il va lire ton fichier et créer build/ftl_rpg
run: make
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: binary-linux
path: build/ftl_rpg
# ======================================================
# 3. BUILD WINDOWS (Cross-Compilation via Make)
# ======================================================
build-windows:
name: 🪟 Build Windows
needs: check-integrity
runs-on: ubuntu-latest # On reste sur Linux pour utiliser 'make' et 'rm' sans bug
steps:
- uses: actions/checkout@v4
- name: Installation MinGW (Cross-Compiler)
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64
- name: Compilation Windows avec Make
# L'ASTUCE EST ICI :
# On surcharge les variables du Makefile :
# 1. CC : On remplace 'gcc' par le compilateur Windows 'x86_64-w64-mingw32-gcc'
# 2. EXEC : On change le nom de sortie pour ajouter .exe
run: make CC=x86_64-w64-mingw32-gcc EXEC=build/FTL_Windows.exe
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: binary-windows
path: build/FTL_Windows.exe
# ======================================================
# 4. RELEASE & PUBLISH
# ======================================================
release:
name: 📦 Publish Release
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Download Linux Binary
uses: actions/download-artifact@v4
with:
name: binary-linux
path: release_assets
- name: Download Windows Binary
uses: actions/download-artifact@v4
with:
name: binary-windows
path: release_assets
- name: Zip Source Code
run: |
zip -r release_assets/FTL_Source_Code.zip . -x "*.git*" "*.github*" "release_assets*" "build*"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ github.run_number }}
name: V ${{ github.run_number }}
body: |
## 🚀 FTL Console - Build ${{ github.run_number }}
Compilation automatique via Makefile.
### 📥 Téléchargements :
- `FTL_Windows.exe` : Windows
- `ftl_rpg` : Linux
- `Source.zip` : Code source
files: |
release_assets/ftl_rpg
release_assets/FTL_Windows.exe
release_assets/FTL_Source_Code.zip
draft: false
prerelease: false