Skip to content

Commit 831d464

Browse files
committed
fix github actions
1 parent 5647850 commit 831d464

1 file changed

Lines changed: 60 additions & 11 deletions

File tree

.github/workflows/build.yml

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
name: Build & Latest Release (Linux + Windows)
22

3+
#######################################################################
4+
# 1) Triggers
5+
#######################################################################
36
on:
47
pull_request:
58
branches: [ master ]
69
push:
710
branches: [ master ]
811
workflow_dispatch:
912

13+
#######################################################################
14+
# 2) Permission – allow the workflow to create / overwrite a release
15+
#######################################################################
1016
permissions:
1117
contents: write
1218

19+
#######################################################################
20+
# 3) Build & test matrix
21+
#######################################################################
1322
jobs:
1423
# ───────────────────────────────────────────────────────── build ──
1524
build:
16-
env: # make the short SHA available to all steps
17-
SHORT_SHA: ${{ github.sha }}
25+
env:
26+
SHORT_SHA: ${{ github.sha }} # for easy naming later
1827
strategy:
1928
matrix:
2029
include:
30+
# Linux
2131
- os: ubuntu-22.04
2232
cfg: linux-release
2333
build: linux-build
2434
isLinux: true
35+
# Windows
2536
- os: windows-2022
2637
cfg: windows-release
2738
build: windows-build
@@ -30,19 +41,55 @@ jobs:
3041
runs-on: ${{ matrix.os }}
3142

3243
steps:
33-
# 1) checkout & dependencies (unchanged) ──────────────────────────
44+
# 3-1) Checkout sources
3445
- uses: actions/checkout@v4
35-
# … your Install-packages / MSVC / unzip steps unchanged …
3646

37-
# 2) configure → build → ctest (unchanged) ───────────────────────
47+
# 3-2) Linux-only packages
48+
- name: Install packages (apt)
49+
if: matrix.isLinux
50+
run: |
51+
sudo apt-get update -y
52+
sudo apt-get install -y --no-install-recommends \
53+
clang ninja-build cmake build-essential \
54+
libxmu-dev libxi-dev libxinerama-dev libxrandr-dev \
55+
libxcursor-dev libudev-dev libopenal-dev unixodbc-dev \
56+
libgl1-mesa-dev libxxf86vm-dev zlib1g-dev
57+
58+
# 3-3) MSVC environment (Windows)
59+
- name: Set up MSVC env
60+
if: matrix.os == 'windows-2022'
61+
uses: ilammy/msvc-dev-cmd@v1
62+
with: { arch: x64 }
63+
64+
- name: Verify Ninja on PATH
65+
run: ninja --version
66+
67+
# 3-4) ── UNZIP ENGINE FILES *before* CMake ──────────────────────
68+
- name: Unzip Engine files (Linux)
69+
if: matrix.isLinux
70+
run: |
71+
unzip -q assets/Engine.zip -d assets
72+
unzip -q third_party/EE/Engine.zip -d third_party/EE
73+
74+
- name: Unzip Engine files (Windows)
75+
if: matrix.os == 'windows-2022'
76+
shell: pwsh
77+
run: |
78+
Expand-Archive assets/Engine.zip -DestinationPath assets -Force
79+
Get-ChildItem third_party/EE -Filter '*.zip' |
80+
ForEach-Object { Expand-Archive $_.FullName -DestinationPath third_party/EE -Force }
81+
82+
# 3-5) Configure → Build → Test
3883
- name: Configure
3984
run: cmake --preset ${{ matrix.cfg }}
85+
4086
- name: Build
4187
run: cmake --build --preset ${{ matrix.build }}
88+
4289
- name: Run unit tests
4390
run: ctest --test-dir out/build/${{ matrix.cfg }} --output-on-failure
4491

45-
# 3) package files, then create platform-specific archive ─────────
92+
# 3-6) Package runtime files and create per-platform archive
4693
- name: Package & archive (Linux)
4794
if: matrix.isLinux
4895
run: |
@@ -55,7 +102,8 @@ jobs:
55102
cp assets/Engine.pak "$STAGE/Bin/Engine.pak"
56103
cp assets/Project.pak "$STAGE/Bin/Project.pak"
57104
58-
tar -czf "linux_binaries_${SHORT_SHA::8}.tar.gz" -C "$STAGE" .
105+
tar -czf "linux_binaries_${SHORT_SHA:0:8}.tar.gz" -C "$STAGE" .
106+
59107
- name: Package & archive (Windows)
60108
if: matrix.os == 'windows-2022'
61109
shell: pwsh
@@ -68,9 +116,10 @@ jobs:
68116
Copy-Item "assets/Engine.pak" "$Stage/Bin/Engine.pak"
69117
Copy-Item "assets/Project.pak" "$Stage/Bin/Project.pak"
70118
71-
Compress-Archive -Path "$Stage/*" -DestinationPath "windows_binaries_${env:SHORT_SHA:0:8}.zip"
119+
$sha = $env:SHORT_SHA.Substring(0,8)
120+
Compress-Archive -Path "$Stage/*" -DestinationPath "windows_binaries_${sha}.zip"
72121
73-
# 4) upload just the finished archive as the artifact ─────────────
122+
# 3-7) Upload the archive as the build artifact
74123
- name: Upload platform archive
75124
uses: actions/upload-artifact@v4
76125
with:
@@ -93,8 +142,8 @@ jobs:
93142
uses: actions/download-artifact@v4
94143
with:
95144
pattern: binaries-*
96-
merge-multiple: true # puts both archives into release/
97-
path: release
145+
merge-multiple: true
146+
path: release # → release/linux_binaries_*.tar.gz …
98147

99148
- name: Build release metadata
100149
id: vars

0 commit comments

Comments
 (0)