Update testing.yml #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Create APK | |
permissions: | |
contents: write | |
defaults: | |
run: | |
working-directory: ./prototype_rust_wrapper | |
env: | |
ANDROID_ARCH: x86_64 | |
ANDROID_TARGET: google_apis_playstore | |
API_LEVEL: 33 | |
ANDROID_BUILD_TOOLS_VERSION: 33.0.2 | |
ANDROID_SDK_PACKAGES: system-images;android-33;google_apis_playstore;x86_64 platforms;android-33 build-tools;33.0.2 platform-tools emulator | |
EMULATOR_TIMEOUT: 350 | |
EMULATOR_NAME: nexus | |
# The name of the main module repository | |
main_project_module: app | |
# The name of the Play Store | |
playstore_name: Frogobox ID | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
shell: bash | |
jobs: | |
playwright-emulator: | |
timeout-minutes: 20 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Add avdmanager and sdkmanager to system PATH | |
run: | | |
echo "$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/${{ env.ANDROID_BUILD_TOOLS_VERSION }}" >> $GITHUB_PATH | |
- name: Install Sdk | |
run: | | |
yes Y | sdkmanager --licenses | |
sdkmanager --install ${ANDROID_SDK_PACKAGES} | |
- name: Build emulator | |
run: | | |
echo "no" | avdmanager --verbose create avd --force -n $EMULATOR_NAME --abi "${ANDROID_TARGET}/${ANDROID_ARCH}" -k "system-images;android-${API_LEVEL};${ANDROID_TARGET};${ANDROID_ARCH}" | |
- name: install NDK | |
run: | | |
cargo install cargo-ndk | |
- name: rustup | |
run: | | |
rustup target add \ | |
aarch64-linux-android \ | |
armv7-linux-androideabi \ | |
x86_64-linux-android \ | |
i686-linux-android | |
# - name: building ndk | |
# run: | | |
# cargo ndk -t arm64-v8a -o ./ build | |
- name: Smoke test `ndk-env` | |
run: cargo ndk-env | |
- name: building arm64-v8a | |
run: cargo ndk -t arm64-v8a -o ../prototype/app/src/main/jniLibs/ build | |
- name: building i686-linux-android | |
run: cargo ndk -t i686-linux-android -o ../prototype/app/src/main/jniLibs/ build | |
- name: Set Up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' # See 'Supported distributions' for available options | |
java-version: '17' | |
cache: 'gradle' | |
- name: Change wrapper permissions | |
working-directory: ./prototype | |
run: chmod +x ./gradlew | |
- name: Build Release apk | |
working-directory: ./prototype | |
env: | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: ./gradlew assembleRelease --stacktrace | |
- name: Build Release bundle | |
working-directory: ./prototype | |
env: | |
RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }} | |
RELEASE_KEYSTORE_ALIAS: ${{ secrets.RELEASE_KEYSTORE_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
run: ./gradlew bundleRelease --stacktrace | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Build with Gradle | |
working-directory: ./prototype | |
run: ./gradlew build | |
- name: upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: apk | |
path: /Users/runner/work/netwatch/netwatch/prototype/app/build/outputs/apk/debug |