-
Notifications
You must be signed in to change notification settings - Fork 6
105 lines (87 loc) · 3.12 KB
/
build.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Build
on:
push:
tags-ignore:
- "**"
branches:
- "**"
paths-ignore:
- "scripts/*"
- ".gitignore"
- "LICENSE"
- "README.md"
pull_request:
paths-ignore:
- "scripts/*"
- ".gitignore"
- "LICENSE"
- "README.md"
workflow_call:
jobs:
build-desktop:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Install Linux deps
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y xorg-dev
- name: Cache SDL/ImGui deps
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/build/_deps
key: ${{ runner.os }}-deps
- name: Set universal build for macOS (as an env variable because of the ;)
if: runner.os == 'macOS'
run: echo "CMAKE_OSX_ARCHITECTURES=arm64;x86_64" >> $GITHUB_ENV
- name: Configure cmake
run: >
cmake
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
-S ${{ github.workspace }}
-B ${{ github.workspace }}/build
- name: Build
run: cmake --build ${{ github.workspace }}/build --config Release --parallel 2
- name: Install
run: cmake --install ${{ github.workspace }}/build --config Release --prefix ${{ github.workspace }}/build/install/${{ github.event.repository.name }}
- name: Create artifact archive
working-directory: ${{ github.workspace }}/build/install
run: cmake -E tar "cf" "${{ github.event.repository.name }}.zip" --format=zip ${{ github.event.repository.name }}/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ runner.os }}
path: ${{ github.workspace }}/build/install/${{ github.event.repository.name }}.zip
retention-days: 1
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Emscripten
run: |
wget -q https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -xvf master.tar.gz
emsdk-master/emsdk update
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest
- name: Configure cmake
run: |
source ${{ github.workspace }}/emsdk-master/emsdk_env.sh
emcmake cmake -DCMAKE_BUILD_TYPE=Release -S ${{ github.workspace }} -B ${{ github.workspace }}/build
- name: Build
run: cmake --build ${{ github.workspace }}/build --config Release --parallel 2
- name: Create artifact archive
working-directory: ${{ github.workspace }}/build
run: cmake -E tar "cf" "${{ github.event.repository.name }}.zip" --format=zip web/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-web
path: ${{ github.workspace }}/build/${{ github.event.repository.name }}.zip
retention-days: 1