Skip to content

Commit d3f5673

Browse files
authored
Merge branch 'master' into add_text_area
2 parents 2dde3cd + be6ae20 commit d3f5673

File tree

797 files changed

+42264
-22504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

797 files changed

+42264
-22504
lines changed

.ci_scripts/package.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,26 @@
22

33
shopt -s nullglob
44

5-
if [ "$OS_NAME" = "macos-latest" ] && [ "$PACKAGE" = "ON" ]; then
5+
if ([ "$OS_NAME" = "macos-10.15" ] || [ "$OS_NAME" = "macos-11" ]) && [ "$PACKAGE" = "ON" ]; then
66
sudo chmod -R +w /usr/local/Cellar
77
cpack -G Bundle;
88
fi
99

1010
# make only one source package
11-
if [ "$OS_NAME" = "ubuntu-latest" ] && [ "$COMPILER_NAME" = "gcc" ] && [ "$BUILD_NAME" = "Debug" ] && [ "$ARCH" = "64" ] && [ "$PACKAGE" = "ON" ]; then
11+
if [ "$SOURCE" = "ON" ]; then
1212
cpack --config CPackSourceConfig.cmake -G TGZ;
1313
fi
1414

15-
if [ "$OS_NAME" = "ubuntu-latest" ] && [ "$PACKAGE" = "ON" ]; then
15+
if ([ "$OS_NAME" = "ubuntu-latest" ] || [ "$OS_NAME" = "ubuntu-18.04" ]) && [ "$PACKAGE" = "ON" ]; then
1616
../.ci_scripts/build_appimage.sh
1717
# extract built appimages for uploading
1818
mv ~/out/* .
19+
20+
# CI expects all artifacts to start with "SuperTux-", AppImage generates "SuperTux_v2-...."
21+
for filename in SuperTux_2-*.AppImage; do
22+
[ -f "$filename" ] || continue
23+
mv "$filename" "${filename//_2/}"
24+
done
1925
fi
2026

2127
mkdir upload

.github/workflows/android.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# SuperTux
2+
# Copyright (C) 2021-2021 Sergii Pylypenko <[email protected]>
3+
#
4+
# This program is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU General Public License
6+
# as published by the Free Software Foundation; either version 3
7+
# of the License, or (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program; if not, write to the Free Software
16+
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17+
18+
name: Android
19+
on:
20+
push:
21+
branches:
22+
- master
23+
tags:
24+
- '*'
25+
pull_request: {}
26+
27+
jobs:
28+
build-android:
29+
env:
30+
# Revision of https://github.com/pelya/commandergenius.git - SDL2 repo is a submodule
31+
# We check out a specific stable revision, so the build won't break if I modify my SDL repo
32+
SDL_ANDROID_REV: 798fd0f5e167aa6ecce33623dbf88ebc6cd647ea
33+
# It takes 35 minutes per one architecture to build SuperTux, of which 20 minutes are for building Boost and ICU libraries
34+
# Enable additional architectures when we have these libraries inside the cache, or create a separate Android script for each architecture
35+
ARCH_LIST: armeabi-v7a arm64-v8a x86 x86_64
36+
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
with:
42+
fetch-depth: 0
43+
submodules: true
44+
45+
- name: Clone SDL Android repo
46+
run: |
47+
git clone --depth=100 https://github.com/pelya/commandergenius.git build.android
48+
git -C build.android checkout ${SDL_ANDROID_REV}
49+
50+
- name: Clone SDL Android repo submodules
51+
# There are many more submodules in this repo, we don't need them all
52+
working-directory: build.android
53+
run: >
54+
git submodule update --init --recursive --depth=1
55+
project/jni/boost/src project/jni/iconv/src
56+
project/jni/sdl2 project/jni/sdl2_image
57+
project/jni/sdl2_mixer project/jni/sdl2_ttf
58+
59+
- name: Symlink the application dir
60+
run: |
61+
rm -rf build.android/project/jni/application/supertux/supertux
62+
ln -s `pwd` build.android/project/jni/application/supertux/supertux
63+
ln -s supertux build.android/project/jni/application/src
64+
65+
- name: Set architectures list and version
66+
working-directory: build.android
67+
run: |
68+
VERSION_NAME="$(git -C .. describe --tags | cut -f 1,2 -d "-" | sed 's/[^0-9\\.\\-]//g' | sed 's/-/./g')"
69+
VERSION_CODE="$(printf "%02d%02d%02d%04d\n" "$(echo $VERSION_NAME | cut -d . -f 1)" "$(echo $VERSION_NAME | cut -d . -f 2)" "$(echo $VERSION_NAME | cut -d . -f 3)" "$(echo $VERSION_NAME | cut -d . -f 4)")"
70+
echo "Version name: $VERSION_NAME"
71+
echo "Version code: $VERSION_CODE"
72+
sed -i "s/MultiABI=.*/MultiABI='${ARCH_LIST}'/g" project/jni/application/supertux/AndroidAppSettings.cfg
73+
sed -i "s/AppVersionName.*/AppVersionName="$VERSION_NAME"/g" project/jni/application/supertux/AndroidAppSettings.cfg
74+
sed -i "s/AppVersionCode.*/AppVersionCode=$VERSION_CODE/g" project/jni/application/supertux/AndroidAppSettings.cfg
75+
76+
- name: Copy precompiled libraries from cache
77+
uses: actions/cache@v2
78+
id: cache
79+
with:
80+
# The same SDL revision will produce the same libraries
81+
key: ${{env.SDL_ANDROID_REV}}
82+
path: |
83+
build.android/project/jni/boost/include
84+
build.android/project/jni/boost/lib
85+
build.android/project/jni/iconv/include
86+
build.android/project/jni/iconv/lib
87+
build.android/project/jni/icuuc/include
88+
build.android/project/jni/icuuc/lib
89+
build.android/project/jni/openssl/include
90+
build.android/project/jni/openssl/lib
91+
92+
- name: Touch cached file timestamps
93+
if: steps.cache.outputs.cache-hit == 'true'
94+
working-directory: build.android
95+
run: >
96+
touch
97+
project/jni/boost/lib/*/*
98+
project/jni/iconv/lib/*/*
99+
project/jni/icuuc/lib/*/*
100+
project/jni/openssl/lib/*/*
101+
|| true
102+
103+
- name: Build Boost, ICU, and OpenSSL
104+
working-directory: build.android
105+
run: |
106+
export PATH=$ANDROID_NDK_LATEST_HOME:$PATH
107+
./changeAppSettings.sh
108+
109+
- name: Set up Gradle and Android SDK licenses
110+
working-directory: build.android/project
111+
run: |
112+
yes | sudo $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
113+
./gradlew assembleRelease || true
114+
yes | sudo $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses --sdk_root=`pwd`
115+
mkdir -p $HOME/.android
116+
keytool -genkey -v -keystore $HOME/.android/debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Debug, OU=Debug, O=Debug, L=Debug, ST=Debug, C=Debug"
117+
echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
118+
echo "proguard.config=proguard.cfg;proguard-local.cfg" >> local.properties
119+
120+
- name: Build
121+
working-directory: build.android
122+
run: |
123+
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/31.0.0:$PATH
124+
./build.sh
125+
126+
- name: Package
127+
working-directory: build.android
128+
run: |
129+
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/31.0.0:$PATH
130+
mkdir -p upload/apk/ upload/aab/
131+
cd project
132+
./gradlew bundleReleaseWithDebugInfo
133+
mv app/build/outputs/bundle/releaseWithDebugInfo/app-releaseWithDebugInfo.aab ../upload/aab/SuperTux.aab
134+
cd jni/application/supertux
135+
./create-apk-with-data.sh
136+
cd ../../../..
137+
mv SuperTux*.apk upload/apk/
138+
cd ..
139+
140+
- uses: actions/upload-artifact@v2
141+
with:
142+
name: "SuperTux-android-aab"
143+
path: build.android/upload/aab
144+
if-no-files-found: error
145+
146+
- uses: actions/upload-artifact@v2
147+
with:
148+
name: "SuperTux-android-apk"
149+
path: build.android/upload/apk
150+
if-no-files-found: error

