forked from bbbradsmith/hatariB
-
Notifications
You must be signed in to change notification settings - Fork 0
231 lines (223 loc) · 7.47 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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
name: Core Builds
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-win64:
name: Windows 64-bit
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v3
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: git make mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake
- name: Build SDL2 and zlib
shell: msys2 {0}
run: |
make -f makefile.zlib
make -f makefile.sdl
- name: Build hatariB
shell: msys2 {0}
run: make
- name: Prepare Artifact
shell: pwsh
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
copy build/*.dll artifact/cores
mkdir artifact/info
copy info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $env:GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hatarib-win64--${{ env.BUILD_TAG }}
path: artifact/
build-win32:
name: Windows 32-bit
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v3
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: git make mingw-w64-i686-gcc mingw-w64-i686-cmake
- name: Build SDL2 and zlib
shell: msys2 {0}
run: |
make -f makefile.zlib
make -f makefile.sdl
- name: Build hatariB
shell: msys2 {0}
run: make
- name: Prepare Artifact
shell: pwsh
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
copy build/*.dll artifact/cores
mkdir artifact/info
copy info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $env:GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hatarib-win32--${{ env.BUILD_TAG }}
path: artifact/
build-ubuntu:
name: Ubuntu Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v3
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc cmake
- name: Build SDL2 and zlib
run: |
make -f makefile.zlib
make -f makefile.sdl
- name: Build hatariB
run: make
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hatarib-ubuntu--${{ env.BUILD_TAG }}
path: artifact/
build-macos:
name: MacOS 10.13
runs-on: macos-latest
steps:
- name: Checkout Files
uses: actions/checkout@v3
- name: Setup MacOS
run: brew install make gcc@13 cmake
# brew's gcc has to be a specific version, make sure to update 13 above and below if upgrading
- name: Build SDL2 and zlib
run: |
export CC=/usr/local/bin/gcc-13
export CFLAGS=-mmacosx-version-min=10.13
make -f makefile.zlib
export CC=$(PWD)/SDL/build-scripts/clang-fat.sh
make -f makefile.sdl
- name: Build hatariB
run: |
export OS=MacOS
export CC=/usr/local/bin/gcc-13
export CFLAGS=-mmacosx-version-min=10.13
export CMAKEFLAGS="-DCMAKE_C_COMPILER=/usr/local/bin/gcc-13 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
gmake
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.dylib artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hatarib-macos--${{ env.BUILD_TAG }}
path: artifact/
build-rpi32:
name: Raspberry Pi OS 32-bit
runs-on: ubuntu-20.04
# ubuntu-latest was building with a newer GLIBC than current Rpi images, making them incompatible,
# but 20.04 builds seem to have an older GLIBC that is compatible.
steps:
- name: Checkout Files
uses: actions/checkout@v3
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc gcc-arm-linux-gnueabihf cmake
- name: Build SDL2 and zlib
run: |
export CC=arm-linux-gnueabihf-gcc
export AR=arm-linux-gnueabihf-gcc-ar
make -f makefile.zlib
export RANLIB=arm-linux-gnueabihf-gcc-ranlib
export CONFIGURE_FLAGS="--build=x86_64-linux --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf-gcc"
make -f makefile.sdl
- name: Build hatariB
run: |
export CC=arm-linux-gnueabihf-gcc
export CMAKEFLAGS="-DCMAKE_SYSTEM_NAME=arm-linux-gnueabihf"
make
# CMAKE_SYSTEM_NAME informs cmake that we are cross-compiling, so that it knows to build and run cpugen natively.
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hatarib-rpi32--${{ env.BUILD_TAG }}
path: artifact/
build-rpi64:
name: Raspberry Pi OS 64-bit
runs-on: ubuntu-20.04
steps:
- name: Checkout Files
uses: actions/checkout@v3
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc gcc-aarch64-linux-gnu cmake
- name: Build SDL2 and zlib
run: |
export CC=aarch64-linux-gnu-gcc
export AR=aarch64-linux-gnu-gcc-ar
make -f makefile.zlib
export RANLIB=aarch64-linux-gnu-gcc-ranlib
export CONFIGURE_FLAGS="--build=x86_64-linux --host=aarch64-linux-gnu --target=aarch64-linux-gnu-gcc"
make -f makefile.sdl
- name: Build hatariB
run: |
export CC=aarch64-linux-gnu-gcc
export CMAKEFLAGS="-DCMAKE_SYSTEM_NAME=aarch64-linux-gnu"
make
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: hatarib-rpi64--${{ env.BUILD_TAG }}
path: artifact/