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: with:
workflow: frontend-build.yml workflow: frontend-build.yml
workflow_conclusion: success workflow_conclusion: success
name: main-js name: mobile-main-js
path: mobile/html/Web.bundle/js/ path: mobile/html/Web.bundle/js/
- name: 'Install npm Dependencies' - name: 'Install npm Dependencies'
@ -33,6 +33,20 @@ jobs:
cd mobile cd mobile
npm install --force 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' - name: 'Build Android Release'
run: | run: |
cd mobile/android cd mobile/android
@ -42,7 +56,7 @@ jobs:
id: commit id: commit
uses: pr-mpt/actions-commit-hash@v1 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 uses: actions/upload-artifact@v3
if: inputs.semver != '' # If this workflow is called from release.yml if: inputs.semver != '' # If this workflow is called from release.yml
with: with:
@ -56,6 +70,13 @@ jobs:
name: robosats-${{ steps.commit.outputs.short }}.apk name: robosats-${{ steps.commit.outputs.short }}.apk
path: mobile/android/app/build/outputs/apk/release/app-release.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' - name: 'Create Pre-release'
id: create_release id: create_release
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a 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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
tag_name: android-${{ steps.commit.outputs.short }} 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 draft: false
prerelease: true prerelease: true
- name: 'Upload Pre-release APK Asset' - name: 'Upload Pre-release APK Release Asset'
id: upload-release-asset id: upload-release-apk-asset
if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release) if: inputs.semver == '' # only if this workflow is not called from a push to tag (a Release)
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
env: env:
@ -79,3 +100,15 @@ jobs:
asset_path: ./mobile/android/app/build/outputs/apk/release/app-release.apk asset_path: ./mobile/android/app/build/outputs/apk/release/app-release.apk
asset_name: robosats-${{ steps.commit.outputs.short }}.apk asset_name: robosats-${{ steps.commit.outputs.short }}.apk
asset_content_type: application/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: with:
workflow: frontend-build.yml workflow: frontend-build.yml
workflow_conclusion: success workflow_conclusion: success
name: main-js name: web-main-js
path: nodeapp/static/frontend/ path: nodeapp/static/frontend/
- name: 'Log in to Docker Hub' - name: 'Log in to Docker Hub'

View File

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

View File

@ -51,8 +51,13 @@ jobs:
- name: 'Archive Built Results' - name: 'Archive Built Results'
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: main-js name: web-main-js
path: frontend/static/frontend/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 # Invoke pre-release image build if this was not a tag push
# Docker images tagged only with short commit hash # Docker images tagged only with short commit hash

View File

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

View File

@ -1,5 +1,5 @@
# Android Pre-release # 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'] } 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 { defaultConfig {
applicationId "com.robosats" applicationId "com.robosats"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion

View File

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