Skip to content

Commit cdf9b4f

Browse files
committed
ci: add release workflow for v0.0.1-beta with core, ide, and bundle artifacts
1 parent 493b651 commit cdf9b4f

1 file changed

Lines changed: 211 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Tag version (e.g. v0.0.1-beta)'
11+
required: true
12+
default: 'v0.0.1-beta'
13+
14+
jobs:
15+
# ── Core: Engine base sem SDL3/ImGui (Linux) ─────────────────────────────
16+
build-core:
17+
name: Build Core (Linux)
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install GCC 13
25+
run: sudo apt-get update && sudo apt-get install -y g++-13
26+
27+
- name: Configure Core (sem SDL3)
28+
run: |
29+
cmake -S . -B build-core \
30+
-DCMAKE_BUILD_TYPE=Release \
31+
-DCMAKE_CXX_COMPILER=g++-13
32+
33+
- name: Build Core
34+
run: cmake --build build-core --target Caffeine -- -j$(nproc)
35+
36+
- name: Package Core
37+
run: |
38+
TAG="${{ github.ref_name || inputs.version }}"
39+
PKG="caffeine-core-${TAG}-linux"
40+
mkdir -p "$PKG/lib" "$PKG/include"
41+
42+
# Biblioteca compilada
43+
cp build-core/libCaffeine.a "$PKG/lib/"
44+
45+
# Headers públicos (exclui editor — editor é parte da IDE)
46+
find src -name "*.hpp" | grep -v "/editor/" | while read f; do
47+
dest="$PKG/include/${f#src/}"
48+
mkdir -p "$(dirname "$dest")"
49+
cp "$f" "$dest"
50+
done
51+
52+
zip -r "${PKG}.zip" "$PKG"
53+
echo "CORE_ZIP=${PKG}.zip" >> $GITHUB_ENV
54+
55+
- name: Upload Core artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: core-linux
59+
path: caffeine-core-*.zip
60+
61+
# ── IDE + Bundle: Engine completa com SDL3 + ImGui (Windows) ─────────────
62+
build-ide-bundle:
63+
name: Build IDE + Bundle (Windows)
64+
runs-on: windows-latest
65+
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Download SDL3
71+
shell: pwsh
72+
run: |
73+
$version = "3.2.14"
74+
$url = "https://github.com/libsdl-org/SDL/releases/download/release-$version/SDL3-devel-$version-VC.zip"
75+
Write-Host "Downloading SDL3 $version..."
76+
Invoke-WebRequest -Uri $url -OutFile SDL3.zip
77+
Expand-Archive SDL3.zip -DestinationPath "$env:GITHUB_WORKSPACE\SDL3"
78+
$sdl3Root = "$env:GITHUB_WORKSPACE\SDL3\SDL3-$version"
79+
echo "SDL3_CMAKE_DIR=$sdl3Root\cmake" | Out-File -FilePath $env:GITHUB_ENV -Append
80+
echo "SDL3_BIN=$sdl3Root\lib\x64" | Out-File -FilePath $env:GITHUB_ENV -Append
81+
Write-Host "SDL3_CMAKE_DIR = $sdl3Root\cmake"
82+
83+
- name: Configure Full (com SDL3 + ImGui)
84+
shell: pwsh
85+
run: |
86+
cmake -S . -B build-full `
87+
-DCMAKE_BUILD_TYPE=Release `
88+
-DSDL3_DIR="${{ env.SDL3_CMAKE_DIR }}"
89+
90+
- name: Build Full
91+
shell: pwsh
92+
run: cmake --build build-full --config Release
93+
94+
# ── Artifact: IDE (apenas o módulo editor + engine compilada com SDL3) ─
95+
- name: Package IDE
96+
shell: pwsh
97+
run: |
98+
$tag = "${{ github.ref_name || inputs.version }}"
99+
$pkg = "caffeine-ide-$tag-windows"
100+
New-Item -ItemType Directory -Force "$pkg\lib", "$pkg\include\editor", "$pkg\bin" | Out-Null
101+
102+
# Biblioteca com SDL3 + ImGui
103+
Copy-Item "build-full\Release\Caffeine.lib" "$pkg\lib\"
104+
105+
# Apenas os headers do módulo editor
106+
Get-ChildItem "src\editor" -Filter "*.hpp" | ForEach-Object {
107+
Copy-Item $_.FullName "$pkg\include\editor\"
108+
}
109+
110+
# Runtime SDL3
111+
Copy-Item "${{ env.SDL3_BIN }}\SDL3.dll" "$pkg\bin\"
112+
113+
Compress-Archive -Path $pkg -DestinationPath "$pkg.zip"
114+
115+
# ── Artifact: Bundle (IDE + Engine core + todas as ferramentas) ────────
116+
- name: Package Bundle
117+
shell: pwsh
118+
run: |
119+
$tag = "${{ github.ref_name || inputs.version }}"
120+
$pkg = "caffeine-bundle-$tag-windows"
121+
New-Item -ItemType Directory -Force "$pkg\lib", "$pkg\include", "$pkg\bin" | Out-Null
122+
123+
# Biblioteca completa
124+
Copy-Item "build-full\Release\Caffeine.lib" "$pkg\lib\"
125+
126+
# Ferramenta caf-encode
127+
Copy-Item "build-full\Release\caf-encode.exe" "$pkg\bin\"
128+
129+
# Runtime SDL3
130+
Copy-Item "${{ env.SDL3_BIN }}\SDL3.dll" "$pkg\bin\"
131+
132+
# Todos os headers (core + editor)
133+
Get-ChildItem "src" -Recurse -Filter "*.hpp" | ForEach-Object {
134+
$rel = $_.FullName.Substring((Resolve-Path "src").Path.Length + 1)
135+
$dest = "$pkg\include\$rel"
136+
New-Item -ItemType Directory -Force (Split-Path $dest) | Out-Null
137+
Copy-Item $_.FullName $dest
138+
}
139+
140+
Compress-Archive -Path $pkg -DestinationPath "$pkg.zip"
141+
142+
- name: Upload IDE + Bundle artifacts
143+
uses: actions/upload-artifact@v4
144+
with:
145+
name: ide-bundle-windows
146+
path: |
147+
caffeine-ide-*.zip
148+
caffeine-bundle-*.zip
149+
150+
# ── Publicar Release no GitHub ───────────────────────────────────────────
151+
release:
152+
name: Publish GitHub Release
153+
runs-on: ubuntu-latest
154+
needs: [build-core, build-ide-bundle]
155+
permissions:
156+
contents: write
157+
158+
steps:
159+
- name: Download all artifacts
160+
uses: actions/download-artifact@v4
161+
with:
162+
merge-multiple: true
163+
164+
- name: Create Release
165+
uses: softprops/action-gh-release@v2
166+
with:
167+
tag_name: ${{ github.ref_name || inputs.version }}
168+
name: "☕ Caffeine Engine ${{ github.ref_name || inputs.version }}"
169+
prerelease: true
170+
body: |
171+
## ☕ Caffeine Engine ${{ github.ref_name || inputs.version }}
172+
173+
Primeira release pública da **Caffeine Engine** — uma game engine de alta performance construída em C++20 sobre SDL3.
174+
175+
---
176+
177+
### 📦 Artifacts
178+
179+
| Arquivo | Plataforma | Descrição |
180+
|---------|-----------|-----------|
181+
| `caffeine-core-*-linux.zip` | Linux | Engine base sem SDL3/ImGui — apenas a biblioteca estática |
182+
| `caffeine-ide-*-windows.zip` | Windows | Módulo IDE: engine compilada com SDL3 + ImGui + headers do editor |
183+
| `caffeine-bundle-*-windows.zip` | Windows | Bundle completa: IDE + Core + caf-encode + SDL3.dll |
184+
185+
---
186+
187+
### 📋 Requisitos
188+
189+
**Core (Linux)**
190+
- GCC 13+ ou Clang 16+
191+
- CMake 3.20+
192+
- C++20
193+
194+
**IDE / Bundle (Windows)**
195+
- Windows 10/11 (x64)
196+
- Visual C++ Redistributable 2022
197+
- SDL3.dll incluído no pacote
198+
199+
---
200+
201+
### ⚠️ Aviso Beta
202+
203+
Esta é uma versão **beta** de desenvolvimento. APIs públicas podem mudar sem aviso prévio entre versões.
204+
205+
---
206+
207+
> *"Caffeine: Because great games are built on strong code and a lot of coffee."*
208+
files: |
209+
caffeine-core-*.zip
210+
caffeine-ide-*.zip
211+
caffeine-bundle-*.zip

0 commit comments

Comments
 (0)