Merge pull request #153 from YajanaRao/develop #12
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
# This is a basic workflow to help you get started with Actions | |
name: Build | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- "README.md" | |
- "docs/**" | |
pull_request: | |
branches: [main] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
name: Building and Distribution of Production Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up ruby env | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1.2 | |
bundler-cache: true | |
- name: Set up Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: "temurin" | |
java-version: 17 | |
- name: Decode env file | |
env: | |
ENV_SECRET: ${{ secrets.ENV_SECRET }} | |
run: echo $ENV_SECRET | base64 -d > apps/mobile/.env | |
- name: Update permission of executables | |
run: chmod +x scripts/setup scripts/build | |
- name: Setup packages | |
run: npm run setup | |
- name: Android Build | |
run: npm run build | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v1 | |
if: ${{ !github.event.pull_request }} | |
with: | |
name: app-release.apk | |
path: apps/mobile/android/app/build/outputs/apk/release/app-release.apk | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: app-release.apk | |
path: apps/mobile/android/app/build/outputs/apk/release/app-release.apk | |
- name: upload artifact to Beta App Distribution | |
uses: wzieba/Firebase-Distribution-Github-Action@v1.7.0 | |
if: ${{ !github.event.pull_request }} | |
with: | |
appId: ${{secrets.FIREBASE_APP_ID}} | |
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | |
serviceCredentialsFile: apps/mobile/android/app/google-services.json | |
groups: beta | |
file: apps/mobile/android/app/build/outputs/apk/release/app-release.apk | |
releaseNotes: | | |
Below is the apk for commit: ${{ github.event.head_commit.message }} | |
- name: Upload artifact to telegram channel | |
uses: appleboy/telegram-action@master | |
if: ${{ !github.event.pull_request }} | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
Below is the apk for commit: ${{ github.event.head_commit.message }} | |
document: ${{ github.workspace }}/apps/mobile/android/app/build/outputs/apk/release/app-release.apk | |
- name: Download APK from build | |
uses: actions/download-artifact@v1 | |
with: | |
name: app-release.apk | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ github.run_number }} | |
files: app-release.apk/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |