Skip to content

Update build.yml

Update build.yml #1

Workflow file for this run

name: android-release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: platform/android
env:
JOBS: 8
BUILDTYPE: Release
IS_LOCAL_DEVELOPMENT: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- run: echo "cmake.dir=$(dirname "$(dirname "$(command -v cmake)")")" >> local.properties
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: npm install
run: npm install --ignore-scripts
working-directory: platform/android
- name: Install ccache
run: sudo apt-get install -y ccache
- name: Prepare ccache
run: ccache --clear
- name: Cache ccache
uses: actions/cache@v3
env:
cache-name: ccache-v1
with:
path: ~/.ccache'
key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
${{ env.cache-name }}-${{ runner.os }}-${{ github.job }}-${{ github.ref }}
${{ env.cache-name }}-${{ runner.os }}-${{ github.job }}
- name: Clear ccache statistics
run: |
ccache --zero-stats
ccache --max-size=2G
ccache --show-stats
- name: restore-gradle-cache
uses: actions/cache@v3
env:
cache-name: gradle-v1
with:
path: ~/.gradle'
key: ${{ env.cache-name }}-${{ hashFiles('platform/android/gradle/dependencies.gradle') }}-${{ hashFiles('platform/android/build.gradle') }}-${{ hashFiles('platform/android/local.properties') }}-${{ hashFiles('platform/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
- ${{ env.cache-name }}
- name: Build package
run: make apackage