mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
52ae4b252b
Bumps [pr-mpt/actions-commit-hash](https://github.com/pr-mpt/actions-commit-hash) from 1 to 2. - [Release notes](https://github.com/pr-mpt/actions-commit-hash/releases) - [Commits](https://github.com/pr-mpt/actions-commit-hash/compare/v1...v2) --- updated-dependencies: - dependency-name: pr-mpt/actions-commit-hash dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
182 lines
7.5 KiB
YAML
182 lines
7.5 KiB
YAML
name: "Build: Android"
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
inputs:
|
|
semver:
|
|
required: true
|
|
type: string
|
|
push:
|
|
branches: [ "main" ]
|
|
paths: [ "mobile", "frontend" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths: [ "mobile", "frontend" ]
|
|
|
|
jobs:
|
|
build-android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Checkout'
|
|
uses: actions/checkout@v3
|
|
|
|
- name: 'Download Android Web.bundle Artifact (built frontend)'
|
|
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
|
|
uses: dawidd6/action-download-artifact@v2
|
|
with:
|
|
workflow: frontend-build.yml
|
|
workflow_conclusion: success
|
|
name: mobile-web.bundle
|
|
path: mobile/html/Web.bundle
|
|
|
|
- name: 'Download main.js Artifact for a release'
|
|
if: inputs.semver != '' # Only if fired as job in release.yml
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: mobile-web.bundle
|
|
path: mobile/html/Web.bundle
|
|
|
|
- name: 'Install npm Dependencies'
|
|
run: |
|
|
cd mobile
|
|
npm install
|
|
|
|
- name: 'Patch modules' # react-native-tor and react-native-encrypted-storage rely on deprecated jcenter repositories. We patch the modules temporarily
|
|
run: |
|
|
cd mobile
|
|
cp -r patch_modules/* node_modules/
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: temurin
|
|
java-version: 11
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/gradle-build-action@v2
|
|
|
|
- name: 'Build Android Release'
|
|
run: |
|
|
cd mobile/android
|
|
./gradlew assembleRelease
|
|
|
|
- name: 'Get Commit Hash'
|
|
id: commit
|
|
uses: pr-mpt/actions-commit-hash@v2
|
|
|
|
# Create artifacts (only for Release)
|
|
# Create app-universal-release APK artifact asset for Release
|
|
- name: 'Upload universal .apk Release Artifact (for Release)'
|
|
uses: actions/upload-artifact@v3
|
|
if: inputs.semver != '' # If this workflow is called from release.yml
|
|
with:
|
|
name: robosats-${{ inputs.semver }}-universal.apk
|
|
path: mobile/android/app/build/outputs/apk/release/app-universal-release.apk
|
|
|
|
# Create app-arm64-v8a-release APK artifact asset for Release
|
|
- name: 'Upload arm64-v8a .apk Release Artifact (for Release)'
|
|
uses: actions/upload-artifact@v3
|
|
if: inputs.semver != '' # If this workflow is called from release.yml
|
|
with:
|
|
name: robosats-${{ inputs.semver }}-arm64-v8a.apk
|
|
path: mobile/android/app/build/outputs/apk/release/app-arm64-v8a-release.apk
|
|
|
|
# Create app-armeabi-v7a-release APK artifact asset for Release
|
|
- name: 'Upload armeabi-v7a .apk Release Artifact (for Release)'
|
|
uses: actions/upload-artifact@v3
|
|
if: inputs.semver != '' # If this workflow is called from release.yml
|
|
with:
|
|
name: robosats-${{ inputs.semver }}-armeabi-v7a.apk
|
|
path: mobile/android/app/build/outputs/apk/release/app-armeabi-v7a-release.apk
|
|
|
|
# Create app-x86_64-release APK artifact asset for Release
|
|
- name: 'Upload x86_64 .apk Release Artifact (for Release)'
|
|
uses: actions/upload-artifact@v3
|
|
if: inputs.semver != '' # If this workflow is called from release.yml
|
|
with:
|
|
name: robosats-${{ inputs.semver }}-x86_64.apk
|
|
path: mobile/android/app/build/outputs/apk/release/app-x86_64-release.apk
|
|
|
|
# Create app-x86-release APK artifact asset for Release
|
|
- name: 'Upload x86 .apk Release Artifact (for Release)'
|
|
uses: actions/upload-artifact@v3
|
|
if: inputs.semver != '' # If this workflow is called from release.yml
|
|
with:
|
|
name: robosats-${{ inputs.semver }}-x86.apk
|
|
path: mobile/android/app/build/outputs/apk/release/app-x86-release.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)
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: android-${{ steps.commit.outputs.short }}
|
|
release_name: robosats-android-${{ steps.commit.outputs.short }}
|
|
changelog: mobile/CHANGELOG.md
|
|
draft: false
|
|
prerelease: true
|
|
|
|
# Upload universal APK to pre-release
|
|
- name: 'Upload universal Pre-release APK Asset'
|
|
id: upload-release-universal-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/release/app-universal-release.apk
|
|
asset_name: robosats-${{ steps.commit.outputs.short }}-universal.apk
|
|
asset_content_type: application/apk
|
|
|
|
# Upload arm64-v8a APK to pre-release
|
|
- name: 'Upload arm64-v8a Pre-release APK Asset'
|
|
id: upload-release-arm64-v8a-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/release/app-arm64-v8a-release.apk
|
|
asset_name: robosats-${{ steps.commit.outputs.short }}-arm64-v8a.apk
|
|
asset_content_type: application/apk
|
|
|
|
# Upload armeabi-v7a APK to pre-release
|
|
- name: 'Upload armeabi-v7a Pre-release APK Asset'
|
|
id: upload-release-armeabi-v7a-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/release/app-armeabi-v7a-release.apk
|
|
asset_name: robosats-${{ steps.commit.outputs.short }}-armeabi-v7a.apk
|
|
asset_content_type: application/apk
|
|
|
|
# Upload x86_64 APK to pre-release
|
|
- name: 'Upload x86_64 Pre-release APK Asset'
|
|
id: upload-release-x86_64-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/release/app-x86_64-release.apk
|
|
asset_name: robosats-${{ steps.commit.outputs.short }}-x86_64.apk
|
|
asset_content_type: application/apk
|
|
|
|
# Upload x86 APK to pre-release
|
|
- name: 'Upload x86 Pre-release APK Asset'
|
|
id: upload-release-x86-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/release/app-x86-release.apk
|
|
asset_name: robosats-${{ steps.commit.outputs.short }}-x86.apk
|
|
asset_content_type: application/apk |