mirror of
https://github.com/laurent22/joplin.git
synced 2026-10-25 02:47:28 +00:00
85 lines
3.0 KiB
YAML
85 lines
3.0 KiB
YAML
# The goal of this action is to compile the Android debug build. That should
|
|
# tell us automatically if something got broken when a dependency was changed.
|
|
|
|
name: react-native-android-build-apk
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
AssembleRelease:
|
|
if: github.repository == 'laurent22/joplin'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Linux dependencies
|
|
run: |
|
|
sudo apt-get update || true
|
|
sudo apt-get install -y libsecret-1-dev
|
|
|
|
# Free disk space before anything else so the Gradle/NDK transforms
|
|
# (which can write 20GB+ during react-native-quick-crypto's OpenSSL
|
|
# build) don't exhaust the runner's ~14GB free space. Keep the Android
|
|
# SDK and Java toolchains; remove the large preinstalled packages this
|
|
# workflow doesn't use.
|
|
- name: Free disk space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet || true
|
|
sudo rm -rf /usr/share/swift || true
|
|
sudo rm -rf /opt/ghc || true
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
|
|
sudo rm -rf /usr/local/share/boost || true
|
|
sudo rm -rf /usr/local/share/powershell || true
|
|
docker system prune -af || true
|
|
df -h /
|
|
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '20'
|
|
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
cache: 'yarn'
|
|
|
|
- uses: ./.github/workflows/shared/install-yarn
|
|
|
|
- name: Install
|
|
run: |
|
|
source "${GITHUB_WORKSPACE}/.github/scripts/retry.sh"
|
|
retry yarn install
|
|
env:
|
|
SKIP_ONENOTE_CONVERTER_BUILD: 1
|
|
|
|
- name: Assemble Android Release
|
|
run: |
|
|
cd packages/app-mobile/android
|
|
sed -i -- 's/signingConfig signingConfigs.release/signingConfig signingConfigs.debug/' app/build.gradle
|
|
./gradlew assembleRelease
|
|
|
|
- name: Verify alignment
|
|
run: |
|
|
cd packages/app-mobile/android/app
|
|
APK_FILE="./build/outputs/apk/release/app-release.apk"
|
|
if test ! -f "$APK_FILE" ; then
|
|
echo "APK file not found."
|
|
exit 1
|
|
else
|
|
echo "APK file found at: $APK_FILE"
|
|
fi
|
|
|
|
BUILD_TOOLS_PATH="$ANDROID_HOME/build-tools/"
|
|
if test ! -d "$BUILD_TOOLS_PATH" ; then
|
|
echo "Build tools not found at $BUILD_TOOLS_PATH ($ANDROID_HOME, $BUILD_TOOLS_VERSION)"
|
|
exit 1
|
|
fi
|
|
# The build-tools/ directory contains different subdirectories
|
|
# for each build tools version. As a result, there may be multiple
|
|
# zipalign tools. Select the most recent (biggest two-digit version number):
|
|
ZIPALIGN_PATH="$(find $BUILD_TOOLS_PATH -name "zipalign" -print | sort | tail -n1)"
|
|
if test ! -x "$ZIPALIGN_PATH" ; then
|
|
echo "zipalign not found (searching in $BUILD_TOOLS_PATH, candidate: $ZIPALIGN_PATH)"
|
|
exit 1
|
|
fi
|
|
"$ZIPALIGN_PATH" -c -P 16 -v 4 "$APK_FILE"
|