Skip to content

Fixed work on Android 14 #14

Fixed work on Android 14

Fixed work on Android 14 #14

Workflow file for this run

name: Android CI
on:
push:
branches:
- main
- master
- devel
- versus-ci-android
pull_request:
branches:
- main
- master
#defaults:
# run:
# working-directory: .
jobs:
build:
runs-on: ubuntu-latest
name: Build release-apk
steps:
- uses: styfle/[email protected]
with:
workflow_id: android-ci.yml
all_but_latest: true
access_token: ${{ github.token }}
- uses: actions/checkout@v4
# - uses: nelonoel/[email protected]
- uses: Wohlstand/[email protected]
- name: Pull submodules
shell: bash
run: |
git submodule init
git submodule update
- name: Install Dependencies
shell: bash
run: |
sudo apt-get update -qq
sudo apt-get install -qq lftp
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: 17
distribution: 'temurin'
- uses: nttld/setup-ndk@v1
with:
ndk-version: r23c
# IMPORTANT NOTE: The SDK r23b is REQUIRED to support Android 4.1, 4.2, and 4.3, and to support non-Neon hardware
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Output version code
run: echo VERSION_CODE=${{ github.run_number }} > ./version.properties
- name: Import the signing
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > release-key.jks
- name: Build with Gradle
run: ./gradlew bundleReleaseci assembleReleaseci
env:
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
PIN_ALIAS: ${{ secrets.PIN_ALIAS }}
DB_PASS_ALIAS: ${{ secrets.DB_PASS_ALIAS }}
- name: Rename APK
shell: bash
run: |
if [[ "${BRANCH_NAME}" == *"merge"* ]]; then
BRANCH_NAME_RES="pull-request"
echo "-- Pull-request detected!"
else
BRANCH_NAME_RES=${BRANCH_NAME}
fi
mv ADLMIDI-Player/build/outputs/apk/releaseci/ADLMIDI-Player-releaseci.apk ADLMIDI-Player-android-${BRANCH_NAME_RES}.apk
mv ADLMIDI-Player/build/outputs/bundle/releaseci/ADLMIDI-Player-releaseci.aab ADLMIDI-Player-android-${BRANCH_NAME_RES}.aab
- name: Upload APK
if: success()
uses: actions/upload-artifact@v4
with:
name: ADLMIDI-Player-android-APK
path: ADLMIDI-Player-android-*.apk
- name: Upload AAB
if: success()
uses: actions/upload-artifact@v4
with:
name: ADLMIDI-Player-android-AAB
path: ADLMIDI-Player-android-*.aab
- name: Deploy to builds.wohlsoft.ru
if: success() && github.event_name != 'pull_request'
shell: bash
run: |
if [[ "${BRANCH_NAME}" == *"merge"* ]]; then
BRANCH_NAME_RES="pull-request"
echo "-- Pull-request detected!"
else
BRANCH_NAME_RES=${BRANCH_NAME}
fi
UPLOAD_LIST="set ssl:verify-certificate no;"
UPLOAD_LIST="${UPLOAD_LIST} put -O "www/android/" ./ADLMIDI-Player-android-${BRANCH_NAME_RES}.apk;"
UPLOAD_LIST="${UPLOAD_LIST} put -O "www/android/" ./ADLMIDI-Player-android-${BRANCH_NAME_RES}.aab;"
lftp -e "${UPLOAD_LIST} exit" -u ${{ secrets.builds_login }},${{ secrets.builds_password }} ${{ secrets.builds_host }}
- name: List Build Directory
if: always()
shell: bash
run: |
git status
ls -lR .