Only default controls on first startup #161
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Set up our JDK environment | |
uses: actions/setup-java@v1.4.3 | |
with: | |
java-version: 11 | |
- name: Print toolchain versions | |
run: | | |
java -version | |
- 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@v4 | |
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 | |