Set up Android APK build workflow for releases

This commit is contained in:
Reckless_Satoshi 2022-09-28 07:51:29 -07:00
parent 344ba2ab67
commit ab4d83bf49
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
8 changed files with 80 additions and 35 deletions

View File

@ -25,7 +25,7 @@ jobs:
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: main-js
name: mobile-main-js
path: mobile/html/Web.bundle/js/
- name: 'Install npm Dependencies'
@ -33,6 +33,20 @@ jobs:
cd mobile
npm install --force
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: 'Build Android Debug'
if: inputs.semver == '' # Only build debug if this is a pre-release
run: |
cd mobile/android
./gradlew assembleDebug
- name: 'Build Android Release'
run: |
cd mobile/android
@ -42,7 +56,7 @@ jobs:
id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: 'Upload .apk Artifact (for Release)'
- name: 'Upload .apk Release Artifact (for Release)'
uses: actions/upload-artifact@v3
if: inputs.semver != '' # If this workflow is called from release.yml
with:
@ -56,6 +70,13 @@ jobs:
name: robosats-${{ steps.commit.outputs.short }}.apk
path: mobile/android/app/build/outputs/apk/release/app-release.apk
- name: 'Upload .apk Debug Artifact (for Pre-release)'
uses: actions/upload-artifact@v3
if: inputs.semver != '' # only if this workflow is not called from a push to tag (a Release)
with:
name: robosats-debug-${{ steps.commit.outputs.short }}.apk
path: mobile/android/app/build/outputs/apk/debug/app-debug.apk
- name: 'Create Pre-release'
id: create_release
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release)
@ -64,12 +85,12 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: android-${{ steps.commit.outputs.short }}
release_name: robosats-alpha-${{ steps.commit.outputs.short }}
release_name: robosats-android-${{ steps.commit.outputs.short }}
draft: false
prerelease: true
- name: 'Upload Pre-release APK Asset'
id: upload-release-asset
- name: 'Upload Pre-release APK Release Asset'
id: upload-release-apk-asset
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release)
uses: actions/upload-release-asset@v1
env:
@ -79,3 +100,15 @@ jobs:
asset_path: ./mobile/android/app/build/outputs/apk/release/app-release.apk
asset_name: robosats-${{ steps.commit.outputs.short }}.apk
asset_content_type: application/apk
- name: 'Upload Pre-release APK Debug Asset'
id: upload-debug-apk-asset
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mobile/android/app/build/outputs/apk/debug/app-debug.apk
asset_name: robosats-debug-${{ steps.commit.outputs.short }}.apk
asset_content_type: application/apk

View File

@ -31,7 +31,7 @@ jobs:
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: main-js
name: web-main-js
path: nodeapp/static/frontend/
- name: 'Log in to Docker Hub'

View File

@ -20,7 +20,7 @@ jobs:
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: main-js
name: web-main-js
path: frontend/static/frontend/
- name: 'Log in to Docker Hub'

View File

@ -51,8 +51,13 @@ jobs:
- name: 'Archive Built Results'
uses: actions/upload-artifact@v3
with:
name: main-js
name: web-main-js
path: frontend/static/frontend/main.js
- name: 'Archive Built Results'
uses: actions/upload-artifact@v3
with:
name: mobile-main-js
path: mobile/html/Web.bundle/js/main.js
# Invoke pre-release image build if this was not a tag push
# Docker images tagged only with short commit hash

View File

@ -55,12 +55,11 @@ jobs:
needs: frontend-build
secrets: inherit
# Disabled until first Android APK release
# android-build:
# uses: reckless-satoshi/robosats/.github/workflows/coordinator-image.yml@main
# needs: frontend-build
# with:
# semver: ${{ needs.check-versions.outputs.semver }}
android-build:
uses: reckless-satoshi/robosats/.github/workflows/coordinator-image.yml@main
needs: frontend-build
with:
semver: ${{ needs.check-versions.outputs.semver }}
release:
needs: [check-versions, coordinator-image, client-image] #, android-build]
@ -79,21 +78,21 @@ jobs:
with:
body: ${{ steps.changelog.outputs.changelog }}
# Disabled until first Android APK release
# - name: 'Download APK Artifact'
# uses: dawidd6/action-download-artifact@v2
# with:
# workflow: android-build.yml
# workflow_conclusion: success
# name: robosats-${{ needs.check-versions.outputs.semver }}.apk
# path: .
# - name: 'Upload APK Asset'
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create-release.outputs.upload_url }}
# asset_path: app-release.apk
# asset_name: robosats-${{ needs.check-versions.outputs.semver }}.apk
# asset_content_type: application/apk
# Upload APK artifact
- name: 'Download APK Artifact'
uses: dawidd6/action-download-artifact@v2
with:
workflow: android-build.yml
workflow_conclusion: success
name: robosats-${{ needs.check-versions.outputs.semver }}.apk
path: .
- name: 'Upload APK Asset'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}.apk
asset_content_type: application/apk

View File

@ -1,5 +1,5 @@
# Android Pre-release
To be prepared for Android releases.
Android pre-release for testing. This pre-releases has @KoalaSats #247 torified requests through webview. While the app is not fully functioional (no cookies, therefore no permanent robot and no authenticated requests are possible), it would be great to start testing Tor requests in different systems.
App should not be used as of now. It uses the clearnet unsafe tor2web bridge.
This releases has two assets. A release-like APK and a debug APK (it will show logs for errors).

View File

@ -137,6 +137,13 @@ android {
main { assets.srcDirs = ['src/main/assets', '../../html'] }
}
packagingOptions {
pickFirst 'lib/armeabi-v7a/libruntimeexecutor.so'
pickFirst 'lib/arm64-v8a/libruntimeexecutor.so'
pickFirst 'lib/x86_64/libruntimeexecutor.so'
pickFirst 'lib/x86/libruntimeexecutor.so'
}
defaultConfig {
applicationId "com.robosats"
minSdkVersion rootProject.ext.minSdkVersion

View File

@ -8,6 +8,7 @@ buildscript {
minSdkVersion = 26
compileSdkVersion = 31
targetSdkVersion = 31
kotlin_version = "1.7.10"
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
@ -22,7 +23,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")