-
Notifications
You must be signed in to change notification settings - Fork 109
114 lines (95 loc) · 2.91 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
name: "Build"
on:
push:
# Only run on branches
branches:
- '**'
jobs:
linux:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt update -y
sudo apt install -y libsdl2-dev libsdl2-image-dev
- name: "Checkout sources"
uses: actions/checkout@v3
- name: "Compile"
run: |
make bin/brogue
- name: "Create artifact"
run: |
make BrogueCE-linux
tar -czvf BrogueCE-linux-x86_64.tar.gz BrogueCE-linux
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: linux-x86_64
path: BrogueCE-linux-x86_64.tar.gz
macos:
runs-on: macos-11
steps:
- name: "Checkout sources"
uses: actions/checkout@v3
- name: "Prepare"
run: |
make macos/sdl2.rb
- name: "Cache SDL2"
uses: actions/cache@v3
with:
path: sdl2-cellar
key: sdl2-${{hashFiles('macos/sdl2.rb')}}
- name: "Compile and install dependencies"
run: |
if [ -d sdl2-cellar ]; then
cp -r sdl2-cellar $(brew --cellar)/sdl2
brew link sdl2
else
brew install --build-from-source ./macos/sdl2.rb
cp -r $(brew --cellar)/sdl2 sdl2-cellar
fi
brew install sdl2_image dylibbundler
- name: "Compile"
run: |
make MAC_APP=YES Brogue.app
env:
MACOSX_DEPLOYMENT_TARGET: "10.7"
- name: "Fix and bundle dylib references"
run: |
cd Brogue.app/Contents && dylibbundler -cd -b -x MacOS/brogue
- name: "Create artifact"
run: |
make BrogueCE-macos
zip -rll BrogueCE-macos-x86_64.zip BrogueCE-macos
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: macos-x86_64
path: BrogueCE-macos-x86_64.zip
windows:
runs-on: windows-latest
steps:
- name: "Checkout sources"
uses: actions/checkout@v3
- name: "Install dependencies"
run: |
.\.github\get-deps-mingw.ps1
- name: "Compile"
shell: powershell
run: |
$env:path = $env:path + ";" + (Join-Path $pwd.Drive.Root "opt/local/x86_64-w64-mingw32/bin")
$env:path = $env:path + ';C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64'
mingw32-make SYSTEM=WINDOWS CC=gcc bin/brogue.exe
- name: "Create artifact"
run: |
mingw32-make SYSTEM=WINDOWS BrogueCE-windows
cp SDL2\x86_64-w64-mingw32\bin\SDL2.dll BrogueCE-windows
cp SDL2_image\x86_64-w64-mingw32\bin\zlib1.dll BrogueCE-windows
cp SDL2_image\x86_64-w64-mingw32\bin\SDL2_image.dll BrogueCE-windows
cp SDL2_image\x86_64-w64-mingw32\bin\libpng16-16.dll BrogueCE-windows
7z a BrogueCE-windows-x86_64.zip BrogueCE-windows
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: windows-x86_64
path: BrogueCE-windows-x86_64.zip