CI: added OpenTTD build script
This commit is contained in:
45
.github/workflows/ballfield.yml
vendored
45
.github/workflows/ballfield.yml
vendored
@@ -31,6 +31,7 @@ jobs:
|
||||
APP_NAME: ballfield
|
||||
# It takes one hour per one architecture to build Boost and ICU libraries, and Github limits CI script duration to 6 hours
|
||||
ARCH_LIST: armeabi-v7a arm64-v8a x86 x86_64
|
||||
ANDROID_BUILD_TOOLS: 33.0.2
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -63,46 +64,6 @@ jobs:
|
||||
run: |
|
||||
sed -i "s/MultiABI=.*/MultiABI='${ARCH_LIST}'/g" project/jni/application/src/AndroidAppSettings.cfg
|
||||
|
||||
# - name: Get Boost revision
|
||||
# id: boost-rev
|
||||
# run: echo "::set-output name=BOOST_REV::`git -C project/jni/boost/src rev-parse HEAD`"
|
||||
#
|
||||
# - name: Get ICU revision
|
||||
# id: icu-rev
|
||||
# run: echo "::set-output name=ICU_REV::`git -C project/jni/iconv/src rev-parse HEAD`"
|
||||
#
|
||||
# - name: Copy Boost libraries from cache
|
||||
# uses: actions/cache@v2
|
||||
# id: cache-boost
|
||||
# with:
|
||||
# # The same SDL revision will produce the same libraries
|
||||
# key: ${{steps.boost-rev.outputs.BOOST_REV}}
|
||||
# path: |
|
||||
# build-android/project/jni/boost/include
|
||||
# build-android/project/jni/boost/lib
|
||||
#
|
||||
# - name: Copy ICU libraries from cache
|
||||
# uses: actions/cache@v2
|
||||
# id: cache-icu
|
||||
# with:
|
||||
# # The same SDL revision will produce the same libraries
|
||||
# key: ${{steps.icu-rev.outputs.ICU_REV}}
|
||||
# path: |
|
||||
# build-android/project/jni/iconv/include
|
||||
# build-android/project/jni/iconv/lib
|
||||
# build-android/project/jni/icuuc/include
|
||||
# build-android/project/jni/icuuc/lib
|
||||
#
|
||||
# - name: Touch cached Boost timestamps
|
||||
# if: steps.cache-boost.outputs.cache-hit == 'true' || steps.cache-icu.outputs.cache-hit == 'true'
|
||||
# working-directory: build-android
|
||||
# run: touch project/jni/boost/lib/*/* || true
|
||||
#
|
||||
# - name: Touch cached ICU timestamps
|
||||
# if: steps.cache-boost.outputs.cache-hit == 'true' || steps.cache-icu.outputs.cache-hit == 'true'
|
||||
# working-directory: build-android
|
||||
# run: touch project/jni/iconv/lib/*/* project/jni/icuuc/lib/*/* || true
|
||||
|
||||
- name: Patch Java files and build Boost, ICU, and OpenSSL
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$PATH
|
||||
@@ -121,7 +82,7 @@ jobs:
|
||||
|
||||
- name: Hyper turbo build script GOOOOOOOOOOOO
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/31.0.0:$PATH
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS:$PATH
|
||||
./build.sh
|
||||
|
||||
- name: App signing keys
|
||||
@@ -136,7 +97,7 @@ jobs:
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/31.0.0:$PATH
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS:$PATH
|
||||
if [ -e keystore.jks ]; then
|
||||
export ANDROID_KEYSTORE_FILE=`pwd`/keystore.jks
|
||||
fi
|
||||
|
||||
144
.github/workflows/openttd.yml
vendored
Normal file
144
.github/workflows/openttd.yml
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
# Copyright (C) 2021-2021 Sergii Pylypenko <x.pelya.x@gmail.com>
|
||||
#
|
||||
# This software is provided 'as-is', without any express or implied
|
||||
# warranty. In no event will the authors be held liable for any damages
|
||||
# arising from the use of this software.
|
||||
#
|
||||
# Permission is granted to anyone to use this software for any purpose,
|
||||
# including commercial applications, and to alter it and redistribute it
|
||||
# freely, subject to the following restrictions:
|
||||
#
|
||||
# 1. The origin of this software must not be misrepresented; you must not
|
||||
# claim that you wrote the original software. If you use this software
|
||||
# in a product, an acknowledgment in the product documentation would be
|
||||
# appreciated but is not required.
|
||||
# 2. Altered source versions must be plainly marked as such, and must not be
|
||||
# misrepresented as being the original software.
|
||||
# 3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
name: openttd
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
env:
|
||||
APP_NAME: openttd
|
||||
# It takes one hour per one architecture to build Boost and ICU libraries, and Github limits CI script duration to 6 hours
|
||||
#ARCH_LIST: armeabi-v7a arm64-v8a x86 x86_64
|
||||
ARCH_LIST: arm64-v8a
|
||||
ANDROID_BUILD_TOOLS: 33.0.2
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Java 17
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: 17
|
||||
distribution: temurin
|
||||
|
||||
- name: Check out the repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: false
|
||||
|
||||
- name: Check out submodules
|
||||
# There are many more submodules in this repo, we don't need them all
|
||||
run: >
|
||||
git submodule update --init --recursive --depth=1
|
||||
project/jni/boost/src project/jni/iconv/src
|
||||
project/jni/sdl2 project/jni/sdl2_image
|
||||
project/jni/sdl2_mixer project/jni/sdl2_ttf
|
||||
|
||||
- name: Symlink the application dir
|
||||
run: |
|
||||
ln -s ${APP_NAME} project/jni/application/src
|
||||
|
||||
- name: Set architectures list
|
||||
run: |
|
||||
sed -i "s/MultiABI=.*/MultiABI='${ARCH_LIST}'/g" project/jni/application/src/AndroidAppSettings.cfg
|
||||
|
||||
- name: Get ICU revision
|
||||
id: icu-rev
|
||||
run: echo "::set-output name=ICU_REV::`git -C project/jni/iconv/src rev-parse HEAD`:`echo ${ARCH_LIST} | sed 's/ /:/g'`"
|
||||
|
||||
- name: Copy ICU libraries from cache
|
||||
uses: actions/cache@v2
|
||||
id: cache-icu
|
||||
with:
|
||||
# The same SDL revision will produce the same libraries
|
||||
key: ${{steps.icu-rev.outputs.ICU_REV}}
|
||||
path: |
|
||||
project/jni/iconv/include
|
||||
project/jni/iconv/lib
|
||||
project/jni/icuuc/include
|
||||
project/jni/icuuc/lib
|
||||
|
||||
- name: Touch cached ICU timestamps
|
||||
if: steps.cache-icu.outputs.cache-hit == 'true'
|
||||
run: touch project/jni/iconv/lib/*/* project/jni/icuuc/lib/*/* || true
|
||||
|
||||
- name: Patch Java files and build Boost, ICU, and OpenSSL
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$PATH
|
||||
./changeAppSettings.sh
|
||||
|
||||
- name: Set up Gradle and Android SDK licenses
|
||||
working-directory: project
|
||||
run: |
|
||||
for Y in `seq 20`; do echo y; done | sudo $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
|
||||
./gradlew assembleRelease || true
|
||||
for Y in `seq 20`; do echo y; done | sudo $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses --sdk_root=`pwd`
|
||||
mkdir -p $HOME/.android
|
||||
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"
|
||||
echo "sdk.dir=$ANDROID_SDK_ROOT" > local.properties
|
||||
echo "proguard.config=proguard.cfg;proguard-local.cfg" >> local.properties
|
||||
|
||||
- name: Hyper turbo build script GOOOOOOOOOOOO
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS:$PATH
|
||||
./build.sh
|
||||
|
||||
- name: App signing keys
|
||||
run: |
|
||||
echo "$ANDROID_KEYSTORE_B64" | base64 -d > keystore.jks || true
|
||||
echo "$ANDROID_UPLOAD_KEYSTORE_B64" | base64 -d > upload_keystore.jks || true
|
||||
find keystore.jks -empty -delete || true
|
||||
find upload_keystore.jks -empty -delete || true
|
||||
env:
|
||||
ANDROID_KEYSTORE_B64: "${{secrets.ANDROID_KEYSTORE_B64}}"
|
||||
ANDROID_UPLOAD_KEYSTORE_B64: "${{secrets.ANDROID_UPLOAD_KEYSTORE_B64}}"
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS:$PATH
|
||||
if [ -e keystore.jks ]; then
|
||||
export ANDROID_KEYSTORE_FILE=`pwd`/keystore.jks
|
||||
fi
|
||||
if [ -e upload_keystore.jks ]; then
|
||||
export ANDROID_UPLOAD_KEYSTORE_FILE=`pwd`/upload_keystore.jks
|
||||
fi
|
||||
mkdir -p upload/
|
||||
./sign.sh
|
||||
mv *.apk upload/
|
||||
./signBundle.sh
|
||||
mv *.aab upload/
|
||||
env:
|
||||
ANDROID_KEYSTORE_PASS: "${{secrets.ANDROID_KEYSTORE_PASS}}"
|
||||
ANDROID_KEYSTORE_ALIAS: "${{secrets.ANDROID_KEYSTORE_ALIAS}}"
|
||||
ANDROID_UPLOAD_KEYSTORE_PASS: "${{secrets.ANDROID_UPLOAD_KEYSTORE_PASS}}"
|
||||
ANDROID_UPLOAD_KEYSTORE_ALIAS: "${{secrets.ANDROID_UPLOAD_KEYSTORE_ALIAS}}"
|
||||
|
||||
# Github actions is dumb and won't let you download single files from artifacts, so break up the artifacts instead
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{env.APP_NAME}}
|
||||
path: upload
|
||||
if-no-files-found: error
|
||||
45
.github/workflows/sdl2-demo.yml
vendored
45
.github/workflows/sdl2-demo.yml
vendored
@@ -31,6 +31,7 @@ jobs:
|
||||
APP_NAME: sdl2-demo
|
||||
# It takes one hour per one architecture to build Boost and ICU libraries, and Github limits CI script duration to 6 hours
|
||||
ARCH_LIST: armeabi-v7a arm64-v8a x86 x86_64
|
||||
ANDROID_BUILD_TOOLS: 33.0.2
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -63,46 +64,6 @@ jobs:
|
||||
run: |
|
||||
sed -i "s/MultiABI=.*/MultiABI='${ARCH_LIST}'/g" project/jni/application/src/AndroidAppSettings.cfg
|
||||
|
||||
# - name: Get Boost revision
|
||||
# id: boost-rev
|
||||
# run: echo "::set-output name=BOOST_REV::`git -C project/jni/boost/src rev-parse HEAD`"
|
||||
#
|
||||
# - name: Get ICU revision
|
||||
# id: icu-rev
|
||||
# run: echo "::set-output name=ICU_REV::`git -C project/jni/iconv/src rev-parse HEAD`"
|
||||
#
|
||||
# - name: Copy Boost libraries from cache
|
||||
# uses: actions/cache@v2
|
||||
# id: cache-boost
|
||||
# with:
|
||||
# # The same SDL revision will produce the same libraries
|
||||
# key: ${{steps.boost-rev.outputs.BOOST_REV}}
|
||||
# path: |
|
||||
# build-android/project/jni/boost/include
|
||||
# build-android/project/jni/boost/lib
|
||||
#
|
||||
# - name: Copy ICU libraries from cache
|
||||
# uses: actions/cache@v2
|
||||
# id: cache-icu
|
||||
# with:
|
||||
# # The same SDL revision will produce the same libraries
|
||||
# key: ${{steps.icu-rev.outputs.ICU_REV}}
|
||||
# path: |
|
||||
# build-android/project/jni/iconv/include
|
||||
# build-android/project/jni/iconv/lib
|
||||
# build-android/project/jni/icuuc/include
|
||||
# build-android/project/jni/icuuc/lib
|
||||
#
|
||||
# - name: Touch cached Boost timestamps
|
||||
# if: steps.cache-boost.outputs.cache-hit == 'true' || steps.cache-icu.outputs.cache-hit == 'true'
|
||||
# working-directory: build-android
|
||||
# run: touch project/jni/boost/lib/*/* || true
|
||||
#
|
||||
# - name: Touch cached ICU timestamps
|
||||
# if: steps.cache-boost.outputs.cache-hit == 'true' || steps.cache-icu.outputs.cache-hit == 'true'
|
||||
# working-directory: build-android
|
||||
# run: touch project/jni/iconv/lib/*/* project/jni/icuuc/lib/*/* || true
|
||||
|
||||
- name: Patch Java files and build Boost, ICU, and OpenSSL
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$PATH
|
||||
@@ -121,7 +82,7 @@ jobs:
|
||||
|
||||
- name: Hyper turbo build script GOOOOOOOOOOOO
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/31.0.0:$PATH
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS:$PATH
|
||||
./build.sh
|
||||
|
||||
- name: App signing keys
|
||||
@@ -136,7 +97,7 @@ jobs:
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/31.0.0:$PATH
|
||||
export PATH=$ANDROID_NDK_LATEST_HOME:$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS:$PATH
|
||||
if [ -e keystore.jks ]; then
|
||||
export ANDROID_KEYSTORE_FILE=`pwd`/keystore.jks
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user