Skip to content

Update build.yml

Update build.yml #11

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout android
uses: actions/checkout@v4
with:
path: android
- name: Checkout nwcompat
uses: actions/checkout@v4
with:
repository: fifomori/nwcompat
path: nwcompat
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: latest
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Build nwcompat
run: |
cd nwcompat
pnpm install
pnpm build
- name: Copy nwcompat bundle to android
run: |
cp nwcompat/nwcompat.js nwcompat/nwcompat-loader.js nwcompat/dist/* android/app/src/main/assets
- name: Setup keystore
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.KEYSTORE }}
filename: keystore
working-directory: '.'
- name: Debug
run: echo " == $(pwd)" && ls && echo ' == assets' && ls android/app/src/main/assets && env
- name: Build apk
env:
GITHUB_ACTION_PATH: ${{ secrets.STORE_PASSWORD }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
cd android
./gradlew assembleDebug --no-configuration-cache --no-daemon
-Pandroid.injected.signing.store.file="$GITHUB_ACTION_PATH/keystore"
-Pandroid.injected.signing.store.password="$STORE_PASSWORD"
-Pandroid.injected.signing.key.alias="key0"
-Pandroid.injected.signing.key.password="$KEY_PASSWORD"
- name: Upload apk
uses: actions/upload-artifact@v4
with:
name: app-debug.apk
path: app/build/outputs/apk/release/app-debug.apk