.github/workflows/bsd.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# SuperTux
2+
# Copyright (C) 2020-2021 Jacob Burroughs <[email protected]>
3+
# 2020-2022 A. Semphris <[email protected]>
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
18+
name: BSD
19+
on:
20+
push:
21+
branches:
22+
- master
23+
tags:
24+
- '*'
25+
pull_request: {}
26+
27+
jobs:
28+
bsd:
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
# TODO: Add the OpenBSD, NetBSD and Solaris VMs whenever possible
34+
vm_os: [freebsd]
35+
build_type: [Debug, Release]
36+
# FreeBSD does not have glbinding
37+
# glbinding: [ON, OFF]
38+
39+
runs-on: macos-10.15
40+
steps:
41+
- uses: actions/checkout@v2
42+
with:
43+
# Fetch the whole tree so git describe works
44+
fetch-depth: 0
45+
submodules: true
46+
47+
- name: Build in FreeBSD
48+
if: ${{ matrix.vm_os == 'freebsd' }}
49+
env:
50+
BUILD_TYPE: ${{ matrix.build_type }}
51+
# GLBINDING: ${{ matrix.glbinding }} # TODO: Re-add if available
52+
uses: vmactions/[email protected]
53+
with:
54+
envs: 'BUILD_TYPE' # TODO: Add GLBINDING here if it comes to FreeBSD
55+
sync: rsync
56+
usesh: true
57+
prepare: |
58+
pkg install -y pkgconf
59+
pkg install -y git
60+
pkg install -y cmake
61+
pkg install -y googletest
62+
pkg install -y sdl2
63+
pkg install -y sdl2_image
64+
pkg install -y openal-soft
65+
pkg install -y glew
66+
# pkg install -y glbinding # TODO: Uncomment whenever possible
67+
pkg install -y boost-all
68+
pkg install -y curl
69+
pkg install -y libogg
70+
pkg install -y libvorbis
71+
pkg install -y freetype
72+
pkg install -y libraqm
73+
pkg install -y glm
74+
run: |
75+
mkdir build && cd build
76+
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWARNINGS=ON -DWERROR=ON \
77+
-DBUILD_TESTS=ON -DINSTALL_SUBDIR_SHARE=share/supertux2 \
78+
-DCMAKE_INSTALL_MESSAGE=NEVER -DCMAKE_INSTALL_PREFIX=/usr \
79+
-DINSTALL_SUBDIR_BIN=bin # -DGLBINDING_ENABLED=$GLBINDING
80+
# TODO: Uncomment whenever possible
81+
make -j3 VERBOSE=1
82+
make install DESTDIR="/tmp/supertux" VERBOSE=1
83+
./test_supertux2

0 commit comments

Comments
 (0)