-
Notifications
You must be signed in to change notification settings - Fork 57
153 lines (133 loc) · 4.71 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
name: Build check
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- master
jobs:
build-ubuntu:
runs-on: ubuntu-22.04
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
- name: "Install dependencies"
run: |
sudo apt update -qq
sudo apt install -y cmake libsdl2-dev libsdl2-net-dev libsdl2-image-dev libssl-dev libopenal-dev libcal3d12-dev libvorbis-dev libsdl2-ttf-dev
- name: "cmake"
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DLOCAL_NLOHMANN_JSON=ON
- name: "compile"
run: |
cmake --build build
build-ubuntu-mapeditor:
runs-on: ubuntu-22.04
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
- name: "Install dependencies"
run: |
sudo apt update -qq
sudo apt install -y cmake libsdl1.2-dev libsdl-image1.2-dev libopenal-dev libcal3d12-dev nlohmann-json3-dev libx11-dev libgtk2.0-dev
- name: "cmake"
working-directory: ./map_editor
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=release -DLOCAL_NLOHMANN_JSON=ON
- name: "compile"
working-directory: ./map_editor
run: |
cmake --build build
build-windows:
runs-on: windows-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0
- name: "Setup MSYS2 environment"
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
base-devel
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-SDL2_net
mingw-w64-x86_64-SDL2_image
mingw-w64-x86_64-openssl
mingw-w64-x86_64-openal
mingw-w64-x86_64-libvorbis
mingw-w64-x86_64-SDL2_ttf
mingw-w64-x86_64-libxml2
- name: "Download and install cal3d from source"
shell: msys2 {0}
run: |
wget https://github.com/raduprv/Eternal-Lands/releases/download/1.9.5.2/cal3d-0.11.0.tar.gz
wget https://github.com/raduprv/Eternal-Lands/releases/download/1.9.5.2/cal3d-0.11.0-patch
tar xfz cal3d-0.11.0.tar.gz
cd cal3d-0.11.0/
patch -p1 < ../cal3d-0.11.0-patch
export "CFLAGS=-I${PACKAGELOCAL}/include -O3"
export "CPPFLAGS=-I${PACKAGELOCAL}/include -O3"
export "LDFLAGS=-L${PACKAGELOCAL}/lib"
export "PKG_CONFIG_PATH=${PACKAGELOCAL}/lib/pkgconfig"
./configure --prefix=${PACKAGELOCAL} && make && make install-strip
- name: "cmake"
shell: msys2 {0}
run: |
cmake -G "MinGW Makefiles" -S . -B build -DCMAKE_BUILD_TYPE=release -DLOCAL_NLOHMANN_JSON=ON
- name: "compile"
shell: msys2 {0}
run: |
cmake --build build
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y git wget unzip ant
- name: Set up Android Tools and Build Tree
env:
ANDROID_HOME: ${{ github.workspace }}/android-tools
run: |
mkdir $ANDROID_HOME
wget https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -P $ANDROID_HOME
unzip $ANDROID_HOME/tools_r25.2.5-linux.zip -d $ANDROID_HOME
echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools" "build-tools;30.0.3" "ndk-bundle" "platforms;android-19" "platforms;android-30"
mkdir ${{ github.workspace }}/el
git clone https://github.com/pjbroad/el-build-methods.git ${{ github.workspace }}/el/el-build-methods
git clone https://github.com/raduprv/Eternal-Lands.git ${{ github.workspace }}/el/el-build-methods/android/jni/src
- name: Setup libs
env:
ANDROID_HOME: ${{ github.workspace }}/android-tools
run: |
cd ${{ github.workspace }}/el/el-build-methods/android/
./setup-libs.bash
- name: Build Android Package
env:
ANDROID_HOME: ${{ github.workspace }}/android-tools
APP_ALLOW_MISSING_DEPS: true
run: |
cd ${{ github.workspace }}/el/el-build-methods/android/
$ANDROID_HOME/ndk-bundle/ndk-build -j $(nproc)