Skip to content

Add elif (#1056)

Add elif (#1056) #206

Workflow file for this run

name: Mobile - Main (Build & Deploy)
on:
push:
branches:
- main
paths:
- "src/MobileUI/**"
workflow_dispatch:
jobs:
generate_build_number:
runs-on: ubuntu-latest
outputs:
buildNumber: ${{ steps.set_build_number.outputs.buildNumber }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate build number
id: set_build_number
run: |
commitHash=$(git rev-parse HEAD)
hexBuildNumber=${commitHash: -8}
# Convert hexadecimal to uppercase
hexBuildNumber=$(echo "$hexBuildNumber" | tr '[:lower:]' '[:upper:]')
# Convert from hexadecimal to decimal
buildNumber=$(echo "ibase=16; $hexBuildNumber" | bc)
echo "Decimal Build Number based on Commit ID: $buildNumber"
echo "buildNumber=$buildNumber" >> $GITHUB_ENV
echo "buildNumber=$buildNumber" >> $GITHUB_OUTPUT
android_build:
name: Build Android app
needs: generate_build_number
uses: ./.github/workflows/android-build.yml
with:
environment: prod
build_number: ${{ needs.generate_build_number.outputs.buildNumber }}
secrets: inherit
ios_build:
name: Build iOS app
needs: generate_build_number
uses: ./.github/workflows/ios-build.yml
with:
environment: prod
build_number: ${{ needs.generate_build_number.outputs.buildNumber }}
secrets: inherit
deploy_android:
name: Deploy Android app
needs: [generate_build_number, android_build]
uses: ./.github/workflows/android-deploy.yml
with:
environment: prod
build_number: ${{ needs.generate_build_number.outputs.buildNumber }}
secrets: inherit
deploy_ios:
name: Deploy iOS app
needs: [generate_build_number, ios_build]
uses: ./.github/workflows/ios-deploy.yml
with:
environment: prod
build_number: ${{ needs.generate_build_number.outputs.buildNumber }}
secrets: inherit