robosats/.github/workflows/android-build.yml

67 lines
2.0 KiB
YAML
Raw Normal View History

2022-07-14 17:27:14 +00:00
name: Android Build
on:
workflow_dispatch:
push:
branches: [ "main" , "android-webview-app-ts"]
paths: [ "mobile", "frontend" ]
pull_request:
branches: [ "main" , "android-webview-app-ts"]
paths: [ "mobile", "frontend" ]
2022-07-11 14:47:54 +00:00
2022-07-14 17:27:14 +00:00
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
2022-07-11 14:47:54 +00:00
2022-07-14 17:27:14 +00:00
- name: 'Download main.js Artifact'
uses: dawidd6/action-download-artifact@v2
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: main-js
path: mobile/html/Web.bundle/js/
2022-07-11 14:47:54 +00:00
- name: 'Install npm Dependencies'
2022-07-14 17:27:14 +00:00
run: |
2022-07-11 14:47:54 +00:00
cd mobile
2022-07-14 17:27:14 +00:00
npm install
2022-07-11 14:47:54 +00:00
2022-07-14 17:27:14 +00:00
- name: 'Build Android Release'
run: |
2022-07-11 14:47:54 +00:00
cd mobile/android
./gradlew assembleRelease
- name: 'Get Commit Hash'
id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: 'Upload APK Artifact'
2022-07-14 17:27:14 +00:00
uses: actions/upload-artifact@v3
with:
2022-07-11 14:47:54 +00:00
name: robosats-${{ steps.commit.outputs.short }}.zip
path: mobile/android/app/build/outputs/apk/release/
- name: 'Create Pre-release'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: android-${{ steps.commit.outputs.short }}
release_name: robosats-alpha-${{ steps.commit.outputs.short }}
body_path: CHANGELOG.md
draft: false
prerelease: true
- name: 'Upload Pre-release 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: ./mobile/android/app/build/outputs/apk/release/app-release.apk
asset_name: robosats-${{ steps.commit.outputs.short }}.apk
asset_content_type: application/apk