flycast/.github/workflows/android.yml

60 lines
1.9 KiB
YAML

name: Android CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up build environment
run: sudo apt-get update && sudo apt-get -y install ninja-build
# Workaround for https://github.com/actions/virtual-environments/issues/3078
- name: Downgrade CMake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: '3.19.x'
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle
working-directory: shell/android-studio
run: ./gradlew assembleRelease --parallel
- uses: actions/upload-artifact@v2
with:
name: flycast-release.apk
path: shell/android-studio/flycast/build/outputs/apk/release/flycast-release.apk
- name: Set up git vars
run: |
echo GIT_BUILD=`git describe --all --always | sed 's/remotes\/origin/heads/'`-$GITHUB_SHA >> $GITHUB_ENV
- name: Clean up
run: rm -f shell/android-studio/flycast/build/outputs/apk/release/*.json
- uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: flycast-builds
AWS_ACCESS_KEY_ID: AKIAJOZQS4H2PHQWYFCA
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
AWS_REGION: 'us-east-2'
SOURCE_DIR: 'shell/android-studio/flycast/build/outputs/apk/release/'
DEST_DIR: android/${{ env.GIT_BUILD }}
if: ${{ github.repository == 'flyinghead/flycast' && github.event_name == 'push' }}