-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (65 loc) · 2.11 KB
/
build-reusable.yml
File metadata and controls
79 lines (65 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build (Reusable)
on:
workflow_call:
jobs:
build-macos:
runs-on: macos-14 # Apple Silicon (M1/M2) - supports universal binary builds
steps:
- uses: actions/checkout@v4
- name: Sanitize branch name for artifact naming
id: sanitize
run: echo "ref_name=$(echo '${{ github.ref_name }}' | sed 's/\//-/g')" >> $GITHUB_OUTPUT
- name: Cache SDL
uses: actions/cache@v4
with:
path: external/sdl/build
key: sdl-2.32.10-macos-14-${{ runner.arch }}
- name: Install build dependencies
run: |
brew install cmake pkg-config nasm
- name: Build macOS (x86_64 + arm64)
env:
VERSION: ${{ steps.sanitize.outputs.ref_name }}
COMMIT_HASH: ${{ github.sha }}
run: |
cd MacOS
make clean
make
- name: Upload macOS build artifact
uses: actions/upload-artifact@v4
with:
name: Kiwi8-${{ steps.sanitize.outputs.ref_name }}-macOS
path: MacOS/release/
retention-days: 7
build-windows:
runs-on: windows-2022 # Windows Server 2022 (x64)
steps:
- uses: actions/checkout@v4
- name: Sanitize branch name for artifact naming
id: sanitize
shell: pwsh
run: echo "ref_name=$('${{ github.ref_name }}'.Replace('/', '-'))" >> $env:GITHUB_OUTPUT
- name: Cache SDL
uses: actions/cache@v4
with:
path: external/sdl/build
key: sdl-2.32.10-windows-2022-${{ runner.arch }}
- name: Configures build environment for x86-64
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Build Windows (x64)
env:
VERSION: ${{ steps.sanitize.outputs.ref_name }}
COMMIT_HASH: ${{ github.sha }}
shell: cmd
run: |
cd Windows
nmake clean
nmake
- name: Upload Windows build artifact
uses: actions/upload-artifact@v4
with:
name: Kiwi8-${{ steps.sanitize.outputs.ref_name }}-Windows
path: Windows\release\
retention-days: 7