forked from gemrb/gemrb
-
Notifications
You must be signed in to change notification settings - Fork 2
172 lines (144 loc) · 5.35 KB
/
builder.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
name: Builders
on:
push:
branches: [ master ]
pull_request:
branches: [ master, subviews ]
jobs:
macos:
name: MacOS build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Homebrew
run: |
brew install sdl openal-soft sdl_mixer libpng libvorbis sccache
- name: Set up build
run: |
# FindOpenAL prefers the framework version by default ... which deprecated OpenAL
openal="-DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include/AL -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib"
mkdir build && cd build &&
export OPENALDIR="/usr/local/opt/openal-soft/" &&
cmake --version &&
cmake -DCMAKE_INSTALL_PREFIX=iprefix $openal -DCMAKE_FIND_FRAMEWORK=LAST -DUSE_OPENAL=off ..
grep -i openal CMakeCache.txt
- name: Compiler cache (sccache)
uses: actions/cache@v2
with:
path: |
~/.cache/sccache
~/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-sccache-v1-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-sccache-v1-${{ github.ref }}-
${{ runner.os }}-sccache-v1-refs/heads/master-
${{ runner.os }}-sccache-v1-
- name: Build
run: |
cd build &&
make &&
make install
- name: Show build cache stats
run: |
command -v sccache &&
sccache -s
- name: Set up SSH
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
if: github.event_name == 'push'
with:
ssh-private-key: ${{ secrets.SSH_SF_PRIVATE_KEY }}
ssh-host: frs.sourceforge.net
- name: Upload
if: github.event_name == 'push'
run: |
# NOTE: only do it on clang builds if we ever add more compilers
filepath=Apple/OSX
tarpath=/Applications/GemRB.app
# there are no tags, so improvise
version=$({ date +%F; git describe --always; } | tr -d '\n') || exit 14
file=gemrb-$version.tar.bz2
tar cjf $file $tarpath || exit 15
filepath="$filepath/$file"
scp $file \
gemrb-travisbot@frs.sourceforge.net:/home/frs/project/gemrb/Buildbot\\\ Binaries/$filepath
linux:
name: Linux AppImage build
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install zlib1g zlib1g-dev libsdl1.2debian libsdl1.2-dev libopenal1 libopenal-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libfreetype6 libfreetype6-dev libvlc-dev libvlccore-dev libpng16-16 libpng-dev libvorbis0a libvorbis-dev libpython2.7 python-dev
SCCACHE_VERSION="v0.2.15"
SCCACHE_LINUX_PACKAGE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl"
curl -sSfL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_LINUX_PACKAGE}.tar.gz" | sudo tar zx --strip-component=1 -C /usr/bin/
chmod +x /usr/bin/sccache
- name: Set up build
env:
CXX: g++-7
CC: gcc-7
run: |
mkdir build && cd build
cmake --version
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DSTATIC_LINK=1 -DAPPIMAGE=1
- name: Compiler cache (sccache)
uses: actions/cache@v2
with:
path: |
~/.cache/sccache
~/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-sccache-v1-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-sccache-v1-${{ github.ref }}-
${{ runner.os }}-sccache-v1-refs/heads/master-
${{ runner.os }}-sccache-v1-
- name: Build
run: |
cd build
make
# - name: Test 1
# run: |
# cd build
# gemrb/gemrb -q -c ../gemrb/GemRB.cfg.noinstall.sample
- name: Prepare AppImage
run: |
cd build
# fetch appimage tools
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -L -o linuxdeploy
#curl https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage -L -o appimagelint
#chmod +x linuxdeploy appimagelint
chmod +x linuxdeploy
echo "::group::AppImage building"
make appimage
echo "::endgroup::"
# check if it works on old systems
#echo "::group::AppImage conformance testing"
#./appimagelint GemRB-*.AppImage
#echo "::endgroup::"
# - name: Test 2
# run: |
# cd build
# ./GemRB-*.AppImage -q ../gemrb/tests/minimal/
- name: Show build cache stats
run: |
command -v sccache
sccache -s
- name: Set up SSH
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
if: github.event_name == 'push'
with:
ssh-private-key: ${{ secrets.SSH_SF_PRIVATE_KEY }}
ssh-host: frs.sourceforge.net
- name: Upload
if: github.event_name == 'push'
run: |
# NOTE: only do it on gcc builds if we ever add more compilers
filepath=Linux
filei=build/GemRB-*-x86_64.AppImage
fileo=GemRB-${GITHUB_REF##*/}-${GITHUB_SHA:0:10}-x86_64.AppImage
filepath="$filepath/$fileo"
scp $filei \
gemrb-travisbot@frs.sourceforge.net:/home/frs/project/gemrb/Buildbot\\\ Binaries/$filepath