Skip to content

Version 44

Version 44 #148

Workflow file for this run

name: CI
on:
push:
# Run for pushes to master or a version branch, e.g. a PR was merged ...
branches:
- android
# ... and only when we've possibly changed how the game will function.
paths:
- 'android/**'
- 'source/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- keys.txt
pull_request:
# Run for any push to any pull request, if it modifies source code or game text.
types: [opened, synchronize]
paths:
- 'android/**'
- 'source/**'
- 'data/**'
- 'tests/**'
- '.github/workflows/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- keys.txt
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build_android:
# TODO: only build if source changed. otherwise, d/l latest continuous
runs-on: ubuntu-latest
env:
ANDROID_SDK_ROOT: /path/to/sdk
ARTIFACT: endless-mobile
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG_CERTIFICATE: ${{ secrets.ANDROID_DEBUG_KEYSTORE }}
steps:
- uses: actions/checkout@v2
- name: Install development dependencies
run: |
sudo rm /etc/apt/sources.list.d/* && sudo dpkg --clear-avail # Speed up installation and get rid of unwanted lists
sudo apt-get update
sudo apt-get install -y --no-install-recommends libsdl2-dev libpng-dev libjpeg-turbo8-dev libopenal-dev libmad0-dev libglew-dev libgl1-mesa-dev uuid-dev ccache libgles2-mesa
python3 -m pip install --user scons
- name: Set up our JDK environment
uses: actions/[email protected]
with:
java-version: 11
- name: Print toolchain versions
run: |
g++ -v
gcc-ar --version
ld -v
scons --version
python --version
java -version
- name: Unit Tests
run: |
scons -Qj $(nproc) opengl=gles mode=debug test;
- name: Update Environment
run: |
mkdir -p ~/.android
echo $DEBUG_CERTIFICATE | base64 -d > ~/.android/debug.keystore
- name: Compile Android
run: |
cd android/app && sh ./download_build_dependencies.sh
cd .. && ./gradlew --no-daemon assemble
- name: Upload apks
uses: actions/upload-artifact@v2
with:
name: endless-mobile-debug-latest.apk
path: android/app/build/outputs/apk/debug/app-debug.apk
- name: Install github-release
run: |
go install github.com/github-release/github-release@latest
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Set environment variables
run: |
echo "GITHUB_USER=$( echo ${{ github.repository }} | cut -d/ -f1 )" >> $GITHUB_ENV
echo "GITHUB_REPO=$( echo ${{ github.repository }} | cut -d/ -f2 )" >> $GITHUB_ENV
- name: Move/Create continuous tag
run: |
git tag --force continuous ${{ github.sha }}
git push --tags --force
- name: Setup continuous release
run: |
DESCRIPTION="Triggered on $(date -u '+%Y/%m/%d, %H:%M') UTC by commit ${{ github.sha }} (@${{ github.actor }})
This is an automated build of the latest source. It may be unstable or even crash, corrupt your save or eat your kitten. Use with caution!
https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo $DESCRIPTION
echo $GITHUB_ENV
echo $GITHUB_PATH
if ! github-release info -t continuous > /dev/null 2>&1; then
github-release release \
--tag continuous \
--name "Continuous Build" \
--description "$DESCRIPTION" \
--pre-release
else
github-release edit \
--tag continuous \
--name "Continuous Build" \
--description "$DESCRIPTION" \
--pre-release
fi
github-release upload \
--tag continuous \
--name endless-mobile-debug-latest.apk \
--replace \
--file android/app/build/outputs/apk/debug/app-debug.apk