Skip to content

Input: Allow binding emulator menu + add pause button binding #396

Input: Allow binding emulator menu + add pause button binding

Input: Allow binding emulator menu + add pause button binding #396

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
build:
# Skip 'labeled' events that didn't add the 'ci' label
if: |
github.event_name != 'pull_request' ||
github.event.action != 'labeled' ||
github.event.label.name == 'ci'
runs-on: ubuntu-latest
env:
JVM_OPTS: -Xmx6G
IS_BUILD_SIGNED: ${{ secrets.KEYSTORE != '' }}
UPLOAD_ARTIFACTS: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci') }}
CMAKE_VERSION: "3.22.1"
NDK_VERSION: "27.2.12479018"
BUILD_TYPE: release
steps:
- name: Git Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Restore CCache
uses: hendrikmuhs/ccache-action@v1.2
with:
max-size: 3Gi
- name: Restore Gradle Cache
uses: actions/cache@v3
with:
path: ~/.gradle/
key: ${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('app/**/*.xml') }}-${{ hashFiles('app/**.kt', 'app/**.java') }}
restore-keys: |
${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('app/**/*.xml') }}-
${{ runner.os }}-gradle-${{ hashFiles('**/build.gradle') }}-
${{ runner.os }}-gradle-
- name: Install Java 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Install Ninja Build
run: |
sudo apt-get install -y ninja-build
ln -s /usr/bin/ninja .
- name: Install CMake & Android NDK
run: echo "yes" | $ANDROID_HOME/tools/bin/sdkmanager "cmake;${{ env.CMAKE_VERSION }}" "ndk;${{ env.NDK_VERSION }}" --channel=3 | grep -v = || true
- name: Decode Keystore
if: env.IS_BUILD_SIGNED == 'true'
env:
KEYSTORE_ENCODED: ${{ secrets.KEYSTORE }}
run: |
echo "$KEYSTORE_ENCODED" | base64 --decode > ${{ github.workspace }}/app/ks.jks
- name: Android Assemble
env:
SIGNING_STORE_PATH: "ks.jks"
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
CMAKE_C_COMPILER_LAUNCHER: "ccache"
CMAKE_CXX_COMPILER_LAUNCHER: "ccache"
CCACHE_COMPILERCHECK: "string:${{ env.NDK_VERSION }}"
run: ./gradlew --build-cache assembleFull${{ env.BUILD_TYPE }}
- name: Rename APKs (Signed)
if: env.IS_BUILD_SIGNED == 'true' && env.UPLOAD_ARTIFACTS == 'true'
run: |
mv app/build/outputs/apk/full/${{ env.BUILD_TYPE }}/app-full-${{ env.BUILD_TYPE }}.apk pine-emu-$GITHUB_RUN_NUMBER-${{ env.BUILD_TYPE }}.apk
- name: Upload Signed APK
if: env.IS_BUILD_SIGNED == 'true' && env.UPLOAD_ARTIFACTS == 'true'
uses: actions/upload-artifact@v4
with:
name: pine-emu-${{ github.run_number }}-${{ env.BUILD_TYPE }}.apk
path: pine-emu-${{ github.run_number }}-${{ env.BUILD_TYPE }}.apk
- name: Rename APKs (Unsigned)
if: env.IS_BUILD_SIGNED == 'false' && env.UPLOAD_ARTIFACTS == 'true'
run: |
mv app/build/outputs/apk/full/${{ env.BUILD_TYPE }}/app-full-${{ env.BUILD_TYPE }}.apk pine-emu-$GITHUB_RUN_NUMBER-unsigned-${{ env.BUILD_TYPE }}.apk
- name: Upload Unsigned APK
if: env.IS_BUILD_SIGNED == 'false' && env.UPLOAD_ARTIFACTS == 'true'
uses: actions/upload-artifact@v4
with:
name: pine-emu-${{ github.run_number }}-unsigned-${{ env.BUILD_TYPE }}.apk
path: pine-emu-${{ github.run_number }}-unsigned-${{ env.BUILD_TYPE }}.apk