2020-05-05 17:00:44 +00:00
|
|
|
name: Android CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up build environment
|
2021-08-27 19:37:40 +00:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-12-23 21:31:13 +00:00
|
|
|
sudo apt-get -y install ccache libcurl4-openssl-dev ninja-build
|
2021-07-14 17:04:12 +00:00
|
|
|
|
2021-12-23 21:31:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-05-05 17:00:44 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-08-27 19:37:40 +00:00
|
|
|
submodules: true
|
|
|
|
|
2021-12-23 21:31:13 +00:00
|
|
|
- uses: actions/cache@v3
|
2021-08-27 19:37:40 +00:00
|
|
|
with:
|
2021-12-23 21:31:13 +00:00
|
|
|
path: ~/.ccache
|
2021-08-27 19:37:40 +00:00
|
|
|
key: android-ccache-${{ github.sha }}
|
|
|
|
restore-keys: android-ccache-
|
2020-05-05 17:00:44 +00:00
|
|
|
|
2021-12-23 21:31:13 +00:00
|
|
|
- uses: actions/cache@v3
|
2020-05-05 17:00:44 +00:00
|
|
|
with:
|
2021-05-28 19:29:07 +00:00
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
2021-08-27 19:37:40 +00:00
|
|
|
key: android-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
|
|
restore-keys: android-gradle-
|
2020-05-05 17:00:44 +00:00
|
|
|
|
|
|
|
- name: Gradle
|
|
|
|
working-directory: shell/android-studio
|
2021-07-14 17:04:12 +00:00
|
|
|
run: ./gradlew assembleRelease --parallel
|
2020-05-05 17:00:44 +00:00
|
|
|
|
2021-12-23 21:31:13 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-05-05 17:00:44 +00:00
|
|
|
with:
|
2021-07-14 17:04:12 +00:00
|
|
|
name: flycast-release.apk
|
|
|
|
path: shell/android-studio/flycast/build/outputs/apk/release/flycast-release.apk
|
2021-05-24 09:03:15 +00:00
|
|
|
|
2021-07-25 19:55:29 +00:00
|
|
|
- name: Build dump_syms
|
|
|
|
working-directory: core/deps/breakpad
|
|
|
|
run: |
|
2021-12-20 14:45:46 +00:00
|
|
|
./configure --prefix=$PWD
|
|
|
|
make -j2
|
|
|
|
make install
|
2021-07-25 19:55:29 +00:00
|
|
|
|
|
|
|
- name: Extract symbols
|
|
|
|
run: |
|
2021-12-20 14:45:46 +00:00
|
|
|
DUMP_SYMS=./core/deps/breakpad/bin/dump_syms
|
2021-07-25 19:55:29 +00:00
|
|
|
SO_DIR=shell/android-studio/flycast/build/intermediates/cmake/release/obj
|
|
|
|
for arch in arm64-v8a armeabi-v7a x86 x86_64 ; do
|
|
|
|
$DUMP_SYMS $SO_DIR/$arch/libflycast.so > libflycast.so.sym
|
|
|
|
BUILD_ID=`head -1 libflycast.so.sym | awk '{ print $4 }'`
|
|
|
|
mkdir -p symbols/libflycast.so/$BUILD_ID
|
|
|
|
mv libflycast.so.sym symbols/libflycast.so/$BUILD_ID
|
|
|
|
done
|
|
|
|
|
2021-12-21 20:26:31 +00:00
|
|
|
- name: Configure AWS Credentials
|
|
|
|
id: aws-credentials
|
|
|
|
uses: aws-actions/configure-aws-credentials@v1
|
|
|
|
with:
|
|
|
|
aws-access-key-id: AKIAJOZQS4H2PHQWYFCA
|
|
|
|
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
|
|
|
|
aws-region: us-east-2
|
|
|
|
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push'
|
|
|
|
|
|
|
|
- name: Upload to S3
|
|
|
|
run: aws s3 sync shell/android-studio/flycast/build/outputs/apk/release s3://flycast-builds/android/${GITHUB_REF#refs/}-$GITHUB_SHA --acl public-read --exclude='*.json' --follow-symlinks
|
|
|
|
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
|
|
|
|
|
2021-08-27 19:37:40 +00:00
|
|
|
- name: Upload to S3 (symbols)
|
|
|
|
run: aws s3 sync symbols s3://flycast-symbols/android --follow-symlinks
|
|
|
|
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
|