ae56d3685c
* refactor(nc-android): move nc android into mobile/nym-connect rename the android app ID to "nym_connect" * chore(nc-mobile): restore dist directory * fix: typo * chore: restore gitkeep * chore: track Cargo.lock * ci: trigger ts lint workflow on pull request * refactor(nym-connect): new structure move temp mobile version under nym-connect-new/mobile * refactor(nym-connect): new structure move temp desktop version under nym-connect-new/desktop * refactor(nym-connect): new structure rename nym-connect-new to nym-connect * refactor(nym-connect): new structure restore lost .gitkeep * refactor(nym-connect): new structure restore lost .gitkeep * fix(nym-connect-desktop): broken relative paths * fix(nym-connect-mobile): add todo comment about broken deps * ci(nym-connect): fix relative paths * ci(nym-connect): rename workflow
135 lines
4.2 KiB
YAML
135 lines
4.2 KiB
YAML
name: Nym Connect - Android APK Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- "release/nc-android-v[0-9].[0-9].[0-9]*"
|
|
|
|
jobs:
|
|
build:
|
|
name: Build APK
|
|
runs-on: custom-runner-linux
|
|
env:
|
|
ANDROID_HOME: ${{ github.workspace }}/android-sdk
|
|
NDK_VERSION: 25.1.8937393
|
|
NDK_HOME: ${{ github.workspace }}/android-sdk/ndk/25.1.8937393
|
|
SDK_PLATFORM_VERSION: android-33
|
|
SDK_BUILDTOOLS_VERSION: 33.0.1
|
|
|
|
steps:
|
|
- name: Install Dependencies (Linux)
|
|
# https://next--tauri.netlify.app/next/guides/getting-started/prerequisites/linux/#1-system-dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
libwebkit2gtk-4.0-dev \
|
|
build-essential \
|
|
unzip \
|
|
curl \
|
|
wget \
|
|
libssl-dev \
|
|
libgtk-3-dev \
|
|
squashfs-tools \
|
|
libayatana-appindicator3-dev \
|
|
librsvg2-dev
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install Java
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
|
|
- name: Install Android SDK manager
|
|
# https://developer.android.com/studio/command-line/sdkmanager
|
|
run: |
|
|
curl -sS https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -o cmdline-tools.zip
|
|
unzip cmdline-tools.zip
|
|
mkdir -p $ANDROID_HOME/cmdline-tools/latest
|
|
mv cmdline-tools/* $ANDROID_HOME/cmdline-tools/latest
|
|
rm -rf cmdline-tools
|
|
|
|
- name: Install Android S/NDK
|
|
run: |
|
|
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
|
|
echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
|
|
"platforms;$SDK_PLATFORM_VERSION" \
|
|
"platform-tools" \
|
|
"ndk;$NDK_VERSION" \
|
|
"build-tools;$SDK_BUILDTOOLS_VERSION"
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install tauri cli
|
|
run: cargo install tauri-cli --version "^2.0.0-alpha.2"
|
|
|
|
- name: Install rust android targets
|
|
run: |
|
|
rustup target add aarch64-linux-android \
|
|
armv7-linux-androideabi \
|
|
i686-linux-android \
|
|
x86_64-linux-android
|
|
|
|
- name: Setup Nodejs
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18
|
|
|
|
- name: Install yarn
|
|
run: |
|
|
npm i -g yarn
|
|
yarn --version
|
|
|
|
- name: Build frontend code
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
yarn build
|
|
yarn workspace @nym/nym-connect-mobile webpack:prod
|
|
|
|
- name: Build APK
|
|
working-directory: nym-connect/mobile
|
|
env:
|
|
ANDROID_SDK_ROOT: ${{ env.ANDROID_HOME }}
|
|
WRY_ANDROID_PACKAGE: net.nymtech.nym_connect
|
|
WRY_ANDROID_LIBRARY: nym_connect
|
|
# TODO build with release profile (--release), it will requires
|
|
# to sign the APK. For now build with debug profile to avoid that
|
|
run: cargo tauri android build --debug --apk --split-per-abi -t aarch64
|
|
|
|
# TODO add the version number to APK name
|
|
- name: Rename APK artifact
|
|
run: |
|
|
mkdir apk/
|
|
mv nym-connect/mobile/src-tauri/gen/android/nym_connect/app/build/outputs/apk/arm64/debug/app-arm64-debug.apk \
|
|
apk/nym-connect-arm64-debug.apk
|
|
mv nym-connect/mobile/src-tauri/gen/android/nym_connect/app/build/outputs/apk/x86_64/debug/app-x86_64-debug.apk \
|
|
apk/nym-connect-x86_64-debug.apk
|
|
|
|
- name: Upload APK artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: nc-apk-debug
|
|
path: |
|
|
apk/nym-connect-arm64-debug.apk
|
|
apk/nym-connect-x86_64-debug.apk
|
|
|
|
# publish:
|
|
# name: Publish APK
|
|
# needs: build
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Checkout
|
|
# uses: actions/checkout@v3
|
|
# - name: Download binary artifact
|
|
# uses: actions/download-artifact@v3
|
|
# with:
|
|
# name: nc-apk-debug
|
|
# path: apk
|
|
# # TODO add a step to upload the APK somewhere
|
|
# - name: Publish
|
|
# uses: ???
|