forked from Bishop-333/OmegA-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
184 lines (157 loc) · 5.1 KB
/
build.yml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: build
on:
pull_request:
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
push:
branches:
- master
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
release:
types: [published]
workflow_dispatch:
jobs:
windows:
name: ${{ matrix.btype }} Windows ${{ matrix.arch }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
btype: [Release]
include:
- arch: x86
msystem: mingw32
prefix: mingw-w64-i686
- arch: x86_64
msystem: mingw64
prefix: mingw-w64-x86_64
- btype: Release
rule: install
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
install: ${{ matrix.prefix }}-binutils ${{ matrix.prefix }}-make ${{ matrix.prefix }}-${{ matrix.cc }}
msystem: ${{ matrix.msystem }}
path-type: minimal
release: false
update: false
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j$(nproc) ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin RENDERER_DEFAULT=opengl
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j$(nproc) ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin RENDERER_DEFAULT=vulkan
- uses: actions/upload-artifact@v4
with:
name: release-mingw64-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
ubuntu-x86:
name: ${{ matrix.btype }} Unix ${{ matrix.arch }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
btype: [Release]
include:
- btype: Release
rule: install
- arch: x86
use_sdl: USE_SDL=0
- arch: x86_64
use_sdl: USE_SDL=1
steps:
- name: Install tools
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install gcc-multilib libcurl4-openssl-dev:i386 mesa-common-dev:i386 libxxf86dga-dev:i386 libxrandr-dev:i386 libxxf86vm-dev:i386 libasound-dev:i386
else
sudo apt-get -qq update
sudo apt-get -y install libcurl4-openssl-dev mesa-common-dev libxxf86dga-dev libxrandr-dev libxxf86vm-dev libasound-dev libsdl2-dev
fi
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
make ${{ matrix.rule }} -j$(nproc) ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin ${{ matrix.use_sdl }} RENDERER_DEFAULT=opengl
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j$(nproc) ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin ${{ matrix.use_sdl }} RENDERER_DEFAULT=vulkan
- uses: actions/upload-artifact@v4
with:
name: release-linux-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
macos:
name: ${{ matrix.btype }} macOS ${{ matrix.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, arm64]
cc: [gcc]
btype: [Release]
include:
- btype: Release
rule: install
steps:
- name: Install tools
run: brew install coreutils sdl2 # pkg-config
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: |
make ${{ matrix.rule }} -j$(sysctl -n hw.logicalcpu) ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin INSTALL=ginstall STRIP=echo
- uses: actions/upload-artifact@v4
with:
name: release-darwin-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
create-testing:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [windows, ubuntu-arm, ubuntu-x86, macos]
runs-on: ubuntu-20.04
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Create binary archives
run: |
chmod -R +x *
7z a -r omega-engine-linux-x86.zip ./release-linux-x86
7z a -r omega-engine-linux-x86_64.zip ./release-linux-x86_64
7z a -r omega-engine-windows-x86.zip ./release-mingw64-x86
7z a -r omega-engine-windows-x86_64.zip ./release-mingw64-x86_64
7z a -r omega-engine-macos-x86_64.zip ./release-darwin-x86_64
7z a -r omega-engine-macos-arm64.zip ./release-darwin-arm64
- name: Create latest build
uses: czietz/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "omega-dev"
prerelease: true
title: Development Build
files: |
*.zip