Skip to content

Fix release

Fix release #1157

Workflow file for this run

name: "Build: Android"
on:
workflow_dispatch:
keystore:
type: string
description: base64 keystore
workflow_call:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
KEY_STORE_PASS: ${{ secrets.KEY_STORE_PASS }}
KEYSTORE: ${{ secrets.KEYSTORE }}
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Install yarn Dependencies'
run: |
yarn install
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 19
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'keystore.jks'
fileDir: './'
encodedString: ${{ env.KEYSTORE }}
- name: 'Build Android Release'
run: |
cd android
./gradlew assembleRelease
- name: 'Check for non-FOSS libraries'
run: |
wget https://github.com/iBotPeaches/Apktool/releases/download/v2.7.0/apktool_2.7.0.jar
wget https://github.com/iBotPeaches/Apktool/raw/master/scripts/linux/apktool
# clone the repo
git clone https://gitlab.com/IzzyOnDroid/repo.git
# create a directory for Apktool and move the apktool* files there
mkdir -p repo/lib/radar/tool
mv apktool* repo/lib/radar/tool
# create an alias for ease of use
chmod u+x repo/lib/radar/tool/apktool
mv repo/lib/radar/tool/apktool_2.7.0.jar repo/lib/radar/tool/apktool.jar
repo/bin/scanapk.php android/app/build/outputs/apk/release/app-universal-release.apk
- name: 'Get Commit Hash'
id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: 'Upload universal .apk Release Artifac'
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
name: nostros-${{ github.ref_name }}-universal.apk
path: android/app/build/outputs/apk/release/app-universal-release.apk
- name: 'Upload arm64-v8a .apk Release Artifac'
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
name: nostros-${{ github.ref_name }}-arm64-v8a.apk
path: android/app/build/outputs/apk/release/app-arm64-v8a-release.apk
- name: 'Upload armeabi-v7a .apk Release Artifac'
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'pull_request' }}
with:
name: nostros-${{ github.ref_name }}-armeabi-v7a.apk
path: android/app/build/outputs/apk/release/app-armeabi-v7a-release.apk