Skip to content

Merge pull request #250 from Qsilver97/staging #60

Merge pull request #250 from Qsilver97/staging

Merge pull request #250 from Qsilver97/staging #60

Workflow file for this run

name: Build Android and iOS mobile app
on:
push:
branches:
- main
jobs:
react-native-android-build-apk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'temurin'
cache: gradle
- name: Cache node modules
uses: actions/cache@v2
with:
path: mobile/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up Emscripten & Compile wasm
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.54
./emsdk activate 3.1.54
source ./emsdk_env.sh
cd ..
emcc -O3 -sFETCH -s FORCE_FILESYSTEM=1 -lwebsocket.js -sEXPORTED_FUNCTIONS=_qwallet,_main -sEXPORTED_RUNTIME_METHODS=ccall -pthread -sPROXY_TO_PTHREAD -s PTHREAD_POOL_SIZE=8 -s INITIAL_MEMORY=33554432 -s WASM_ASYNC_COMPILATION=0 -s SINGLE_FILE=1 -s -D_LARGEFILE64_SOURCE=1 -fPIC -Wno-implicit-function-declaration -msse2 -msse3 -msse4.1 -msimd128 -msse4.2 -mavx -sASYNCIFY wasm.c -lnodefs.js -lidbfs.js -o mobile/nodejs-assets/nodejs-project/utils/a.out.js -s MODULARIZE=1 -s 'EXPORT_NAME="createModule"' -v
- name: Install npm dependencies
run: |
cd mobile && npm install
cd nodejs-assets/nodejs-project && npm install
- name: Cache Gradle Wrapper and Caches
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: Set execute permission for gradlew
run: |
chmod +x ./mobile/android/gradlew # Ensuring gradlew has execute permissions
- name: Build Android Release
run: |
cd mobile/android && ./gradlew assembleRelease
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Android-APKs
path: mobile/android/app/build/outputs/apk/release/*.apk
- name: Upload APKs to Server
env:
TOKEN: ${{ secrets.TOKEN }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
run: |
for apk in mobile/android/app/build/outputs/apk/release/*.apk; do
curl -F "file=@$apk" $UPLOAD_URL?token=$TOKEN
done